From ea2d07843d369d8b8fd2aa02930bf549ce94a661 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 03:25:42 +0100 Subject: Spare fixes --- module/plugins/hoster/FourSharedCom.py | 62 +++++++++++++++++++++++++ module/plugins/hoster/HundredEightyUploadCom.py | 21 +++++++++ module/plugins/hoster/OneFichierCom.py | 60 ++++++++++++++++++++++++ module/plugins/hoster/TwoSharedCom.py | 32 +++++++++++++ module/plugins/hoster/XFileSharingPro.py | 2 +- module/plugins/hoster/_1FichierCom.py | 60 ------------------------ module/plugins/hoster/_2SharedCom.py | 32 ------------- module/plugins/hoster/_4SharedCom.py | 62 ------------------------- 8 files changed, 176 insertions(+), 155 deletions(-) create mode 100644 module/plugins/hoster/FourSharedCom.py create mode 100644 module/plugins/hoster/HundredEightyUploadCom.py create mode 100644 module/plugins/hoster/OneFichierCom.py create mode 100644 module/plugins/hoster/TwoSharedCom.py delete mode 100644 module/plugins/hoster/_1FichierCom.py delete mode 100644 module/plugins/hoster/_2SharedCom.py delete mode 100644 module/plugins/hoster/_4SharedCom.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/FourSharedCom.py b/module/plugins/hoster/FourSharedCom.py new file mode 100644 index 000000000..78aeece44 --- /dev/null +++ b/module/plugins/hoster/FourSharedCom.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class FourSharedCom(SimpleHoster): + __name__ = "FourSharedCom" + __type__ = "hoster" + __version__ = "0.31" + + __pattern__ = r'https?://(?:www\.)?4shared(\-china)?\.com/(account/)?(download|get|file|document|photo|video|audio|mp3|office|rar|zip|archive|music)/.+' + + __description__ = """4Shared.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("jeix", "jeix@hasnomail.de"), + ("zoidberg", "zoidberg@mujmail.cz")] + + + NAME_PATTERN = r'' + OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted.' + + NAME_REPLACEMENTS = [(r"&#(\d+).", lambda m: unichr(int(m.group(1))))] + SIZE_REPLACEMENTS = [(",", "")] + + DIRECT_LINK = False + LOGIN_ACCOUNT = True + + LINK_FREE_PATTERN = r'name="d3link" value="(.*?)"' + LINK_BTN_PATTERN = r'id="btnLink" href="(.*?)"' + + ID_PATTERN = r'name="d3fid" value="(.*?)"' + + + def handleFree(self, pyfile): + m = re.search(self.LINK_BTN_PATTERN, self.html) + if m: + link = m.group(1) + else: + link = re.sub(r'/(download|get|file|document|photo|video|audio)/', r'/get/', pyfile.url) + + self.html = self.load(link) + + m = re.search(self.LINK_FREE_PATTERN, self.html) + if m is None: + self.error(_("Download link")) + + self.link = m.group(1) + + try: + m = re.search(self.ID_PATTERN, self.html) + res = self.load('http://www.4shared.com/web/d2/getFreeDownloadLimitInfo?fileId=%s' % m.group(1)) + self.logDebug(res) + except: + pass + + self.wait(20) + + +getInfo = create_getInfo(FourSharedCom) diff --git a/module/plugins/hoster/HundredEightyUploadCom.py b/module/plugins/hoster/HundredEightyUploadCom.py new file mode 100644 index 000000000..4fc96a2b1 --- /dev/null +++ b/module/plugins/hoster/HundredEightyUploadCom.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo + + +class HundredEightyUploadCom(XFSHoster): + __name__ = "HundredEightyUploadCom" + __type__ = "hoster" + __version__ = "0.04" + + __pattern__ = r'http://(?:www\.)?180upload\.com/\w{12}' + + __description__ = """180upload.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] + + + HOSTER_DOMAIN = "180upload.com" + + +getInfo = create_getInfo(HundredEightyUploadCom) diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py new file mode 100644 index 000000000..f9c0dbe85 --- /dev/null +++ b/module/plugins/hoster/OneFichierCom.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class OneFichierCom(SimpleHoster): + __name__ = "OneFichierCom" + __type__ = "hoster" + __version__ = "0.76" + + __pattern__ = r'https?://(?:www\.)?(?:(?P\w+)\.)?(?P1fichier\.com|alterupload\.com|cjoint\.net|d(es)?fichiers\.com|dl4free\.com|megadl\.fr|mesfichiers\.org|piecejointe\.net|pjointe\.com|tenvoi\.com)(?:/\?(?P\w+))?' + + __description__ = """1fichier.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es"), + ("the-razer", "daniel_ AT gmx DOT net"), + ("zoidberg", "zoidberg@mujmail.cz"), + ("imclem", None), + ("stickell", "l.stickell@yahoo.it"), + ("Elrick69", "elrick69[AT]rocketmail[DOT]com"), + ("Walter Purcaro", "vuolter@gmail.com")] + + + NAME_PATTERN = r'>FileName :\s*(?P.+?)<' + SIZE_PATTERN = r'>Size :\s*(?P[\d.,]+) (?P[\w^_]+)' + + OFFLINE_PATTERN = r'File not found !\s*<' + + COOKIES = [("1fichier.com", "LG", "en")] + + WAIT_PATTERN = r'>You must wait (\d+) minutes' + + + def setup(self): + self.multiDL = self.premium + self.resumeDownload = True + + + def handleFree(self, pyfile): + id = self.info['pattern']['ID1'] or self.info['pattern']['ID2'] + url, inputs = self.parseHtmlForm('action="https://1fichier.com/\?%s' % id) + + if not url: + self.fail(_("Download link not found")) + + if "pass" in inputs: + inputs['pass'] = self.getPassword() + + inputs['submit'] = "Download" + + self.download(url, post=inputs) + + + def handlePremium(self, pyfile): + return self.handleFree(pyfile) + + +getInfo = create_getInfo(OneFichierCom) diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py new file mode 100644 index 000000000..c6ca2ab29 --- /dev/null +++ b/module/plugins/hoster/TwoSharedCom.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class TwoSharedCom(SimpleHoster): + __name__ = "TwoSharedCom" + __type__ = "hoster" + __version__ = "0.13" + + __pattern__ = r'http://(?:www\.)?2shared\.com/(account/)?(download|get|file|document|photo|video|audio)/.+' + + __description__ = """2Shared.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + + + NAME_PATTERN = r'

(?P.*)

' + SIZE_PATTERN = r'File size:\s*(?P[\d.,]+) (?P[\w^_]+)' + OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.' + + LINK_FREE_PATTERN = r'window.location =\'(.+?)\';' + + + def setup(self): + self.resumeDownload = True + self.multiDL = True + + +getInfo = create_getInfo(TwoSharedCom) diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 8d9ec9871..1794ae513 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -35,7 +35,7 @@ class XFileSharingPro(XFSHoster): self.HOSTER_NAME = "".join([part.capitalize() for part in re.split(r'(\.|\d+)', self.HOSTER_DOMAIN) if part != '.']) if self.HOSTER_NAME[0].isdigit(): - self.HOSTER_NAME = '_' + self.HOSTER_NAME + self.HOSTER_NAME = 'X' + self.HOSTER_NAME account = self.core.accountManager.getAccountPlugin(self.HOSTER_NAME) diff --git a/module/plugins/hoster/_1FichierCom.py b/module/plugins/hoster/_1FichierCom.py deleted file mode 100644 index 528ad0f48..000000000 --- a/module/plugins/hoster/_1FichierCom.py +++ /dev/null @@ -1,60 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class _1FichierCom(SimpleHoster): - __name__ = "1FichierCom" - __type__ = "hoster" - __version__ = "0.76" - - __pattern__ = r'https?://(?:www\.)?(?:(?P\w+)\.)?(?P1fichier\.com|alterupload\.com|cjoint\.net|d(es)?fichiers\.com|dl4free\.com|megadl\.fr|mesfichiers\.org|piecejointe\.net|pjointe\.com|tenvoi\.com)(?:/\?(?P\w+))?' - - __description__ = """1fichier.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es"), - ("the-razer", "daniel_ AT gmx DOT net"), - ("zoidberg", "zoidberg@mujmail.cz"), - ("imclem", None), - ("stickell", "l.stickell@yahoo.it"), - ("Elrick69", "elrick69[AT]rocketmail[DOT]com"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - NAME_PATTERN = r'>FileName :\s*(?P.+?)<' - SIZE_PATTERN = r'>Size :\s*(?P[\d.,]+) (?P[\w^_]+)' - - OFFLINE_PATTERN = r'File not found !\s*<' - - COOKIES = [("1fichier.com", "LG", "en")] - - WAIT_PATTERN = r'>You must wait (\d+) minutes' - - - def setup(self): - self.multiDL = self.premium - self.resumeDownload = True - - - def handleFree(self, pyfile): - id = self.info['pattern']['ID1'] or self.info['pattern']['ID2'] - url, inputs = self.parseHtmlForm('action="https://1fichier.com/\?%s' % id) - - if not url: - self.fail(_("Download link not found")) - - if "pass" in inputs: - inputs['pass'] = self.getPassword() - - inputs['submit'] = "Download" - - self.download(url, post=inputs) - - - def handlePremium(self, pyfile): - return self.handleFree(pyfile) - - -getInfo = create_getInfo(_1FichierCom) diff --git a/module/plugins/hoster/_2SharedCom.py b/module/plugins/hoster/_2SharedCom.py deleted file mode 100644 index a974fac58..000000000 --- a/module/plugins/hoster/_2SharedCom.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class _2SharedCom(SimpleHoster): - __name__ = "2SharedCom" - __type__ = "hoster" - __version__ = "0.13" - - __pattern__ = r'http://(?:www\.)?2shared\.com/(account/)?(download|get|file|document|photo|video|audio)/.+' - - __description__ = """2Shared.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - - - NAME_PATTERN = r'

(?P.*)

' - SIZE_PATTERN = r'File size:\s*(?P[\d.,]+) (?P[\w^_]+)' - OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.' - - LINK_FREE_PATTERN = r'window.location =\'(.+?)\';' - - - def setup(self): - self.resumeDownload = True - self.multiDL = True - - -getInfo = create_getInfo(_2SharedCom) diff --git a/module/plugins/hoster/_4SharedCom.py b/module/plugins/hoster/_4SharedCom.py deleted file mode 100644 index a3504e405..000000000 --- a/module/plugins/hoster/_4SharedCom.py +++ /dev/null @@ -1,62 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class _4SharedCom(SimpleHoster): - __name__ = "4SharedCom" - __type__ = "hoster" - __version__ = "0.31" - - __pattern__ = r'https?://(?:www\.)?4shared(\-china)?\.com/(account/)?(download|get|file|document|photo|video|audio|mp3|office|rar|zip|archive|music)/.+' - - __description__ = """4Shared.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("jeix", "jeix@hasnomail.de"), - ("zoidberg", "zoidberg@mujmail.cz")] - - - NAME_PATTERN = r'' - OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted.' - - NAME_REPLACEMENTS = [(r"&#(\d+).", lambda m: unichr(int(m.group(1))))] - SIZE_REPLACEMENTS = [(",", "")] - - DIRECT_LINK = False - LOGIN_ACCOUNT = True - - LINK_FREE_PATTERN = r'name="d3link" value="(.*?)"' - LINK_BTN_PATTERN = r'id="btnLink" href="(.*?)"' - - ID_PATTERN = r'name="d3fid" value="(.*?)"' - - - def handleFree(self, pyfile): - m = re.search(self.LINK_BTN_PATTERN, self.html) - if m: - link = m.group(1) - else: - link = re.sub(r'/(download|get|file|document|photo|video|audio)/', r'/get/', pyfile.url) - - self.html = self.load(link) - - m = re.search(self.LINK_FREE_PATTERN, self.html) - if m is None: - self.error(_("Download link")) - - self.link = m.group(1) - - try: - m = re.search(self.ID_PATTERN, self.html) - res = self.load('http://www.4shared.com/web/d2/getFreeDownloadLimitInfo?fileId=%s' % m.group(1)) - self.logDebug(res) - except: - pass - - self.wait(20) - - -getInfo = create_getInfo(_4SharedCom) -- cgit v1.2.3