[fix] Show reasonable error if login to to torrentleech.org fails#2256
Merged
gazpachoking merged 2 commits intoFlexget:developfrom Nov 21, 2018
carlba:bugfix/torrentleach_detect_failed_login
Merged
[fix] Show reasonable error if login to to torrentleech.org fails#2256gazpachoking merged 2 commits intoFlexget:developfrom carlba:bugfix/torrentleach_detect_failed_login
gazpachoking merged 2 commits intoFlexget:developfrom
carlba:bugfix/torrentleach_detect_failed_login
Conversation
- A Dubious JSON error was shown if the login failed
cvium
reviewed
Nov 20, 2018
| except RequestException as e: | ||
| raise PluginError('Could not connect to torrentleech: %s' % str(e)) | ||
|
|
||
| if login.url.endswith(u'/user/account/login/'): |
Contributor
There was a problem hiding this comment.
I don't think the u is really necessary
Member
There was a problem hiding this comment.
Indeed. String literals are unicode by default on both python 2 (because we import unicode_literals from __future__) and python 3.
Contributor
Author
There was a problem hiding this comment.
Just old habit I will remove it :)
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for changes
The torrentleech plugin didn't detect if tbe login to the torrentleech site failed. Instead it failed on every attempt to search for a series or movie with a JSON Decode error.
Detailed changes
Check if the url of the response still has the login part in it and raise an exception in this case.