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/accounts/FourSharedCom.py | 34 +++++++++++++ module/plugins/accounts/HundredEightyUploadCom.py | 16 ++++++ module/plugins/accounts/OneFichierCom.py | 60 ++++++++++++++++++++++ module/plugins/accounts/_180UploadCom.py | 16 ------ module/plugins/accounts/_1FichierCom.py | 60 ---------------------- module/plugins/accounts/_4SharedCom.py | 34 ------------- module/plugins/crypter/FourChanOrg.py | 27 ++++++++++ module/plugins/crypter/OneKhDe.py | 42 +++++++++++++++ module/plugins/crypter/XFileSharingProFolder.py | 2 +- module/plugins/crypter/_1KhDe.py | 41 --------------- module/plugins/crypter/_4ChanOrg.py | 27 ---------- 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 ----------------------- module/plugins/internal/MultiHook.py | 36 +++++++------ module/plugins/internal/MultiHoster.py | 4 +- module/plugins/internal/SimpleHoster.py | 10 ++-- module/plugins/internal/XFSHoster.py | 2 +- 23 files changed, 384 insertions(+), 358 deletions(-) create mode 100644 module/plugins/accounts/FourSharedCom.py create mode 100644 module/plugins/accounts/HundredEightyUploadCom.py create mode 100644 module/plugins/accounts/OneFichierCom.py delete mode 100644 module/plugins/accounts/_180UploadCom.py delete mode 100644 module/plugins/accounts/_1FichierCom.py delete mode 100644 module/plugins/accounts/_4SharedCom.py create mode 100644 module/plugins/crypter/FourChanOrg.py create mode 100644 module/plugins/crypter/OneKhDe.py delete mode 100644 module/plugins/crypter/_1KhDe.py delete mode 100644 module/plugins/crypter/_4ChanOrg.py 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') diff --git a/module/plugins/accounts/FourSharedCom.py b/module/plugins/accounts/FourSharedCom.py new file mode 100644 index 000000000..2777a142a --- /dev/null +++ b/module/plugins/accounts/FourSharedCom.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- + +from module.plugins.Account import Account + + +class FourSharedCom(Account): + __name__ = "FourSharedCom" + __type__ = "account" + __version__ = "0.04" + + __description__ = """FourShared.com account plugin""" + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it")] + + + def loadAccountInfo(self, user, req): + # Free mode only for now + return {"premium": False} + + + def login(self, user, data, req): + req.cj.setCookie("4shared.com", "4langcookie", "en") + + res = req.load("http://www.4shared.com/web/login", + post={'login' : user, + 'password' : data['password'], + 'remember' : "on", + '_remember': "on", + 'returnTo' : "http://www.4shared.com/account/home.jsp"}, + decode=True) + + if 'Please log in to access your 4shared account' in res: + self.wrongPassword() diff --git a/module/plugins/accounts/HundredEightyUploadCom.py b/module/plugins/accounts/HundredEightyUploadCom.py new file mode 100644 index 000000000..319a3feee --- /dev/null +++ b/module/plugins/accounts/HundredEightyUploadCom.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.XFSAccount import XFSAccount + + +class HundredEightyUploadCom(XFSAccount): + __name__ = "HundredEightyUploadCom" + __type__ = "account" + __version__ = "0.03" + + __description__ = """180upload.com account plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + HOSTER_DOMAIN = "180upload.com" diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py new file mode 100644 index 000000000..1fc8d994d --- /dev/null +++ b/module/plugins/accounts/OneFichierCom.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- + +import re + +from time import strptime, mktime + +from pycurl import REFERER + +from module.plugins.Account import Account + + +class OneFichierCom(Account): + __name__ = "OneFichierCom" + __type__ = "account" + __version__ = "0.12" + + __description__ = """1fichier.com account plugin""" + __license__ = "GPLv3" + __authors__ = [("Elrick69", "elrick69[AT]rocketmail[DOT]com"), + ("Walter Purcaro", "vuolter@gmail.com")] + + + VALID_UNTIL_PATTERN = r'Your Premium Status will end the (\d+/\d+/\d+)' + + + def loadAccountInfo(self, user, req): + validuntil = None + trafficleft = -1 + premium = None + + html = req.load("https://1fichier.com/console/abo.pl") + + m = re.search(self.VALID_UNTIL_PATTERN, html) + if m: + expiredate = m.group(1) + self.logDebug("Expire date: " + expiredate) + + try: + validuntil = mktime(strptime(expiredate, "%d/%m/%Y")) + except Exception, e: + self.logError(e) + else: + premium = True + + return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium or False} + + + def login(self, user, data, req): + req.http.c.setopt(REFERER, "https://1fichier.com/login.pl?lg=en") + + html = req.load("https://1fichier.com/login.pl?lg=en", + post={'mail' : user, + 'pass' : data['password'], + 'It' : "on", + 'purge' : "off", + 'valider': "Send"}, + decode=True) + + if '>Invalid email address' in html or '>Invalid password' in html: + self.wrongPassword() diff --git a/module/plugins/accounts/_180UploadCom.py b/module/plugins/accounts/_180UploadCom.py deleted file mode 100644 index 664e3fa8d..000000000 --- a/module/plugins/accounts/_180UploadCom.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.XFSAccount import XFSAccount - - -class _180UploadCom(XFSAccount): - __name__ = "180UploadCom" - __type__ = "account" - __version__ = "0.03" - - __description__ = """180upload.com account plugin""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - HOSTER_DOMAIN = "180upload.com" diff --git a/module/plugins/accounts/_1FichierCom.py b/module/plugins/accounts/_1FichierCom.py deleted file mode 100644 index 70bb3ec1c..000000000 --- a/module/plugins/accounts/_1FichierCom.py +++ /dev/null @@ -1,60 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import strptime, mktime - -from pycurl import REFERER - -from module.plugins.Account import Account - - -class _1FichierCom(Account): - __name__ = "1FichierCom" - __type__ = "account" - __version__ = "0.12" - - __description__ = """1fichier.com account plugin""" - __license__ = "GPLv3" - __authors__ = [("Elrick69", "elrick69[AT]rocketmail[DOT]com"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - VALID_UNTIL_PATTERN = r'Your Premium Status will end the (\d+/\d+/\d+)' - - - def loadAccountInfo(self, user, req): - validuntil = None - trafficleft = -1 - premium = None - - html = req.load("https://1fichier.com/console/abo.pl") - - m = re.search(self.VALID_UNTIL_PATTERN, html) - if m: - expiredate = m.group(1) - self.logDebug("Expire date: " + expiredate) - - try: - validuntil = mktime(strptime(expiredate, "%d/%m/%Y")) - except Exception, e: - self.logError(e) - else: - premium = True - - return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium or False} - - - def login(self, user, data, req): - req.http.c.setopt(REFERER, "https://1fichier.com/login.pl?lg=en") - - html = req.load("https://1fichier.com/login.pl?lg=en", - post={'mail' : user, - 'pass' : data['password'], - 'It' : "on", - 'purge' : "off", - 'valider': "Send"}, - decode=True) - - if '>Invalid email address' in html or '>Invalid password' in html: - self.wrongPassword() diff --git a/module/plugins/accounts/_4SharedCom.py b/module/plugins/accounts/_4SharedCom.py deleted file mode 100644 index 680ec4513..000000000 --- a/module/plugins/accounts/_4SharedCom.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.Account import Account - - -class _4SharedCom(Account): - __name__ = "4SharedCom" - __type__ = "account" - __version__ = "0.04" - - __description__ = """FourShared.com account plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it")] - - - def loadAccountInfo(self, user, req): - # Free mode only for now - return {"premium": False} - - - def login(self, user, data, req): - req.cj.setCookie("4shared.com", "4langcookie", "en") - - res = req.load("http://www.4shared.com/web/login", - post={'login' : user, - 'password' : data['password'], - 'remember' : "on", - '_remember': "on", - 'returnTo' : "http://www.4shared.com/account/home.jsp"}, - decode=True) - - if 'Please log in to access your 4shared account' in res: - self.wrongPassword() diff --git a/module/plugins/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py new file mode 100644 index 000000000..c3fe3db4b --- /dev/null +++ b/module/plugins/crypter/FourChanOrg.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# +# Based on 4chandl by Roland Beermann (https://gist.github.com/enkore/3492599) + +import re + +from module.plugins.Crypter import Crypter + + +class FourChanOrg(Crypter): + __name__ = "FourChanOrg" + __type__ = "crypter" + __version__ = "0.31" + + __pattern__ = r'http://(?:www\.)?boards\.4chan\.org/\w+/res/(\d+)' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] + + __description__ = """4chan.org folder decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [] + + + def decrypt(self, pyfile): + pagehtml = self.load(pyfile.url) + images = set(re.findall(r'(images\.4chan\.org/[^/]*/src/[^"<]*)', pagehtml)) + self.urls = ["http://" + image for image in images] diff --git a/module/plugins/crypter/OneKhDe.py b/module/plugins/crypter/OneKhDe.py new file mode 100644 index 000000000..3e75d97b5 --- /dev/null +++ b/module/plugins/crypter/OneKhDe.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- + +import re + +from module.unescape import unescape + +from module.plugins.Crypter import Crypter + + +class OneKhDe(Crypter): + __name__ = "OneKhDe" + __type__ = "crypter" + __version__ = "0.11" + + __pattern__ = r'http://(?:www\.)?1kh\.de/f/' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] + + __description__ = """1kh.de decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("spoob", "spoob@pyload.org")] + + + def __init__(self, parent): + Crypter.__init__(self, parent) + self.parent = parent + + + def file_exists(self): + """ returns True or False + """ + return True + + + def proceed(self, url, location): + url = self.parent.url + self.html = self.load(url) + link_ids = re.findall(r"", self.load("http://1kh.de/l/" + id)).group(1)) + self.urls.append(new_link) diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index 5ad9f7678..55cd41931 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -34,7 +34,7 @@ class XFileSharingProFolder(XFSCrypter): 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/crypter/_1KhDe.py b/module/plugins/crypter/_1KhDe.py deleted file mode 100644 index c8ac3020c..000000000 --- a/module/plugins/crypter/_1KhDe.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.unescape import unescape -from module.plugins.Crypter import Crypter - - -class _1KhDe(Crypter): - __name__ = "1KhDe" - __type__ = "crypter" - __version__ = "0.11" - - __pattern__ = r'http://(?:www\.)?1kh\.de/f/' - __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), - ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] - - __description__ = """1kh.de decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("spoob", "spoob@pyload.org")] - - - def __init__(self, parent): - Crypter.__init__(self, parent) - self.parent = parent - - - def file_exists(self): - """ returns True or False - """ - return True - - - def proceed(self, url, location): - url = self.parent.url - self.html = self.load(url) - link_ids = re.findall(r"", self.load("http://1kh.de/l/" + id)).group(1)) - self.urls.append(new_link) diff --git a/module/plugins/crypter/_4ChanOrg.py b/module/plugins/crypter/_4ChanOrg.py deleted file mode 100644 index a5e815639..000000000 --- a/module/plugins/crypter/_4ChanOrg.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Based on 4chandl by Roland Beermann (https://gist.github.com/enkore/3492599) - -import re - -from module.plugins.Crypter import Crypter - - -class _4ChanOrg(Crypter): - __name__ = "4ChanOrg" - __type__ = "crypter" - __version__ = "0.31" - - __pattern__ = r'http://(?:www\.)?boards\.4chan\.org/\w+/res/(\d+)' - __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), - ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] - - __description__ = """4chan.org folder decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [] - - - def decrypt(self, pyfile): - pagehtml = self.load(pyfile.url) - images = set(re.findall(r'(images\.4chan\.org/[^/]*/src/[^"<]*)', pagehtml)) - self.urls = ["http://" + image for image in images] 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) diff --git a/module/plugins/internal/MultiHook.py b/module/plugins/internal/MultiHook.py index 202868175..82a0a68ea 100644 --- a/module/plugins/internal/MultiHook.py +++ b/module/plugins/internal/MultiHook.py @@ -27,22 +27,26 @@ class MultiHook(Hook): MIN_INTERVAL = 1 * 60 * 60 - DOMAIN_REPLACEMENTS = [(r'\d+.+' , "_\0" ), - (r'bayfiles\.net' , "bayfiles.com" ), - (r'cloudnator\.com' , "shragle.com" ), - (r'dfiles\.eu' , "depositfiles.com"), - (r'easy-share\.com' , "crocko.com" ), - (r'freakshare\.net' , "freakshare.com" ), - (r'hellshare\.com' , "hellshare.cz" ), - (r'ifile\.it' , "filecloud.io" ), - (r'nowdownload\.\w+', "nowdownload.sx" ), - (r'nowvideo\.\w+' , "nowvideo.sx" ), - (r'putlocker\.com' , "firedrive.com" ), - (r'share-?rapid\.cz', "multishare.cz" ), - (r'ul\.to' , "uploaded.to" ), - (r'uploaded\.net' , "uploaded.to" ), - (r'uploadhero\.co' , "uploadhero.com" ), - (r'zshares\.net' , "zshare.net" )] + DOMAIN_REPLACEMENTS = [(r'180upload.com' , "hundredeightyupload.com"), + (r'1fichier.com' , "onefichier.com" ), + (r'2shared.com' , "twoshared.com" ), + (r'4shared.com' , "fourshared.com" ), + (r'bayfiles\.net' , "bayfiles.com" ), + (r'cloudnator\.com' , "shragle.com" ), + (r'dfiles\.eu' , "depositfiles.com" ), + (r'easy-share\.com' , "crocko.com" ), + (r'freakshare\.net' , "freakshare.com" ), + (r'hellshare\.com' , "hellshare.cz" ), + (r'ifile\.it' , "filecloud.io" ), + (r'nowdownload\.\w+', "nowdownload.sx" ), + (r'nowvideo\.\w+' , "nowvideo.sx" ), + (r'putlocker\.com' , "firedrive.com" ), + (r'share-?rapid\.cz', "multishare.cz" ), + (r'ul\.to' , "uploaded.to" ), + (r'uploaded\.net' , "uploaded.to" ), + (r'uploadhero\.co' , "uploadhero.com" ), + (r'zshares\.net' , "zshare.net" ), + (r'\d+.+' , "X\0" )] def setup(self): diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py index ae06eaf4b..b6eaf34aa 100644 --- a/module/plugins/internal/MultiHoster.py +++ b/module/plugins/internal/MultiHoster.py @@ -77,11 +77,11 @@ class MultiHoster(SimpleHoster): if self.premium and (not self.CHECK_TRAFFIC or self.checkTrafficLeft()): self.logDebug("Handled as premium download") - self.handlePremium() + self.handlePremium(pyfile) elif not self.LOGIN_ACCOUNT or (not self.CHECK_TRAFFIC or self.checkTrafficLeft()): self.logDebug("Handled as free download") - self.handleFree() + self.handleFree(pyfile) self.downloadLink(self.link) self.checkFile() diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 5450f2bc9..2a6624e10 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -261,7 +261,7 @@ class SimpleHoster(Hoster): def apiInfo(cls, url="", get={}, post={}): url = unquote(url) return {'name' : (urlparse(url).path.split('/')[-1] - or urlparse(url).query.split('&', 1)[0].split('=', 1)[1] + or urlparse(url).query.split('=', 1)[::-1][0].split('&', 1)[0] or _("Unknown")), 'size' : 0, 'status': 3, @@ -417,11 +417,11 @@ class SimpleHoster(Hoster): if self.premium and (not self.CHECK_TRAFFIC or self.checkTrafficLeft()): self.logDebug("Handled as premium download") - self.handlePremium() + self.handlePremium(pyfile) elif not self.LOGIN_ACCOUNT or (not self.CHECK_TRAFFIC or self.checkTrafficLeft()): self.logDebug("Handled as free download") - self.handleFree() + self.handleFree(pyfile) self.downloadLink(self.link) self.checkFile() @@ -430,7 +430,7 @@ class SimpleHoster(Hoster): def downloadLink(self, link): if link and isinstance(link, basestring): self.correctCaptcha() - self.download(link, disposition=True) + self.download(link, disposition=False) #@TODO: Set `disposition=True` in 0.4.10 def checkFile(self): @@ -579,7 +579,7 @@ class SimpleHoster(Hoster): if not hasattr(self, 'LINK_PREMIUM_PATTERN'): self.logError(_("Premium download not implemented")) self.logDebug("Handled as free download") - self.handleFree() + self.handleFree(pyfile) try: m = re.search(self.LINK_PREMIUM_PATTERN, self.html) diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index 873df8989..b32f5978f 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -83,7 +83,7 @@ class XFSHoster(SimpleHoster): if self.captcha: self.correctCaptcha() - self.download(link, ref=True, cookies=True, disposition=True) + self.download(link, ref=True, cookies=True, disposition=False) #@TODO: Set `disposition=True` in 0.4.10 elif self.errmsg: if 'captcha' in self.errmsg: -- cgit v1.2.3