diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-07-09 22:16:30 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-07-09 22:16:30 +0200 |
commit | 3e6e2e858cd17439992a45afa2c4e9bf5f2da177 (patch) | |
tree | 0a5dc4bd0fc6193cb800022565eb513466e4a694 /module/plugins/hoster/FiredriveCom.py | |
parent | New hoster RemixshareCom (diff) | |
download | pyload-3e6e2e858cd17439992a45afa2c4e9bf5f2da177.tar.xz |
[FiredriveCom] Handle parse error
Diffstat (limited to 'module/plugins/hoster/FiredriveCom.py')
-rw-r--r-- | module/plugins/hoster/FiredriveCom.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/module/plugins/hoster/FiredriveCom.py b/module/plugins/hoster/FiredriveCom.py index 4dce23462..6a77ded55 100644 --- a/module/plugins/hoster/FiredriveCom.py +++ b/module/plugins/hoster/FiredriveCom.py @@ -23,7 +23,7 @@ class FiredriveCom(SimpleHoster): __name__ = "FiredriveCom" __type__ = "hoster" __pattern__ = r'https?://(?:www\.)?(firedrive|putlocker)\.com/(mobile/)?(file|embed)/(?P<ID>\w+)' - __version__ = "0.02" + __version__ = "0.03" __description__ = """Firedrive.com hoster plugin""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" @@ -35,6 +35,9 @@ class FiredriveCom(SimpleHoster): FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.firedrive.com/file/\g<ID>')] + LINK_PATTERN = r'<a href="(https?://dl\.firedrive\.com/\?key=.+?)"' + + def setup(self): self.multiDL = self.resumeDownload = True self.chunkLimit = -1 @@ -45,12 +48,16 @@ class FiredriveCom(SimpleHoster): self.download(link, disposition=True) def _getLink(self): - f = re.search(r'<a href="(https?://dl\.firedrive\.com/\?key=.+?)"', self.html) + f = re.search(self.LINK_PATTERN, self.html) if f: return f.group(1) else: self.html = self.load(self.pyfile.url, post={"confirm": re.search(r'name="confirm" value="(.+?)"', self.html).group(1)}) - return self._getLink() + f = re.search(self.LINK_PATTERN, self.html) + if f: + return f.group(1) + else: + self.parseError("Direct download link not found") getInfo = create_getInfo(FiredriveCom) |