Skip to content

Commit

Permalink
hoster uploaded.to: fix error handling for premium
Browse files Browse the repository at this point in the history
moved check for premium account out of checkErrors() because all checks in there are only valid for free users
  • Loading branch information
oliverrahner committed Jan 30, 2015
1 parent 7a8b6ed commit 19c9874
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions module/plugins/hoster/UploadedTo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class UploadedTo(SimpleHoster):
__name__ = "UploadedTo"
__type__ = "hoster"
__version__ = "0.78"
__version__ = "0.80"

__pattern__ = r'https?://(?:www\.)?(uploaded\.(to|net)|ul\.to)(/file/|/?\?id=|.*?&id=|/)(?P<ID>\w+)'

Expand Down Expand Up @@ -73,11 +73,10 @@ def checkErrors(self):
self.retry(24, 5 * 60)

m = re.search(r"Current waiting period: <span>(\d+)</span> seconds", self.html)
if not self.premium:
if m:
self.wait(m.group(1))
else:
self.fail(_("File not downloadable for free users"))
if m:
self.wait(m.group(1))
else:
self.fail(_("File not downloadable for free users"))

if "limit-size" in self.html:
self.fail(_("File too big for free download"))
Expand Down Expand Up @@ -115,7 +114,10 @@ def handleFree(self, pyfile):
except Exception:
pass

self.checkErrors()
# as all downloads (premium and free) are handled by this method, only do
# free user related error checks if we are not on a premium account
if not self.premium:
self.checkErrors()


def checkFile(self):
Expand Down

0 comments on commit 19c9874

Please sign in to comment.