From 9599ff3a6217aeb38c7d9d4c4257106c1ff79f1b Mon Sep 17 00:00:00 2001 From: sebdelsol Date: Mon, 23 Feb 2015 14:18:42 +0100 Subject: Zippyshare bug #1191 correction This version use the internal `Beatifulsoup`. When you decide to get rid of it I suggest to add a dependency to `lxml`. I've found a way to handle deliberate errors in the JS scripts without relying on PyV8: I've added JS `try/catch` statements around zippyshare scripts. --- module/plugins/hoster/ZippyshareCom.py | 49 +++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 13 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index 615559989..ad4688bac 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -5,17 +5,18 @@ import re from module.plugins.internal.CaptchaService import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.lib.BeautifulSoup import BeautifulSoup class ZippyshareCom(SimpleHoster): __name__ = "ZippyshareCom" __type__ = "hoster" - __version__ = "0.73" + __version__ = "0.74" __pattern__ = r'http://www\d{0,2}\.zippyshare\.com/v(/|iew\.jsp.*key=)(?P[\w^_]+)' __description__ = """Zippyshare.com hoster plugin""" __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + __authors__ = [("Walter Purcaro", "vuolter@gmail.com", "sebdelsol")] COOKIES = [("zippyshare.com", "ziplocale", "en")] @@ -46,20 +47,42 @@ class ZippyshareCom(SimpleHoster): self.error(e) else: - self.link = '/'.join(("d", self.info['pattern']['KEY'], str(self.get_checksum()), self.pyfile.name)) + self.link = self.get_link() - - def get_checksum(self): + def get_link(self): try: - b1 = eval(re.search(r'\.omg = (.+?);', self.html).group(1)) - b2 = eval(re.search(r'\* \((.+?)\)', self.html).group(1)) - checksum = b1 * b2 + 18 + # get all the scripts inside the html body + soup = BeautifulSoup(self.html) + scripts = (s.getText() for s in soup.body.findAll('script', type='text/javascript')) + + # meant to be populated with the initialization of all the DOM elements found in the scripts + initScripts = set() + + def replElementById(element): + id, attr = element.group(1), element.group(4) # attr might be None + + varName = '%s_%s' %(id, attr) + + initValues = (elt.get(attr, None) for elt in soup.findAll(id=id)) + initValues = [v for v in initValues if v is not None] + initValue = '"%s"' %initValues[-1] if initValues else 'null' + + initScripts.add('var %s = %s;' %(varName, initValue)) + return varName + + # handle all getElementById + reVar = r'document.getElementById\([\'"](\w+)[\'"]\)(\.)?(getAttribute\([\'"])?(\w+)?([\'"]\))?' + scripts = [re.sub(reVar, replElementById, script) for script in scripts] + + # add try/catch in JS to handle deliberate errors + tryJS, catchJS = u'try{', u'} catch(err){}' # '', '' to see where the script fails + scripts = ['\n'.join((tryJS, script, catchJS)) for script in scripts if script.strip()] + + # get the file's url by evaluating all the scripts + scripts = '\n'.join(list(initScripts) + scripts + ['dlbutton_href']) + return self.js.eval(scripts) except Exception: - self.error(_("Unable to calculate checksum")) - - else: - return checksum - + self.error(_("Unable to calculate the link")) getInfo = create_getInfo(ZippyshareCom) -- cgit v1.2.3 From baecc72778bac0e0076d30d0459a65abe8dc076c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 24 Feb 2015 22:08:30 +0100 Subject: [ZippyshareCom] Cleanup --- module/plugins/hoster/ZippyshareCom.py | 72 +++++++++++++++++----------------- 1 file changed, 35 insertions(+), 37 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index ad4688bac..c7a568e79 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -2,10 +2,11 @@ import re +from module.lib.BeautifulSoup import BeautifulSoup + from module.plugins.internal.CaptchaService import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.lib.BeautifulSoup import BeautifulSoup class ZippyshareCom(SimpleHoster): __name__ = "ZippyshareCom" @@ -16,7 +17,8 @@ class ZippyshareCom(SimpleHoster): __description__ = """Zippyshare.com hoster plugin""" __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com", "sebdelsol")] + __authors__ = [("Walter Purcaro", "vuolter@gmail.com"), + ("sebdelsol", "seb.morin@gmail.com")] COOKIES = [("zippyshare.com", "ziplocale", "en")] @@ -25,7 +27,7 @@ class ZippyshareCom(SimpleHoster): SIZE_PATTERN = r'>Size:.+?">(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'>File does not exist on this server' - LINK_PREMIUM_PATTERN = r'document.location = \'(.+?)\'' + LINK_PREMIUM_PATTERN = r"document.location = '(.+?)'" def setup(self): @@ -49,40 +51,36 @@ class ZippyshareCom(SimpleHoster): else: self.link = self.get_link() + def get_link(self): - try: - # get all the scripts inside the html body - soup = BeautifulSoup(self.html) - scripts = (s.getText() for s in soup.body.findAll('script', type='text/javascript')) - - # meant to be populated with the initialization of all the DOM elements found in the scripts - initScripts = set() - - def replElementById(element): - id, attr = element.group(1), element.group(4) # attr might be None - - varName = '%s_%s' %(id, attr) - - initValues = (elt.get(attr, None) for elt in soup.findAll(id=id)) - initValues = [v for v in initValues if v is not None] - initValue = '"%s"' %initValues[-1] if initValues else 'null' - - initScripts.add('var %s = %s;' %(varName, initValue)) - return varName - - # handle all getElementById - reVar = r'document.getElementById\([\'"](\w+)[\'"]\)(\.)?(getAttribute\([\'"])?(\w+)?([\'"]\))?' - scripts = [re.sub(reVar, replElementById, script) for script in scripts] - - # add try/catch in JS to handle deliberate errors - tryJS, catchJS = u'try{', u'} catch(err){}' # '', '' to see where the script fails - scripts = ['\n'.join((tryJS, script, catchJS)) for script in scripts if script.strip()] - - # get the file's url by evaluating all the scripts - scripts = '\n'.join(list(initScripts) + scripts + ['dlbutton_href']) - return self.js.eval(scripts) - - except Exception: - self.error(_("Unable to calculate the link")) + # get all the scripts inside the html body + soup = BeautifulSoup(self.html) + scripts = (s.getText() for s in soup.body.findAll('script', type='text/javascript')) + + # meant to be populated with the initialization of all the DOM elements found in the scripts + initScripts = set() + + def replElementById(element): + id = element.group(1) + attr = element.group(4) #: attr might be None + + varName = '%s_%s' % (id, attr) + initValues = filter(None, [elt.get(attr, None) for elt in soup.findAll(id=id)]) + initValue = '"%s"' % initValues[-1] if initValues else 'null' + + initScripts.add('var %s = %s;' % (varName, initValue)) + return varName + + # handle all getElementById + reVar = r'document.getElementById\([\'"](\w+)[\'"]\)(\.)?(getAttribute\([\'"])?(\w+)?([\'"]\))?' + scripts = [re.sub(reVar, replElementById, script) for script in scripts] + + # add try/catch in JS to handle deliberate errors + scripts = ["\n".join(("try{", script, "} catch(err){}")) for script in scripts if script.strip()] + + # get the file's url by evaluating all the scripts + scripts = "\n".join(list(initScripts) + scripts + ['dlbutton_href']) + return self.js.eval(scripts) + getInfo = create_getInfo(ZippyshareCom) -- cgit v1.2.3 From ddd43db82de4f6a431740c321e93a13c2e6d754d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 28 Feb 2015 18:30:33 +0100 Subject: [NowDownloadSx][NowVideoSx] Improve __pattern__ --- module/plugins/hoster/NowDownloadSx.py | 4 ++-- module/plugins/hoster/NowVideoSx.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/NowDownloadSx.py b/module/plugins/hoster/NowDownloadSx.py index b69242a86..f110e69ed 100644 --- a/module/plugins/hoster/NowDownloadSx.py +++ b/module/plugins/hoster/NowDownloadSx.py @@ -9,9 +9,9 @@ from module.utils import fixup class NowDownloadSx(SimpleHoster): __name__ = "NowDownloadSx" __type__ = "hoster" - __version__ = "0.07" + __version__ = "0.08" - __pattern__ = r'http://(?:www\.)?(nowdownload\.(at|ch|co|eu|sx)/(dl/|download\.php\?id=)|likeupload\.org/)\w+' + __pattern__ = r'http://(?:www\.)?(nowdownload\.[a-zA-Z]{2,}/(dl/|download\.php\?id=)|likeupload\.org/)\w+' __description__ = """NowDownload.sx hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/NowVideoSx.py b/module/plugins/hoster/NowVideoSx.py index 3f75a33f7..ff6fd43f8 100644 --- a/module/plugins/hoster/NowVideoSx.py +++ b/module/plugins/hoster/NowVideoSx.py @@ -8,9 +8,9 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class NowVideoSx(SimpleHoster): __name__ = "NowVideoSx" __type__ = "hoster" - __version__ = "0.10" + __version__ = "0.11" - __pattern__ = r'http://(?:www\.)?nowvideo\.(at|ch|co|eu|li|sx)/(video|mobile/#/videos)/(?P\w+)' + __pattern__ = r'http://(?:www\.)?nowvideo\.[a-zA-Z]{2,}/(video|mobile/#/videos)/(?P\w+)' __description__ = """NowVideo.sx hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From db76c2b8358d598c3106dc39ec11debdfcd3d6b1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 5 Mar 2015 23:13:52 +0100 Subject: [SoundcloudCom] Fix https://github.com/pyload/pyload/issues/1196 --- module/plugins/hoster/SoundcloudCom.py | 88 +++++++++++++++++----------------- 1 file changed, 43 insertions(+), 45 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/SoundcloudCom.py b/module/plugins/hoster/SoundcloudCom.py index c7c9c3880..c559b392b 100644 --- a/module/plugins/hoster/SoundcloudCom.py +++ b/module/plugins/hoster/SoundcloudCom.py @@ -1,57 +1,55 @@ # -*- coding: utf-8 -*- -import pycurl import re -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.common.json_layer import json_loads -class SoundcloudCom(Hoster): +class SoundcloudCom(SimpleHoster): __name__ = "SoundcloudCom" __type__ = "hoster" - __version__ = "0.10" + __version__ = "0.11" - __pattern__ = r'https?://(?:www\.)?soundcloud\.com/(?P.+?)/(?P.+)' + __pattern__ = r'https?://(?:www\.)?soundcloud\.com/[\w-]+/[\w-]+' + __config__ = [("quality", "Lower;Higher", "Quality", "Higher")] __description__ = """SoundCloud.com hoster plugin""" __license__ = "GPLv3" - __authors__ = [("Peekayy", "peekayy.dev@gmail.com")] - - - def process(self, pyfile): - # default UserAgent of HTTPRequest fails for this hoster so we use this one - self.req.http.c.setopt(pycurl.USERAGENT, 'Mozilla/5.0') - self.html = self.load(pyfile.url) - m = re.search(r'
.*?)"', self.html) - if m: - clientId = m.group('CID') - - if len(clientId) <= 0: - clientId = "b45b1aa10f1ac2941910a7f0d10f8e28" - - m = re.search(r'\s(?P.*?)\s</em>', self.html) - if m: - pyfile.name = m.group('TITLE') + ".mp3" - else: - pyfile.name = re.match(self.__pattern__, pyfile.url).group('SID') + ".mp3" - - # url to retrieve the actual song url - self.html = self.load("https://api.sndcdn.com/i1/tracks/%s/streams" % songId, get={"client_id": clientId}) - # getting streams - # for now we choose the first stream found in all cases - # it could be improved if relevant for this hoster - streams = [ - (result.group('QUALITY'), result.group('URL')) - for result in re.finditer(r'"(?P<QUALITY>.*?)":"(?P<URL>.*?)"', self.html) - ] - self.logDebug("Found Streams", streams) - self.logDebug("Downloading", streams[0][0], streams[0][1]) - self.download(streams[0][1]) + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + NAME_PATTERN = r'title" content="(?P<N>.+?)"' + OFFLINE_PATTERN = r'<title>"SoundCloud - Hear the world’s sounds"' + + + def handleFree(self, pyfile): + try: + song_id = re.search(r'sounds:(\d+)"', self.html).group(1) + + except Exception: + self.error(_("Could not find song id")) + + try: + client_id = re.search(r'"clientID":"(.+?)"', self.html).group(1) + + except Exception: + client_id = "b45b1aa10f1ac2941910a7f0d10f8e28" + + # url to retrieve the actual song url + streams = json_loads(self.load("https://api.soundcloud.com/tracks/%s/streams" % song_id, + get={'client_id': client_id})) + + regex = re.compile(r'[^\d]') + http_streams = sorted([(key, value) for key, value in streams.iteritems() if key.startswith('http_')], + key=lambda t: regex.sub(t[0], ''), + reverse=True) + + self.logDebug("Streams found: %s" % (http_streams or "None")) + + if http_streams: + stream_name, self.link = http_streams[0 if self.getConfig('quality') == "Higher" else -1] + pyfile.name += '.' + stream_name.split('_')[1].lower() + + +getInfo = create_getInfo(SoundcloudCom) -- cgit v1.2.3 From 9854d2f81577dc3c5c7c97cefd61404f739f4a24 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 5 Mar 2015 23:15:19 +0100 Subject: [ClickAndLoad] Fixup --- module/plugins/hoster/MegaCoNz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 4ad20b265..37ac12b44 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -50,7 +50,7 @@ class MegaCoNz(Hoster): __type__ = "hoster" __version__ = "0.26" - __pattern__ = r'(?:https?://(?:www\.)?mega\.co\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w,\\-]+)' + __pattern__ = r'(?:https?://(?:www\.)?mega\.co\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w,-]+)' __description__ = """Mega.co.nz hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 311e9a1d9ca6450ec84e4a54ef47dbf488e83107 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 6 Mar 2015 22:03:57 +0100 Subject: [MediafireCom] Update --- module/plugins/hoster/MediafireCom.py | 122 ++++++++-------------------------- 1 file changed, 29 insertions(+), 93 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index bc81c8202..54df531bd 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -3,126 +3,62 @@ import re from module.plugins.internal.CaptchaService import SolveMedia -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo -from module.network.RequestFactory import getURL - - -def replace_eval(js_expr): - return js_expr.replace(r'eval("', '').replace(r"\'", r"'").replace(r'\"', r'"') - - -def checkHTMLHeader(url): - try: - for _i in xrange(3): - header = getURL(url, just_header=True) - - for line in header.splitlines(): - line = line.lower() - - if 'location' in line: - url = line.split(':', 1)[1].strip() - if 'error.php?errno=320' in url: - return url, 1 - - if not url.startswith('http://'): - url = 'http://www.mediafire.com' + url - - break - - elif 'content-disposition' in line: - return url, 2 - else: - break - except Exception: - return url, 3 - else: - return url, 0 - - -def getInfo(urls): - for url in urls: - location, status = checkHTMLHeader(url) - - if status: - file_info = (url, 0, status, url) - else: - file_info = parseFileInfo(MediafireCom, url, getURL(url, decode=True)) - - yield file_info +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class MediafireCom(SimpleHoster): __name__ = "MediafireCom" __type__ = "hoster" - __version__ = "0.84" + __version__ = "0.85" - __pattern__ = r'http://(?:www\.)?mediafire\.com/(file/|(view/?|download\.php)?\?)(\w{11}|\w{15})($|/)' + __pattern__ = r'https?://(?:www\.)?mediafire\.com/(file/|view/\??|download(\.php\?|/))\w+' __description__ = """Mediafire.com hoster plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it")] + ("stickell", "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com")] + + NAME_PATTERN = r'' + SIZE_PATTERN = r'
  • File size: (?P[\d.,]+) (?P[\w^_]+)' + INFO_PATTERN = r'oFileSharePopup\.ald\(\'.*?\',\'(?P.+?)\',\'(?P[\d.,]+)\s*(?P[\w^_]+)\',\'\',\'(?P.+?)\'\)' + OFFLINE_PATTERN = r'class="error_msg_title"' - NAME_PATTERN = r'' - INFO_PATTERN = r'oFileSharePopup\.ald\(\'(?P[^\']*)\',\'(?P[^\']*)\',\'(?P[^\']*)\',\'\',\'(?P[^\']*)\'\)' - OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File.
  • ' + LINK_FREE_PATTERN = r'kNO = "(.+?)"' PASSWORD_PATTERN = r'
    Date: Fri, 6 Mar 2015 22:54:04 +0100 Subject: [DailymotionBatch][YoutubeBatch] Renamed --- module/plugins/hoster/MediafireCom.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index 54df531bd..f9ad2502d 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -import re - from module.plugins.internal.CaptchaService import SolveMedia from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -- cgit v1.2.3 From 6f77d9c783d1a51f4c320b15fad8a4edd3bda414 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 8 Mar 2015 20:38:07 +0100 Subject: [FileSharkPl] Fix https://github.com/pyload/pyload/issues/1040 (thx https://github.com/valdi74) --- module/plugins/hoster/FileSharkPl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index e4ce711bd..7e6130739 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FileSharkPl(SimpleHoster): __name__ = "FileSharkPl" __type__ = "hoster" - __version__ = "0.07" + __version__ = "0.08" __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d+/\w+' @@ -80,6 +80,8 @@ class FileSharkPl(SimpleHoster): link = urljoin("http://fileshark.pl", m.group(1)) + self.html = self.load(link, decode=True) + m = re.search(self.WAIT_PATTERN, self.html) if m: seconds = int(m.group(1)) -- cgit v1.2.3 From 6cf515ec73eefe0859a31f6b254de9ae54fc17ae Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 8 Mar 2015 20:39:55 +0100 Subject: [ZippyshareCom] Better lib import --- module/plugins/hoster/ZippyshareCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index c7a568e79..9d7c6949f 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -2,7 +2,7 @@ import re -from module.lib.BeautifulSoup import BeautifulSoup +from BeautifulSoup import BeautifulSoup from module.plugins.internal.CaptchaService import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -- cgit v1.2.3 From 2d302677064dd5996add552ee214093c6d73acea Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 9 Mar 2015 18:20:24 +0100 Subject: Rename fileUrl to getFileURL --- module/plugins/hoster/BasePlugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index f9eb695ca..42bfed91e 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -6,14 +6,14 @@ from urllib import unquote from urlparse import urljoin, urlparse from module.network.HTTPRequest import BadHeader -from module.plugins.internal.SimpleHoster import create_getInfo, fileUrl +from module.plugins.internal.SimpleHoster import create_getInfo, getFileURL from module.plugins.Hoster import Hoster class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" - __version__ = "0.34" + __version__ = "0.35" __pattern__ = r'^unmatchable$' @@ -51,7 +51,7 @@ class BasePlugin(Hoster): for _i in xrange(5): try: - link = fileUrl(self, unquote(pyfile.url)) + link = getFileURL(self, unquote(pyfile.url)) if link: self.download(link, ref=False, disposition=True) -- cgit v1.2.3 From 678f488777a94522ce8ba68f106428eefa037f50 Mon Sep 17 00:00:00 2001 From: sebdelsol Date: Mon, 9 Mar 2015 21:42:19 +0100 Subject: [ZippyShare] Bug #1238 correction * remove non ascii character from the id part in the js variable name. * change the RE so that it works for any character in the id name --- module/plugins/hoster/ZippyshareCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index 9d7c6949f..f2c99de7b 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ZippyshareCom(SimpleHoster): __name__ = "ZippyshareCom" __type__ = "hoster" - __version__ = "0.74" + __version__ = "0.75" __pattern__ = r'http://www\d{0,2}\.zippyshare\.com/v(/|iew\.jsp.*key=)(?P[\w^_]+)' @@ -64,7 +64,7 @@ class ZippyshareCom(SimpleHoster): id = element.group(1) attr = element.group(4) #: attr might be None - varName = '%s_%s' % (id, attr) + varName = '%s_%s' % (re.sub(r'\W', '', id), attr) initValues = filter(None, [elt.get(attr, None) for elt in soup.findAll(id=id)]) initValue = '"%s"' % initValues[-1] if initValues else 'null' @@ -72,7 +72,7 @@ class ZippyshareCom(SimpleHoster): return varName # handle all getElementById - reVar = r'document.getElementById\([\'"](\w+)[\'"]\)(\.)?(getAttribute\([\'"])?(\w+)?([\'"]\))?' + reVar = r'document.getElementById\([\'"](.+)[\'"]\)(\.)?(getAttribute\([\'"])?(\w+)?([\'"]\))?' scripts = [re.sub(reVar, replElementById, script) for script in scripts] # add try/catch in JS to handle deliberate errors -- cgit v1.2.3 From f85e28e565a1e0a76e6271d0b0853d6d48b4a043 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 10 Mar 2015 01:16:29 +0100 Subject: [MultiHook] Fix _pluginSet (fix LinkdecrypterCom issue) --- module/plugins/hoster/XFileSharingPro.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index c66f25ad4..1bfb504b7 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.44" + __version__ = "0.45" __pattern__ = r'^unmatchable$' @@ -34,9 +34,6 @@ class XFileSharingPro(XFSHoster): self.HOSTER_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group("DOMAIN").lower() 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 = 'X' + self.HOSTER_NAME - account = self.core.accountManager.getAccountPlugin(self.HOSTER_NAME) if account and account.canUse(): -- cgit v1.2.3 From 7beb65e991bc6d1913c3b5bb2ef69e659d5b8342 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 10 Mar 2015 01:55:52 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/AlldebridCom.py | 2 +- module/plugins/hoster/BitshareCom.py | 2 +- module/plugins/hoster/CzshareCom.py | 6 +++--- module/plugins/hoster/DailymotionCom.py | 2 +- module/plugins/hoster/FileSharkPl.py | 2 +- module/plugins/hoster/FlyFilesNet.py | 2 +- module/plugins/hoster/GooIm.py | 2 +- module/plugins/hoster/IfolderRu.py | 12 ++++++------ module/plugins/hoster/KingfilesNet.py | 4 ++-- module/plugins/hoster/LetitbitNet.py | 6 +++--- module/plugins/hoster/MegaDebridEu.py | 2 +- module/plugins/hoster/NetloadIn.py | 2 +- module/plugins/hoster/NosuploadCom.py | 4 ++-- module/plugins/hoster/OverLoadMe.py | 4 ++-- module/plugins/hoster/RealdebridCom.py | 2 +- module/plugins/hoster/UlozTo.py | 8 ++++---- module/plugins/hoster/UnrestrictLi.py | 2 +- module/plugins/hoster/UploadableCh.py | 9 ++++----- module/plugins/hoster/VeohCom.py | 2 +- module/plugins/hoster/VimeoCom.py | 4 ++-- module/plugins/hoster/XHamsterCom.py | 4 ++-- module/plugins/hoster/YoutubeCom.py | 6 +++--- 22 files changed, 44 insertions(+), 45 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index 427eb42f0..90590adac 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -58,7 +58,7 @@ class AlldebridCom(MultiHoster): pyfile.size = parseFileSize(data['filesize']) self.link = data['link'] - if self.getConfig("ssl"): + if self.getConfig('ssl'): self.link = self.link.replace("http://", "https://") else: self.link = self.link.replace("https://", "http://") diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index 657e70e56..3bcc76146 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -80,7 +80,7 @@ class BitshareCom(SimpleHoster): def getDownloadUrl(self): # Return location if direct download is active if self.premium: - header = self.load(self.pyfile.url, cookies=True, just_header=True) + header = self.load(self.pyfile.url, just_header=True) if 'location' in header: return header['location'] diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 49c7a6648..d055f49ba 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -43,7 +43,7 @@ class CzshareCom(SimpleHoster): m = re.search(self.USER_CREDIT_PATTERN, self.html) if m is None: self.account.relogin(self.user) - self.html = self.load(self.pyfile.url, cookies=True, decode=True) + self.html = self.load(self.pyfile.url, decode=True) m = re.search(self.USER_CREDIT_PATTERN, self.html) if m is None: return False @@ -87,7 +87,7 @@ class CzshareCom(SimpleHoster): self.logDebug("PARSED_URL:" + parsed_url) # get download ticket and parse html - self.html = self.load(parsed_url, cookies=True, decode=True) + self.html = self.load(parsed_url, decode=True) if re.search(self.MULTIDL_PATTERN, self.html): self.longWait(5 * 60, 12) @@ -104,7 +104,7 @@ class CzshareCom(SimpleHoster): captcha_url = 'http://sdilej.cz/captcha.php' for _i in xrange(5): inputs['captchastring2'] = self.decryptCaptcha(captcha_url) - self.html = self.load(parsed_url, cookies=True, post=inputs, decode=True) + self.html = self.load(parsed_url, post=inputs, decode=True) if u"
  • Zadaný ověřovací kód nesouhlasí!
  • " in self.html: self.invalidCaptcha() diff --git a/module/plugins/hoster/DailymotionCom.py b/module/plugins/hoster/DailymotionCom.py index 02df9dde7..c6939e5e5 100644 --- a/module/plugins/hoster/DailymotionCom.py +++ b/module/plugins/hoster/DailymotionCom.py @@ -72,7 +72,7 @@ class DailymotionCom(Hoster): def getQuality(self): - q = self.getConfig("quality") + q = self.getConfig('quality') if q == "Lowest": quality = 0 diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index 7e6130739..ac669ab1b 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -108,7 +108,7 @@ class FileSharkPl(SimpleHoster): self.load = tmp_load - self.download(link, post=inputs, cookies=True, disposition=True) + self.download(link, post=inputs, disposition=True) def checkFile(self): diff --git a/module/plugins/hoster/FlyFilesNet.py b/module/plugins/hoster/FlyFilesNet.py index 49705958d..636e02acf 100644 --- a/module/plugins/hoster/FlyFilesNet.py +++ b/module/plugins/hoster/FlyFilesNet.py @@ -32,7 +32,7 @@ class FlyFilesNet(SimpleHoster): url = "http://flyfiles.net" # get download URL - parsed_url = getURL(url, post={"getDownLink": session}, cookies=True) + parsed_url = getURL(url, post={"getDownLink": session}) self.logDebug("Parsed URL: %s" % parsed_url) if parsed_url == '#downlink|' or parsed_url == "#downlink|#": diff --git a/module/plugins/hoster/GooIm.py b/module/plugins/hoster/GooIm.py index 2cb012e50..1e1ffbc08 100644 --- a/module/plugins/hoster/GooIm.py +++ b/module/plugins/hoster/GooIm.py @@ -31,7 +31,7 @@ class GooIm(SimpleHoster): def handleFree(self, pyfile): self.wait(10) - self.download(pyfile.url, cookies=True) + self.download(pyfile.url) getInfo = create_getInfo(GooIm) diff --git a/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py index 249c2feb1..04c08ef0a 100644 --- a/module/plugins/hoster/IfolderRu.py +++ b/module/plugins/hoster/IfolderRu.py @@ -38,23 +38,23 @@ class IfolderRu(SimpleHoster): def handleFree(self, pyfile): - self.html = self.load("http://rusfolder.com/%s" % self.info['pattern']['ID'], cookies=True, decode=True) + self.html = self.load("http://rusfolder.com/%s" % self.info['pattern']['ID'], decode=True) self.getFileInfo() url = re.search(r"location\.href = '(http://ints\..*?=)'", self.html).group(1) - self.html = self.load(url, cookies=True, decode=True) + self.html = self.load(url, decode=True) url, session_id = re.search(self.SESSION_ID_PATTERN, self.html).groups() - self.html = self.load(url, cookies=True, decode=True) + self.html = self.load(url, decode=True) url = "http://ints.rusfolder.com/ints/frame/?session=%s" % session_id - self.html = self.load(url, cookies=True) + self.html = self.load(url) self.wait(31, False) captcha_url = "http://ints.rusfolder.com/random/images/?session=%s" % session_id for _i in xrange(5): - self.html = self.load(url, cookies=True) + self.html = self.load(url) action, inputs = self.parseHtmlForm('ID="Form1"') inputs['ints_session'] = re.search(self.INTS_SESSION_PATTERN, self.html).group(1) inputs[re.search(self.HIDDEN_INPUT_PATTERN, self.html).group(1)] = '1' @@ -62,7 +62,7 @@ class IfolderRu(SimpleHoster): inputs['action'] = '1' self.logDebug(inputs) - self.html = self.load(url, decode=True, cookies=True, post=inputs) + self.html = self.load(url, decode=True, post=inputs) if self.WRONG_CAPTCHA_PATTERN in self.html: self.invalidCaptcha() else: diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 2d1c3b096..0030513cf 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -43,7 +43,7 @@ class KingfilesNet(SimpleHoster): 'referer' : "", 'method_free': "+"} - self.html = self.load(pyfile.url, post=post_data, cookies=True, decode=True) + self.html = self.load(pyfile.url, post=post_data, decode=True) solvemedia = SolveMedia(self) response, challenge = solvemedia.challenge() @@ -66,7 +66,7 @@ class KingfilesNet(SimpleHoster): 'adcopy_challenge': challenge, 'down_direct' : "1"} - self.html = self.load(pyfile.url, post=post_data, cookies=True, decode=True) + self.html = self.load(pyfile.url, post=post_data, decode=True) m = re.search(self.LINK_FREE_PATTERN, self.html) if m is None: diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index 2c725427d..273cea871 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -75,7 +75,7 @@ class LetitbitNet(SimpleHoster): self.logDebug(action, inputs) inputs['desc'] = "" - self.html = self.load(urljoin("http://letitbit.net/", action), post=inputs, cookies=True) + self.html = self.load(urljoin("http://letitbit.net/", action), post=inputs) m = re.search(self.SECONDS_PATTERN, self.html) seconds = int(m.group(1)) if m else 60 @@ -89,7 +89,7 @@ class LetitbitNet(SimpleHoster): self.wait(seconds) - res = self.load("http://letitbit.net/ajax/download3.php", post=" ", cookies=True) + res = self.load("http://letitbit.net/ajax/download3.php", post=" ") if res != '1': self.error(_("Unknown response - ajax_check_url")) @@ -104,7 +104,7 @@ class LetitbitNet(SimpleHoster): self.logDebug("Post data to send", post_data) - res = self.load("http://letitbit.net/ajax/check_recaptcha.php", post=post_data, cookies=True) + res = self.load("http://letitbit.net/ajax/check_recaptcha.php", post=post_data) self.logDebug(res) diff --git a/module/plugins/hoster/MegaDebridEu.py b/module/plugins/hoster/MegaDebridEu.py index b42362800..fa66e74e6 100644 --- a/module/plugins/hoster/MegaDebridEu.py +++ b/module/plugins/hoster/MegaDebridEu.py @@ -79,7 +79,7 @@ class MegaDebridEu(MultiHoster): exit the plugin on fail case And display the reason of this failure """ - if self.getConfig("unloadFailing"): + if self.getConfig('unloadFailing'): self.logError(_(msg)) self.resetAccount() else: diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 3efbdce23..16728ad43 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -172,7 +172,7 @@ class NetloadIn(Hoster): self.url = self.get_file_url(page) - def check_free_wait(self,page): + def check_free_wait(self, page): if ">An access request has been made from IP address <" in page: self.wantReconnect = True self.setWait(self.get_wait_time(page) or 30) diff --git a/module/plugins/hoster/NosuploadCom.py b/module/plugins/hoster/NosuploadCom.py index aeedd54f6..241ee3a29 100644 --- a/module/plugins/hoster/NosuploadCom.py +++ b/module/plugins/hoster/NosuploadCom.py @@ -26,14 +26,14 @@ class NosuploadCom(XFSHoster): def getDownloadLink(self): # stage1: press the "Free Download" button data = self.getPostParameters() - self.html = self.load(self.pyfile.url, post=data, ref=True, decode=True) + self.html = self.load(self.pyfile.url, post=data, decode=True) # stage2: wait some time and press the "Download File" button data = self.getPostParameters() wait_time = re.search(self.WAIT_PATTERN, self.html, re.M | re.S).group(1) self.logDebug("Hoster told us to wait %s seconds" % wait_time) self.wait(wait_time) - self.html = self.load(self.pyfile.url, post=data, ref=True, decode=True) + self.html = self.load(self.pyfile.url, post=data, decode=True) # stage3: get the download link return re.search(self.LINK_PATTERN, self.html, re.S).group(1) diff --git a/module/plugins/hoster/OverLoadMe.py b/module/plugins/hoster/OverLoadMe.py index 67563ca3d..e92d927f3 100644 --- a/module/plugins/hoster/OverLoadMe.py +++ b/module/plugins/hoster/OverLoadMe.py @@ -39,7 +39,7 @@ class OverLoadMe(MultiHoster): def handlePremium(self, pyfile): - https = "https" if self.getConfig("ssl") else "http" + https = "https" if self.getConfig('ssl') else "http" data = self.account.getAccountData(self.user) page = self.load(https + "://api.over-load.me/getdownload.php", get={'auth': data['password'], @@ -58,7 +58,7 @@ class OverLoadMe(MultiHoster): pyfile.size = parseFileSize(data['filesize']) http_repl = ["http://", "https://"] - self.link = data['downloadlink'].replace(*http_repl if self.getConfig("ssl") else *http_repl[::-1]) + self.link = data['downloadlink'].replace(*http_repl if self.getConfig('ssl') else *http_repl[::-1]) if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown") or pyfile.name.endswith('..'): # only use when name wasn't already set diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index d0010b3bd..14c46f522 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -58,7 +58,7 @@ class RealdebridCom(MultiHoster): pyfile.size = parseFileSize(data['file_size']) self.link = data['generated_links'][0][-1] - if self.getConfig("ssl"): + if self.getConfig('ssl'): self.link = self.link.replace("http://", "https://") else: self.link = self.link.replace("https://", "http://") diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index 3552942ff..035562962 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -46,7 +46,7 @@ class UlozTo(SimpleHoster): def process(self, pyfile): pyfile.url = re.sub(r"(?<=http://)([^/]+)", "www.ulozto.net", pyfile.url) - self.html = self.load(pyfile.url, decode=True, cookies=True) + self.html = self.load(pyfile.url, decode=True) if re.search(self.ADULT_PATTERN, self.html): self.logInfo(_("Adult content confirmation needed")) @@ -57,7 +57,7 @@ class UlozTo(SimpleHoster): token = m.group(1) self.html = self.load(pyfile.url, get={'do': "askAgeForm-submit"}, - post={"agree": "Confirm", "_token_": token}, cookies=True) + post={"agree": "Confirm", "_token_": token}) if self.PASSWD_PATTERN in self.html: password = self.getPassword() @@ -65,7 +65,7 @@ class UlozTo(SimpleHoster): if password: self.logInfo(_("Password protected link, trying ") + password) self.html = self.load(pyfile.url, get={'do': "passwordProtectedForm-submit"}, - post={"password": password, "password_send": 'Send'}, cookies=True) + post={"password": password, "password_send": 'Send'}) if self.PASSWD_PATTERN in self.html: self.fail(_("Incorrect password")) @@ -117,7 +117,7 @@ class UlozTo(SimpleHoster): self.error(_("CAPTCHA form changed")) self.multiDL = True - self.download("http://www.ulozto.net" + action, post=inputs, cookies=True, disposition=True) + self.download("http://www.ulozto.net" + action, post=inputs, disposition=True) def handlePremium(self, pyfile): diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 99fe01257..0a5c2081f 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -70,7 +70,7 @@ class UnrestrictLi(MultiHoster): def checkFile(self): super(UnrestrictLi, self).checkFile() - if self.getConfig("history"): + if self.getConfig('history'): self.load("https://unrestrict.li/history/", get={'delete': "all"}) self.logInfo(_("Download history deleted")) diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py index 11cf3d321..d09b99d92 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/UploadableCh.py @@ -35,13 +35,13 @@ class UploadableCh(SimpleHoster): def handleFree(self, pyfile): # Click the "free user" button and wait - a = self.load(pyfile.url, cookies=True, post={'downloadLink': "wait"}, decode=True) + a = self.load(pyfile.url, post={'downloadLink': "wait"}, decode=True) self.logDebug(a) self.wait(30) # Make the recaptcha appear and show it the pyload interface - b = self.load(pyfile.url, cookies=True, post={'checkDownload': "check"}, decode=True) + b = self.load(pyfile.url, post={'checkDownload': "check"}, decode=True) self.logDebug(b) #: Expected output: {"success":"showCaptcha"} recaptcha = ReCaptcha(self) @@ -50,7 +50,6 @@ class UploadableCh(SimpleHoster): # Submit the captcha solution self.load("http://www.uploadable.ch/checkReCaptcha.php", - cookies=True, post={'recaptcha_challenge_field' : challenge, 'recaptcha_response_field' : response, 'recaptcha_shortencode_field': self.info['pattern']['ID']}, @@ -59,12 +58,12 @@ class UploadableCh(SimpleHoster): self.wait(3) # Get ready for downloading - self.load(pyfile.url, cookies=True, post={'downloadLink': "show"}, decode=True) + self.load(pyfile.url, post={'downloadLink': "show"}, decode=True) self.wait(3) # Download the file - self.download(pyfile.url, cookies=True, post={'download': "normal"}, disposition=True) + self.download(pyfile.url, post={'download': "normal"}, disposition=True) def checkFile(self): diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 219efa8e1..567f8e867 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -33,7 +33,7 @@ class VeohCom(SimpleHoster): def handleFree(self, pyfile): - quality = self.getConfig("quality") + quality = self.getConfig('quality') if quality == "Auto": quality = ("High", "Low") diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index d427c1511..e47751c65 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -46,14 +46,14 @@ class VimeoCom(SimpleHoster): link = dict((l.group('QL').lower(), l.group('URL')) for l in re.finditer(pattern, html)) - if self.getConfig("original"): + if self.getConfig('original'): if "original" in link: self.download(link[q]) return else: self.logInfo(_("Original file not downloadable")) - quality = self.getConfig("quality") + quality = self.getConfig('quality') if quality == "Highest": qlevel = ("hd", "sd", "mobile") elif quality == "Lowest": diff --git a/module/plugins/hoster/XHamsterCom.py b/module/plugins/hoster/XHamsterCom.py index c6e789fa8..d68f46283 100644 --- a/module/plugins/hoster/XHamsterCom.py +++ b/module/plugins/hoster/XHamsterCom.py @@ -35,8 +35,8 @@ class XHamsterCom(Hoster): if not self.file_exists(): self.offline() - if self.getConfig("type"): - self.desired_fmt = self.getConfig("type") + if self.getConfig('type'): + self.desired_fmt = self.getConfig('type') pyfile.name = self.get_file_name() + self.desired_fmt self.download(self.get_file_url()) diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index d00bf2a0e..4fccbba65 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -95,7 +95,7 @@ class YoutubeCom(Hoster): self.tempOffline() #get config - use3d = self.getConfig("3d") + use3d = self.getConfig('3d') if use3d: quality = {"sd": 82, "hd": 84, "fullhd": 85, "240p": 83, "360p": 82, @@ -104,10 +104,10 @@ class YoutubeCom(Hoster): quality = {"sd": 18, "hd": 22, "fullhd": 37, "240p": 5, "360p": 18, "480p": 35, "720p": 22, "1080p": 37, "3072p": 38} - desired_fmt = self.getConfig("fmt") + desired_fmt = self.getConfig('fmt') if not desired_fmt: - desired_fmt = quality.get(self.getConfig("quality"), 18) + desired_fmt = quality.get(self.getConfig('quality'), 18) elif desired_fmt not in self.formats: self.logWarning(_("FMT %d unknown, using default") % desired_fmt) -- cgit v1.2.3 From cfd5dcb231d55478442c7b80517064b377eda43d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 10 Mar 2015 03:01:47 +0100 Subject: [RapidgatorNet] Fix https://github.com/pyload/pyload/issues/1237 --- module/plugins/hoster/RapidgatorNet.py | 36 ++++++++++++---------------------- 1 file changed, 13 insertions(+), 23 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index 7ec843646..761d7ff99 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -7,13 +7,13 @@ from pycurl import HTTPHEADER from module.common.json_layer import json_loads from module.network.HTTPRequest import BadHeader from module.plugins.internal.CaptchaService import AdsCaptcha, ReCaptcha, SolveMedia -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, secondsToMidnight +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class RapidgatorNet(SimpleHoster): __name__ = "RapidgatorNet" __type__ = "hoster" - __version__ = "0.32" + __version__ = "0.33" __pattern__ = r'http://(?:www\.)?(rapidgator\.net|rg\.to)/file/\w+' @@ -36,7 +36,7 @@ class RapidgatorNet(SimpleHoster): JSVARS_PATTERN = r'\s+var\s*(startTimerUrl|getDownloadUrl|captchaUrl|fid|secs)\s*=\s*\'?(.*?)\'?;' PREMIUM_ONLY_PATTERN = r'You can download files up to|This file can be downloaded by premium only<' - ERROR_PATTERN = r'You have reached your (daily|hourly) downloads limit' + ERROR_PATTERN = r'You have reached your (?:daily|hourly) downloads limit' WAIT_PATTERN = r'(Delay between downloads must be not less than|Try again in).+' LINK_FREE_PATTERN = r'return \'(http://\w+.rapidgator.net/.*)\';' @@ -125,8 +125,12 @@ class RapidgatorNet(SimpleHoster): self.link = m.group(1) break else: - captcha, captcha_key = self.handleCaptcha() - response, challenge = captcha.challenge(captcha_key) + captcha = self.handleCaptcha() + + if not captcha: + self.error(_("Captcha pattern not found")) + + response, challenge = captcha.challenge() self.html = self.load(url, post={'DownloadCaptchaForm[captcha]': "", 'adcopy_challenge' : challenge, @@ -141,24 +145,10 @@ class RapidgatorNet(SimpleHoster): def handleCaptcha(self): - m = re.search(self.ADSCAPTCHA_PATTERN, self.html) - if m: - captcha_key = m.group(1) - captcha = AdsCaptcha(self) - else: - m = re.search(self.RECAPTCHA_PATTERN, self.html) - if m: - captcha_key = m.group(1) - captcha = ReCaptcha(self) - else: - m = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if m: - captcha_key = m.group(1) - captcha = SolveMedia(self) - else: - self.error(_("Captcha")) - - return captcha, captcha_key + for klass in (AdsCaptcha, ReCaptcha, SolveMedia): + inst = klass(self) + if inst.detect_key(): + return inst def getJsonResponse(self, url): -- cgit v1.2.3 From 5a5ca4b172aecdc5e637b47bef0e52ed121c7b05 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 10 Mar 2015 03:33:54 +0100 Subject: [UptoboxCom] TEMP_OFFLINE_PATTERN --- module/plugins/hoster/UptoboxCom.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py index 3f79e509e..991bc640e 100644 --- a/module/plugins/hoster/UptoboxCom.py +++ b/module/plugins/hoster/UptoboxCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class UptoboxCom(XFSHoster): __name__ = "UptoboxCom" __type__ = "hoster" - __version__ = "0.17" + __version__ = "0.18" __pattern__ = r'https?://(?:www\.)?(uptobox|uptostream)\.com/\w{12}' @@ -15,8 +15,9 @@ class UptoboxCom(XFSHoster): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - INFO_PATTERN = r'"para_title">(?P.+) \((?P[\d.,]+) (?P[\w^_]+)\)' - OFFLINE_PATTERN = r'>(File not found|Access Denied|404 Not Found)' + INFO_PATTERN = r'"para_title">(?P.+) \((?P[\d.,]+) (?P[\w^_]+)\)' + OFFLINE_PATTERN = r'>(File not found|Access Denied|404 Not Found)' + TEMP_OFFLINE_PATTERN = r'>Service Unavailable' LINK_PATTERN = r'"(https?://\w+\.uptobox\.com/d/.*?)"' -- cgit v1.2.3 From 58e98ab99bd7672492109786c4db7076d231631b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 10 Mar 2015 15:32:24 +0100 Subject: [FileSharkPl] Fix https://github.com/pyload/pyload/issues/1040 (2) --- module/plugins/hoster/FileSharkPl.py | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index ac669ab1b..df54997d8 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FileSharkPl(SimpleHoster): __name__ = "FileSharkPl" __type__ = "hoster" - __version__ = "0.08" + __version__ = "0.09" __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d+/\w+' @@ -20,10 +20,9 @@ class FileSharkPl(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - NAME_PATTERN = r'

    (?P.+)

    ' - SIZE_PATTERN = r'

    (.*?)(?P\d+\.?\d*)\s(?P\w+)

    ' - - OFFLINE_PATTERN = '(P|p)lik zosta. (usuni.ty|przeniesiony)' + NAME_PATTERN = r'

    (?P.+)

    ' + SIZE_PATTERN = r'

    (.*?)(?P\d+\.?\d*)\s(?P\w+)

    ' + OFFLINE_PATTERN = r'(P|p)lik zosta. (usuni.ty|przeniesiony)' LINK_FREE_PATTERN = r'' LINK_PREMIUM_PATTERN = r'' @@ -33,7 +32,7 @@ class FileSharkPl(SimpleHoster): IP_ERROR_PATTERN = r'Strona jest dost.pna wy..cznie dla u.ytkownik.w znajduj.cych si. na terenie Polski' SLOT_ERROR_PATTERN = r'Osi.gni.to maksymaln. liczb. .ci.ganych jednocze.nie plik.w\.' - CAPTCHA_PATTERN = '' @@ -80,7 +79,7 @@ class FileSharkPl(SimpleHoster): link = urljoin("http://fileshark.pl", m.group(1)) - self.html = self.load(link, decode=True) + self.html = self.load(link) m = re.search(self.WAIT_PATTERN, self.html) if m: @@ -111,23 +110,6 @@ class FileSharkPl(SimpleHoster): self.download(link, post=inputs, disposition=True) - def checkFile(self): - check = self.checkDownload({'wrong_captcha': re.compile(r''), - 'wait_pattern' : re.compile(self.SECONDS_PATTERN), - 'DL-found' : re.compile('')}) - if check == "DL-found": - self.correctCaptcha() - - elif check == "wrong_captcha": - self.invalidCaptcha() - self.retry(10, 1, _("Wrong captcha solution")) - - elif check == "wait_pattern": - self.retry() - - return super(FileSharkPl, self).checkFile() - - def _decode64(self, data, *args, **kwargs): return data.decode('base64') -- cgit v1.2.3 From 85bba1418987aa3e8b11a75a2732577da6008d8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 10 Mar 2015 16:29:19 +0100 Subject: [FilerNet] Fix WAIT_PATTERN --- module/plugins/hoster/FilerNet.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index c5007e945..e790272f4 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.16" + __version__ = "0.17" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' @@ -29,17 +29,9 @@ class FilerNet(SimpleHoster): INFO_PATTERN = r'

    Free Download (?P\S+) (?P[\w.]+) (?P[\w^_]+)

    ' OFFLINE_PATTERN = r'Nicht gefunden' - LINK_FREE_PATTERN = LINK_PREMIUM_PATTERN = r'href="([^"]+)">Get download
    ' - + WAIT_PATTERN = r'musst du (\d+)' - def checkErrors(self): - # Wait between downloads - m = re.search(r'musst du (\d+) Sekunden warten', self.html) - if m: - errmsg = self.info['error'] = _("Wait between free downloads") - self.retry(wait_time=int(m.group(1)), reason=errmsg) - - self.info.pop('error', None) + LINK_FREE_PATTERN = LINK_PREMIUM_PATTERN = r'href="([^"]+)">Get download' def handleFree(self, pyfile): -- cgit v1.2.3 From e113228d008b78ff45db52f4917fef392c38b5e3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 10 Mar 2015 22:38:17 +0100 Subject: [FilerNet] Fix https://github.com/pyload/pyload/issues/1201 --- module/plugins/hoster/FilerNet.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index e790272f4..b8a97d6a1 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.17" + __version__ = "0.18" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' @@ -63,4 +63,10 @@ class FilerNet(SimpleHoster): self.invalidCaptcha() + def checkFile(self, rules={}): + if self.checkDownload({'Html file': re.compile(r'\A\s* Date: Tue, 10 Mar 2015 22:42:32 +0100 Subject: Update plugins after SimpleHoster changes --- module/plugins/hoster/AlldebridCom.py | 6 +++--- module/plugins/hoster/CzshareCom.py | 6 +++--- module/plugins/hoster/EuroshareEu.py | 6 +++--- module/plugins/hoster/FastixRu.py | 6 +++--- module/plugins/hoster/FastshareCz.py | 6 +++--- module/plugins/hoster/FilefactoryCom.py | 6 +++--- module/plugins/hoster/OverLoadMe.py | 6 +++--- module/plugins/hoster/PremiumTo.py | 6 +++--- module/plugins/hoster/RealdebridCom.py | 6 +++--- module/plugins/hoster/ShareonlineBiz.py | 6 +++--- module/plugins/hoster/SimplydebridCom.py | 6 +++--- module/plugins/hoster/SmoozedCom.py | 6 +++--- module/plugins/hoster/UnrestrictLi.py | 6 +++--- module/plugins/hoster/UploadableCh.py | 6 +++--- module/plugins/hoster/UploadedTo.py | 6 +++--- module/plugins/hoster/UploadheroCom.py | 10 +++++----- module/plugins/hoster/ZeveraCom.py | 6 +++--- 17 files changed, 53 insertions(+), 53 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index 90590adac..0a35ae2be 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -13,7 +13,7 @@ from module.utils import parseFileSize class AlldebridCom(MultiHoster): __name__ = "AlldebridCom" __type__ = "hoster" - __version__ = "0.44" + __version__ = "0.45" __pattern__ = r'https?://(?:www\.|s\d+\.)?alldebrid\.com/dl/[\w^_]+' @@ -68,11 +68,11 @@ class AlldebridCom(MultiHoster): pyfile.name = self.getFilename(self.link) - def checkFile(self): + def checkFile(self, rules={}): if self.checkDownload({'error': "An error occured while processing your request"}) == "error": self.retry(wait_time=60, reason=_("An error occured while generating link")) - return super(AlldebridCom, self).checkFile() + return super(AlldebridCom, self).checkFile(rules) getInfo = create_getInfo(AlldebridCom) diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index d055f49ba..34f52c05c 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -12,7 +12,7 @@ from module.utils import parseFileSize class CzshareCom(SimpleHoster): __name__ = "CzshareCom" __type__ = "hoster" - __version__ = "0.98" + __version__ = "0.99" __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/(\d+/|download\.php\?).+' @@ -133,7 +133,7 @@ class CzshareCom(SimpleHoster): self.wait() - def checkFile(self): + def checkFile(self, rules={}): # check download check = self.checkDownload({ "temp offline" : re.compile(r"^Soubor je do.*asn.* nedostupn.*$"), @@ -155,7 +155,7 @@ class CzshareCom(SimpleHoster): self.invalidCaptcha() self.retry() - return super(CzshareCom, self).checkFile() + return super(CzshareCom, self).checkFile(rules) getInfo = create_getInfo(CzshareCom) diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py index b4c9ace6a..9b71ddfc1 100644 --- a/module/plugins/hoster/EuroshareEu.py +++ b/module/plugins/hoster/EuroshareEu.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class EuroshareEu(SimpleHoster): __name__ = "EuroshareEu" __type__ = "hoster" - __version__ = "0.27" + __version__ = "0.28" __pattern__ = r'http://(?:www\.)?euroshare\.(eu|sk|cz|hu|pl)/file/.+' @@ -57,11 +57,11 @@ class EuroshareEu(SimpleHoster): self.link = "http://euroshare.eu%s" % m.group(1) - def checkFile(self): + def checkFile(self, rules={}): if self.checkDownload({"multi-dl": re.compile(self.ERR_PARDL_PATTERN)}) self.longWait(5 * 60, 12) - return super(EuroshareEu, self).checkFile() + return super(EuroshareEu, self).checkFile(rules) getInfo = create_getInfo(EuroshareEu) diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index d534101d8..759b9bfec 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -12,7 +12,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class FastixRu(MultiHoster): __name__ = "FastixRu" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" __pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/\w{24}' @@ -56,11 +56,11 @@ class FastixRu(MultiHoster): pyfile.name = self.getFilename(self.link) - def checkFile(self): + def checkFile(self, rules={}): if self.checkDownload({"error": "An error occurred while processing your request"}): self.retry(wait_time=60, reason=_("An error occurred while generating link")) - return super(FastixRu, self).checkFile() + return super(FastixRu, self).checkFile(rules) getInfo = create_getInfo(FastixRu) diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index 6fe871ad4..626521ed2 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FastshareCz(SimpleHoster): __name__ = "FastshareCz" __type__ = "hoster" - __version__ = "0.27" + __version__ = "0.28" __pattern__ = r'http://(?:www\.)?fastshare\.cz/\d+/.+' @@ -57,7 +57,7 @@ class FastshareCz(SimpleHoster): self.download(urljoin(baseurl, action), post={'code': captcha, 'btn.x': 77, 'btn.y': 18}) - def checkFile(self): + def checkFile(self, rules={}): check = self.checkDownload({ 'paralell-dl' : re.compile(r"FastShare.cz|