diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-03-27 16:57:19 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-03-27 16:57:19 +0100 |
commit | b4dc369174b24806f3bf8bb82e41c254b54978d4 (patch) | |
tree | 71d5ced9b37083d2f192aee023394dbe2bb6cd96 | |
parent | Merge pull request #1293 from saintego/patch-3 (diff) | |
parent | Fix issue #1042 (diff) | |
download | pyload-b4dc369174b24806f3bf8bb82e41c254b54978d4.tar.xz |
Merge pull request #1294 from ludoviclehmann/stable
Fix issue #1042
-rw-r--r-- | module/plugins/hoster/OneFichierCom.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 2586fb622..0a49084cf 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import re +import urllib2 from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -8,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class OneFichierCom(SimpleHoster): __name__ = "OneFichierCom" __type__ = "hoster" - __version__ = "0.79" + __version__ = "0.80" __pattern__ = r'https?://(?:www\.)?(?:(?P<ID1>\w+)\.)?(?P<HOST>1fichier\.com|alterupload\.com|cjoint\.net|d(es)?fichiers\.com|dl4free\.com|megadl\.fr|mesfichiers\.org|piecejointe\.net|pjointe\.com|tenvoi\.com)(?:/\?(?P<ID2>\w+))?' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -54,6 +55,21 @@ class OneFichierCom(SimpleHoster): self.download(url, post=inputs) + def handleDirect(self, pyfile): + link = self.directLink(pyfile.url, self.resumeDownload) + + if link: + self.logInfo(_("Direct download link detected")) + remote = urllib2.urlopen(link) + name = remote.info()['Content-Disposition'].split(';') + filename = name[1].split('filename=')[1] + filename = filename[1:-1] + self.logDebug("filename=" + filename) + pyfile.name = filename + self.link = link + else: + self.logDebug("Direct download link not found") + def handlePremium(self, pyfile): self.download(pyfile.url, post={'dl': "Download", 'did': 0}) |