summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/OneFichierCom.py
diff options
context:
space:
mode:
authorGravatar ludoviclehmann <ludo.lehmann@free.fr> 2015-03-27 16:14:30 +0100
committerGravatar ludoviclehmann <ludo.lehmann@free.fr> 2015-03-27 16:14:30 +0100
commit43c335536e8703103850b367ac3dcfbe7da650a9 (patch)
tree71d5ced9b37083d2f192aee023394dbe2bb6cd96 /module/plugins/hoster/OneFichierCom.py
parentMerge pull request #1293 from saintego/patch-3 (diff)
downloadpyload-43c335536e8703103850b367ac3dcfbe7da650a9.tar.xz
Fix issue #1042
https://github.com/pyload/pyload/issues/1042
Diffstat (limited to 'module/plugins/hoster/OneFichierCom.py')
-rw-r--r--module/plugins/hoster/OneFichierCom.py18
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})