diff options
author | Thierry Merle <thierry.merle@free.fr> | 2014-03-19 14:57:02 +0100 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2014-04-21 17:06:18 +0200 |
commit | 258abb1e91bad1b1aed817fd6f21854324033159 (patch) | |
tree | 2817e92d46428f4bc1759e1fa04aa579f0adb2b3 | |
parent | Zippyshare: Fixed #545 (diff) | |
download | pyload-258abb1e91bad1b1aed817fd6f21854324033159.tar.xz |
OneFichier: Fixed #536
Merges #541
(cherry picked from commit 2450d9c687193d64bbe028640b77af9ae011d64e)
-rw-r--r-- | pyload/plugins/hoster/OneFichierCom.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/pyload/plugins/hoster/OneFichierCom.py b/pyload/plugins/hoster/OneFichierCom.py index 54bf1d1fa..9fa0a4b90 100644 --- a/pyload/plugins/hoster/OneFichierCom.py +++ b/pyload/plugins/hoster/OneFichierCom.py @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- +# Test links (random.bin): +# http://5pnm24ltcw.1fichier.com/ + import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -8,17 +11,17 @@ class OneFichierCom(SimpleHoster): __name__ = "OneFichierCom" __type__ = "hoster" __pattern__ = r"(http://(\w+)\.((1fichier|d(es)?fichiers|pjointe)\.(com|fr|net|org)|(cjoint|mesfichiers|piecejointe|oi)\.(org|net)|tenvoi\.(com|org|net)|dl4free\.com|alterupload\.com|megadl.fr))" - __version__ = "0.48" + __version__ = "0.49" __description__ = """1fichier.com download hoster""" __author_name__ = ("fragonib", "the-razer", "zoidberg", "imclem") __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "daniel_ AT gmx DOT net", "zoidberg@mujmail.cz", "imclem on github") - FILE_NAME_PATTERN = r'">File name :</th>\s*<td>(?P<N>[^<]+)</td>' - FILE_SIZE_PATTERN = r'<th>File size :</th>\s*<td>(?P<S>[^<]+)</td>' + FILE_NAME_PATTERN = r'">Filename :</th>\s*<td>(?P<N>[^<]+)</td>' + FILE_SIZE_PATTERN = r'<th>Size :</th>\s*<td>(?P<S>[^<]+)</td>' FILE_OFFLINE_PATTERN = r'The (requested)? file (could not be found|has been deleted)' FILE_URL_REPLACEMENTS = [(r'(http://[^/]*).*', r'\1/en/')] - DOWNLOAD_LINK_PATTERN = r'<br/> <br/> <br/> \s+<a href="(?P<url>http://.*?)"' + DOWNLOAD_LINK_PATTERN = r"""location\s*.\s*'(?P<N>http://.*?)'""" PASSWORD_PROTECTED_TOKEN = "protected by password" WAITING_PATTERN = "Warning ! Without premium status, you can download only one file at a time and you must wait up to (\d+) minutes between each downloads." @@ -26,7 +29,7 @@ class OneFichierCom(SimpleHoster): found = re.search(self.__pattern__, pyfile.url) file_id = found.group(2) url = "http://%s.%s/en/" % (found.group(2), found.group(3)) - self.html = self.load(url, decode=True) + self.html = self.load(url, post="submit", decode=True) found = re.search(self.WAITING_PATTERN, self.html) if found: @@ -42,7 +45,13 @@ class OneFichierCom(SimpleHoster): if "pass" in inputs: inputs['pass'] = self.getPassword() - self.download(url, post=inputs) + self.html = self.load(url, post=inputs) + m = re.search(self.DOWNLOAD_LINK_PATTERN, self.html) + if not m: + self.parseError("Unable to detect download link") + download_url = m.group(1) + + self.download(download_url) # Check download self.checkDownloadedFile() |