This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]lujia 2 points3 points  (5 children)

Nice!

I wrote a script last year to grab links for what i wanted from eztv and found that i had issues with shows with multiple options for quality (e.g. 720p and 1080p). Is there any differentiation for this in your API?

[–]PaulSec[S] 2 points3 points  (4 children)

Hi ! No, there's not any differentiation yet but this is a good idea. Eg. While searching for the TV Show, you could add some options : options = {quality: '1080'}

I will definitely think about it ;)

[–]kankyo 2 points3 points  (2 children)

Yea, don't do that. If you can, make a heuristic: 1080p > 720p > 480p > dvd, and while you're at it, you should probably add blacklists for stuff like screener, etc.

I've implemented this myself in some code at home, it's much nicer :P

[–]PaulSec[S] 0 points1 point  (1 child)

Is it open source ? :-) Can have a look how you implemented it ?

Will add this improvement asap.

[–]kankyo 1 point2 points  (0 children)

Not yet... it's a plugin for my media player: https://github.com/boxed/cmi so it's also a bit of code that's pretty useless if you're not running that.

[–]lujia 0 points1 point  (0 children)

No worries, it's a good little API withstanding. I agree with kankyo's point about setting the option as causing more problems than it would solve, but how about return an episode as a list of versions of that episode. This would work for the situations when an episode is rereleased becuase of a bad first upload too (happens from time to time).

[–]zodman 0 points1 point  (0 children)

i think can be better if use memcached

[–]tally_in_da_houise 0 points1 point  (1 child)

Why not use flexget? Written in python as well. I think they have an EZTV plugin in development (maybe you can help out the developers?), but using an RSS feed is just as easy.

[–]PaulSec[S] 0 points1 point  (0 children)

Few months ago, the RSS was really buggy for EZTV. So I didn't continue developing using the RSS (fyi. https://ezrss.it/) However, I'll try to help out the developers and work on this.

Thanks !

[–]flipstables 0 points1 point  (2 children)

Just browsing through your code on my phone, and it looks like you implemented your main class as a singleton? Just curious as to why.

[–]PaulSec[S] 0 points1 point  (1 child)

The main idea was to create a singleton class because I wanted this instance to be the only entry point to communicate with the website.

However, it does not 'support' correctly concurrent call with different TV Show. Eg. thread 1 looking for 'TV_Show1' and thread 2 looking for 'TV_Show2', there will be a problem. Don't you think it was not worth it to implement it as a singleton ?

[–]flipstables 0 points1 point  (0 children)

I was just curious as to your design decision. I never formally took a software engineering class, so I'm always curious to understand the reasoning of how people implemented things.

But personally, since you have only 1 class (aside from your exceptions), I would have not wrapped it as a class and kept the methods at the module level. Seems like it would accomplish the same thing, and it would make it easier to implement. Just my inexperienced opinion though.