Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.7.x #404

Merged
merged 28 commits into from
Mar 4, 2015
Merged

0.7.x #404

merged 28 commits into from
Mar 4, 2015

Conversation

caronc
Copy link

@caronc caronc commented Sep 18, 2014

I've been maintaining a plugin (forum) to your fantastic subtitle fetcher you've written. The plugin is for NZBGet (a UseNet solution). You can see this blog if interested. I'm only utilizing the 0.7.x branch, but have added some stability to it along with back porting older code so that it works with people running older versions of python (v2.6+) (like myself). The backporting specifically addresses an old ticket closed. I adapted to the podnapsi's new page layout and added a few other minor features. I just thought I should share my changes back!

Just added support for quotes which should fix issue 378 and issue 412 for you.

@caronc
Copy link
Author

caronc commented Oct 18, 2014

Quote support isn't pushed into the master branch yet, but i'm sure if someone beats me to it; it's pretty straight forward what i did (feel free to cherry pick away). I incremented the DogPile caching version too just to ensure no one references a local copy of their old quoted cached content.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 3c7634f on caronc:0.7.x into * on Diaoul:0.7.x*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 7fef3cf on caronc:0.7.x into * on Diaoul:0.7.x*.

the flexibility for 3rd party apps that wrap the subliminal framework to
do their own guess management. The default behaviour of this fuction
will remain the same as it always has. This new feature will only kick
in if the video is specified to be used instead.
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling e6bd704 on caronc:0.7.x into * on Diaoul:0.7.x*.

@Diaoul Diaoul mentioned this pull request Dec 23, 2014
Hopefully the Addic7ed administrator can respond to my email inquiring as to why they are blocking us by the User-Agent string.

Automation is the 21st century of the internet; No one wants to click 8
times past banners just to get a 1KB (in size) subtitle. Most people
have Ad blocking software and don't even see these banners anyway. There
are many other ways to get people on board with helping them out
financially (if that's what this is about), and at the same time
accomodate those who've automated their service. I will roll back this
commit when we can come to a better resolution.
Hopefully the Addic7ed administrator can respond to my email inquiring as to why they are blocking us by the User-Agent string.

Automation is the 21st century of the internet; No one wants to click 8
times past banners just to get a 1KB (in size) subtitle. Most people
have Ad blocking software and don't even see these banners anyway. There
are many other ways to get people on board with helping them out
financially (if that's what this is about), and at the same time
accomodate those who've automated their service. I will roll back this
commit when we can come to a better resolution.
logger.warning('Provider %r is not available, discarding it', provider_name)
logger.debug('ProviderNotAvailable error: %r', str(err))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use exc_info=True as kwargs for logger.debug to add trace information

@Diaoul
Copy link
Owner

Diaoul commented Jan 31, 2015

I just reviewed your changes. There are just a few points:

  • Python 2.6 is from eons ago, it makes the code less readable and not exactly python3 friendly, would you agree to drop this? What system are you running subliminal on to be that outdated?
  • I'd like to merge and publish this as a new (and hopefully last) release of the 0.7.x branch and rebase 0.8 on this.

@caronc
Copy link
Author

caronc commented Feb 1, 2015

I realize Python v2.6 is old, but I'm old fashioned too. I'd trade stability over bleeding edge any day. I run Red Hat 6.6 on all my production systems at work and CentOS 6.6 at home. As a result, I'm stuck with it's shipped version of Python 2.6. I've even packaged all of your software in RPMs which makes it so easy to deploy your fantastic tool. :)

I intend on updating to CentOS 7 soon which will bring me to Python v2.7. I'll still be old; but we'll at least be on the same page. :)

I'll read your review notes, I'll reply to them individually and do my best to explain them; from there you can let me know how you want me to proceed.

@Diaoul
Copy link
Owner

Diaoul commented Feb 1, 2015

I don't mind the dict and set comprehension stuff for 2.6 compat, what bothers me is more unittests that are less readable (and outputs less readable failures) and the zipfile stuff.

Maybe for 2.6 compat we can use 2.7+ syntax with unittest2?

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 407cbe1 on caronc:0.7.x into * on Diaoul:0.7.x*.

@caronc
Copy link
Author

caronc commented Feb 1, 2015

@sioban: just to avoid confusion, an option as you suggest would prove to be unnecessary (IMO). At this time, the proper User-Agent (Subliminal v0.7) is correctly applied to all providers except Addic7ed (as of very recently). If I were to revert back and apply the same User-Agent for Addic7ed too (as an option), then the provider simply won't work.
@Diaoul: I've accommodated most of the core requests you made, there are still some lingering I'll try to get to. Travis CI is really hit and miss eh? Today i passed, but yesterday i fail because providers are unavailable from the testing host. Oh well; right now things are working great, so that's a good thing! :)

caronc added a commit to caronc/nzb-subliminal that referenced this pull request Feb 1, 2015
@Diaoul
Copy link
Owner

Diaoul commented Feb 2, 2015

That's the problem with the unittests. I think the best for unittest would be to have a mock proxy that forwards the request to the original website, caches the response and send it back to the client as-is. If the original website fails to respond, the cache is used. So instead of testing against real servers we test against real or last time servers. That should be enough.

I can host this mock proxy locally or on free Heroku dyno I think.

I'll merge this and eventually make a few changes so I can make a new bugfix release of subliminal this week.

@caronc
Copy link
Author

caronc commented Feb 2, 2015

Sure! Thanks for accepting the pull request btw. I'm looking forward to dropping all my patch files! :)

@j-manu
Copy link

j-manu commented Feb 23, 2015

@Diaoul What you describe - a mock proxy - is handled in ruby by a gem called VCR. There are two python ports for it - https://github.com/sigmavirus24/betamax & https://github.com/kevin1024/vcrpy

Diaoul added a commit that referenced this pull request Mar 4, 2015
@Diaoul Diaoul merged commit 8c040f2 into Diaoul:0.7.x Mar 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants