diff options
86 files changed, 283 insertions, 233 deletions
diff --git a/module/plugins/crypter/DdlstorageComFolder.py b/module/plugins/crypter/DdlstorageComFolder.py index 6501de822..ef43edc5b 100644 --- a/module/plugins/crypter/DdlstorageComFolder.py +++ b/module/plugins/crypter/DdlstorageComFolder.py @@ -26,4 +26,4 @@ class DdlstorageComFolder(SimpleCrypter): __author_name__ = ("godofdream", "stickell") __author_mail__ = ("soilfiction@gmail.com", "l.stickell@yahoo.it") - LINK_PATTERN = '<a class="sub_title" style="text-decoration:none;" href="(http://www.ddlstorage.com/.*)">' + LINK_PATTERN = r'<a class="sub_title" style="text-decoration:none;" href="(http://www.ddlstorage.com/.*)">' diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index dbe5bf705..780708884 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -32,7 +32,7 @@ class DlProtectCom(SimpleCrypter): __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" - OFFLINE_PATTERN = ">Unfortunately, the link you are looking for is not found" + OFFLINE_PATTERN = r'>Unfortunately, the link you are looking for is not found' def getLinks(self): # Direct link with redirect diff --git a/module/plugins/crypter/DontKnowMe.py b/module/plugins/crypter/DontKnowMe.py index 42a38e98f..092834325 100644 --- a/module/plugins/crypter/DontKnowMe.py +++ b/module/plugins/crypter/DontKnowMe.py @@ -15,7 +15,7 @@ class DontKnowMe(Crypter): __author_name__ = "selaux" __author_mail__ = "" - LINK_PATTERN = r"http://dontknow.me/at/\?(.+)$" + LINK_PATTERN = r'http://dontknow.me/at/\?(.+)$' def decrypt(self, pyfile): link = re.findall(self.LINK_PATTERN, pyfile.url)[0] diff --git a/module/plugins/crypter/FilestubeCom.py b/module/plugins/crypter/FilestubeCom.py index f4f09e878..ac67c33c9 100644 --- a/module/plugins/crypter/FilestubeCom.py +++ b/module/plugins/crypter/FilestubeCom.py @@ -26,5 +26,5 @@ class FilestubeCom(SimpleCrypter): __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - LINK_PATTERN = r"<a class=\"file-link-main(?: noref)?\" [^>]* href=\"(http://[^\"]+)" - TITLE_PATTERN = r"<h1\s*> (?P<title>.+) download\s*</h1>" + LINK_PATTERN = r'<a class=\"file-link-main(?: noref)?\" [^>]* href=\"(http://[^\"]+)' + TITLE_PATTERN = r'<h1\s*> (?P<title>.+) download\s*</h1>' diff --git a/module/plugins/crypter/FiletramCom.py b/module/plugins/crypter/FiletramCom.py index 8cdf32ad5..5a587eda2 100644 --- a/module/plugins/crypter/FiletramCom.py +++ b/module/plugins/crypter/FiletramCom.py @@ -26,5 +26,5 @@ class FiletramCom(SimpleCrypter): __author_name__ = ("igel", "stickell") __author_mail__ = ("igelkun@myopera.com", "l.stickell@yahoo.it") - LINK_PATTERN = r"\s+(http://.+)" - TITLE_PATTERN = r"<title>(?P<title>[^<]+) - Free Download[^<]*</title>" + LINK_PATTERN = r'\s+(http://.+)' + TITLE_PATTERN = r'<title>(?P<title>[^<]+) - Free Download[^<]*</title>' diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 15f0a9a8c..343bce5fd 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -27,7 +27,7 @@ class GooGl(Crypter): __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - API_URL = 'https://www.googleapis.com/urlshortener/v1/url' + API_URL = "https://www.googleapis.com/urlshortener/v1/url" def decrypt(self, pyfile): rep = self.load(self.API_URL, get={'shortUrl': pyfile.url}) diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 85dde6c87..13277e3f3 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -27,7 +27,7 @@ class LinkSaveIn(Crypter): # Constants _JK_KEY_ = "jk" _CRYPTED_KEY_ = "crypted" - HOSTER_DOMAIN = "linksave.in" + HOSTER_NAME = "linksave.in" def setup(self): self.html = None @@ -41,7 +41,7 @@ class LinkSaveIn(Crypter): # Init self.package = pyfile.package() self.fileid = re.match(self.__pattern__, pyfile.url).group('id') - self.req.cj.setCookie(self.HOSTER_DOMAIN, "Linksave_Language", "english") + self.req.cj.setCookie(self.HOSTER_NAME, "Linksave_Language", "english") # Request package self.html = self.load(pyfile.url) diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 619a474f2..8fca7dc02 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -14,7 +14,7 @@ class LixIn(Crypter): __author_name__ = "spoob" __author_mail__ = "spoob@pyload.org" - CAPTCHA_PATTERN = '<img src="(?P<image>captcha_img.php\?.*?)"' + CAPTCHA_PATTERN = r'<img src="(?P<image>captcha_img.php\?.*?)"' SUBMIT_PATTERN = r"value='continue.*?'" LINK_PATTERN = r'name="ifram" src="(?P<link>.*?)"' diff --git a/module/plugins/crypter/MediafireComFolder.py b/module/plugins/crypter/MediafireComFolder.py index 46856229c..1ab16f31f 100644 --- a/module/plugins/crypter/MediafireComFolder.py +++ b/module/plugins/crypter/MediafireComFolder.py @@ -16,7 +16,8 @@ class MediafireComFolder(Crypter): __author_mail__ = "zoidberg@mujmail.cz" FOLDER_KEY_PATTERN = r"var afI= '(\w+)';" - FILE_URL_PATTERN = '<meta property="og:url" content="http://www.mediafire.com/\?(\w+)"/>' + FILE_URL_PATTERN = r'<meta property="og:url" content="http://www.mediafire.com/\?(\w+)"/>' + def decrypt(self, pyfile): new_links = [] diff --git a/module/plugins/crypter/NosvideoCom.py b/module/plugins/crypter/NosvideoCom.py index 63e199a7a..20097c7bf 100644 --- a/module/plugins/crypter/NosvideoCom.py +++ b/module/plugins/crypter/NosvideoCom.py @@ -13,4 +13,4 @@ class NosvideoCom(SimpleCrypter): __author_mail__ = "igelkun@myopera.com" LINK_PATTERN = r'href="(http://(?:w{3}\.)?nosupload.com/\?d=\w+)"' - TITLE_PATTERN = r"<[tT]itle>Watch (?P<title>.+)</[tT]itle>" + TITLE_PATTERN = r'<[tT]itle>Watch (?P<title>.+)</[tT]itle>' diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index aad55c867..f6503374f 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -21,27 +21,28 @@ class RelinkUs(Crypter): # Constants PREFERRED_LINK_SOURCES = ['cnl2', 'dlc', 'web'] - OFFLINE_TOKEN = "<title>Tattooside" - PASSWORD_TOKEN = "container_password.php" - PASSWORD_ERROR_ROKEN = "You have entered an incorrect password" - PASSWORD_SUBMIT_URL = "http://www.relink.us/container_password.php" - CAPTCHA_TOKEN = "container_captcha.php" - CAPTCHA_ERROR_ROKEN = "You have solved the captcha wrong" - CAPTCHA_IMG_URL = "http://www.relink.us/core/captcha/circlecaptcha.php" - CAPTCHA_SUBMIT_URL = "http://www.relink.us/container_captcha.php" - FILE_TITLE_REGEX = r"<th>Title</th><td><i>(.*)</i></td></tr>" - FILE_NOTITLE = 'No title' + OFFLINE_TOKEN = r'<title>Tattooside' + PASSWORD_TOKEN = r'container_password\.php' + PASSWORD_ERROR_ROKEN = r'You have entered an incorrect password' + PASSWORD_SUBMIT_URL = r'http://www\.relink\.us/container_password\.php' + CAPTCHA_TOKEN = r'container_captcha\.php' + CAPTCHA_ERROR_ROKEN = r'You have solved the captcha wrong' + CAPTCHA_IMG_URL = r'http://www\.relink\.us/core/captcha/circlecaptcha\.php' + CAPTCHA_SUBMIT_URL = r'http://www\.relink\.us/container_captcha\.php' + FILE_TITLE_REGEX = r'<th>Title</th><td><i>(.*)</i></td></tr>' + FILE_NOTITLE = r'No title' CNL2_FORM_REGEX = r'<form id="cnl_form-(.*?)</form>' CNL2_FORMINPUT_REGEX = r'<input.*?name="%s".*?value="(.*?)"' CNL2_JK_KEY = "jk" CNL2_CRYPTED_KEY = "crypted" DLC_LINK_REGEX = r'<a href=".*?" class="dlc_button" target="_blank">' - DLC_DOWNLOAD_URL = "http://www.relink.us/download.php" + DLC_DOWNLOAD_URL = r'http://www\.relink\.us/download\.php' WEB_FORWARD_REGEX = r"getFile\('(?P<link>.+)'\)" - WEB_FORWARD_URL = "http://www.relink.us/frame.php" + WEB_FORWARD_URL = r'http://www\.relink\.us/frame\.php' WEB_LINK_REGEX = r'<iframe name="Container" height="100%" frameborder="no" width="100%" src="(?P<link>.+)"></iframe>' + def setup(self): self.fileid = None self.package = None diff --git a/module/plugins/crypter/YoutubeBatch.py b/module/plugins/crypter/YoutubeBatch.py index 4ba1a3c70..ade31df21 100644 --- a/module/plugins/crypter/YoutubeBatch.py +++ b/module/plugins/crypter/YoutubeBatch.py @@ -24,7 +24,7 @@ from module.common.json_layer import json_loads from module.plugins.Crypter import Crypter from module.utils import save_join -API_KEY = "AIzaSyCKnWLNlkX-L4oD1aEzqqhRw1zczeD6_k0" +API_URL = "AIzaSyCKnWLNlkX-L4oD1aEzqqhRw1zczeD6_k0" class YoutubeBatch(Crypter): diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 970ac8081..68b98e0a7 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -18,6 +18,7 @@ class BasePlugin(Hoster): __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.org" + def setup(self): self.chunkLimit = -1 self.resumeDownload = True diff --git a/module/plugins/hoster/BayfilesCom.py b/module/plugins/hoster/BayfilesCom.py index 82dd11446..28f3c2e92 100644 --- a/module/plugins/hoster/BayfilesCom.py +++ b/module/plugins/hoster/BayfilesCom.py @@ -38,7 +38,7 @@ class BayfilesCom(SimpleHoster): WAIT_PATTERN = r'>Your IP [0-9.]* has recently downloaded a file\. Upgrade to premium or wait (\d+) minutes\.<' VARS_PATTERN = r'var vfid = (\d+);\s*var delay = (\d+);' - LINK_PATTERN = r"javascript:window.location.href = '([^']+)';" + FREE_LINK_PATTERN = r"javascript:window.location.href = '([^']+)';" PREMIUM_LINK_PATTERN = r'(?:<a class="highlighted-btn" href="|(?=http://s\d+\.baycdn\.com/dl/))(.*?)"' def handleFree(self): @@ -69,7 +69,7 @@ class BayfilesCom(SimpleHoster): "vfid": vfid}) # Get final link and download - found = re.search(self.LINK_PATTERN, self.html) + found = re.search(self.FREE_LINK_PATTERN, self.html) if not found: self.parseError("Free link") self.startDownload(found.group(1)) diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index 89546aae5..e8e0f9203 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -17,15 +17,15 @@ class BitshareCom(SimpleHoster): __author_name__ = ("Paul King", "fragonib") __author_mail__ = ("", "fragonib[AT]yahoo[DOT]es") - HOSTER_DOMAIN = "bitshare.com" + HOSTER_NAME = "bitshare.com" OFFLINE_PATTERN = r'(>We are sorry, but the requested file was not found in our database|>Error - File not available<|The file was deleted either by the uploader, inactivity or due to copyright claim)' FILE_INFO_PATTERN = r'Downloading (?P<N>.+) - (?P<S>[\d.]+) (?P<U>\w+)</h1>' FILE_AJAXID_PATTERN = r'var ajaxdl = "(.*?)";' - CAPTCHA_KEY_PATTERN = r"http://api\.recaptcha\.net/challenge\?k=(.*?) " - TRAFFIC_USED_UP = r"Your Traffic is used up for today. Upgrade to premium to continue!" + CAPTCHA_KEY_PATTERN = r'http://api\.recaptcha\.net/challenge\?k=(.*?) ' + TRAFFIC_USED_UP = r'Your Traffic is used up for today. Upgrade to premium to continue!' def setup(self): - self.req.cj.setCookie(self.HOSTER_DOMAIN, "language_selection", "EN") + self.req.cj.setCookie(self.HOSTER_NAME, "language_selection", "EN") self.multiDL = self.premium self.chunkLimit = 1 diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index fa84b7732..406b7bcd4 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -16,9 +16,12 @@ class CatShareNet(SimpleHoster): FILE_INFO_PATTERN = r'<h3 class="pull-left"[^>]+>(?P<N>.*)</h3>\s+<h3 class="pull-right"[^>]+>(?P<S>.*)</h3>' OFFLINE_PATTERN = r'Podany plik zosta' - SECONDS_PATTERN = 'var\s+count\s+=\s+(\d+);' + + SECONDS_PATTERN = r'var\s+count\s+=\s+(\d+);' + RECAPTCHA_KEY = "6Lfln9kSAAAAANZ9JtHSOgxUPB9qfDFeLUI_QMEy" + def handleFree(self): found = re.search(self.SECONDS_PATTERN, self.html) seconds = int(found.group(1)) diff --git a/module/plugins/hoster/CramitIn.py b/module/plugins/hoster/CramitIn.py index e882f5cea..79ed07e73 100644 --- a/module/plugins/hoster/CramitIn.py +++ b/module/plugins/hoster/CramitIn.py @@ -15,7 +15,7 @@ class CramitIn(XFileSharingPro): HOSTER_NAME = "cramit.in" FILE_INFO_PATTERN = r'<span class=t2>\s*(?P<N>.*?)</span>.*?<small>\s*\((?P<S>.*?)\)' - DIRECT_LINK_PATTERN = r'href="(http://cramit.in/file_download/.*?)"' + LINK_PATTERN = r'href="(http://cramit.in/file_download/.*?)"' def setup(self): self.resumeDownload = self.multiDL = self.premium diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index 3d7360769..286d5ca2f 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -18,7 +18,7 @@ class CrockoCom(SimpleHoster): FILE_NAME_PATTERN = r'<span class="fz24">Download:\s*<strong>(?P<N>.*)' FILE_SIZE_PATTERN = r'<span class="tip1"><span class="inner">(?P<S>[^<]+)</span></span>' OFFLINE_PATTERN = r"<h1>Sorry,<br />the page you're looking for <br />isn't here.</h1>|File not found" - DOWNLOAD_URL_PATTERN = r"window.location ='([^']+)';" + CAPTCHA_URL_PATTERN = re.compile(r"u='(/file_contents/captcha/\w+)';\s*w='(\d+)';") CAPTCHA_KEY_PATTERN = re.compile(r'Recaptcha.create\("([^"]+)"') @@ -27,6 +27,7 @@ class CrockoCom(SimpleHoster): FILE_NAME_REPLACEMENTS = [(r'<[^>]*>', '')] + def handleFree(self): if "You need Premium membership to download this file." in self.html: self.fail("You need Premium membership to download this file.") diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 5fab87157..ba43d8054 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -21,7 +21,7 @@ # http://czshare.com/5278880/random.bin import re -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.utils import parseFileSize @@ -40,6 +40,7 @@ class CzshareCom(SimpleHoster): FILE_SIZE_REPLACEMENTS = [(' ', '')] FILE_URL_REPLACEMENTS = [(r'http://[^/]*/download.php\?.*?id=(\w+).*', r'http://sdilej.cz/\1/x/')] + SH_CHECK_TRAFFIC = True FREE_URL_PATTERN = r'<a href="([^"]+)" class="page-download">[^>]*alt="([^"]+)" /></a>' @@ -49,6 +50,7 @@ class CzshareCom(SimpleHoster): MULTIDL_PATTERN = r"<p><font color='red'>Z[^<]*PROFI.</font></p>" USER_CREDIT_PATTERN = r'<div class="credit">\s*kredit: <strong>([0-9., ]+)([kKMG]i?B)</strong>\s*</div><!-- .credit -->' + def checkTrafficLeft(self): # check if user logged in found = re.search(self.USER_CREDIT_PATTERN, self.html) @@ -90,7 +92,7 @@ class CzshareCom(SimpleHoster): # get free url found = re.search(self.FREE_URL_PATTERN, self.html) if found is None: - raise PluginParseError('Free URL') + self.parseError('Free URL') parsed_url = "http://sdilej.cz" + found.group(1) self.logDebug("PARSED_URL:" + parsed_url) @@ -105,7 +107,7 @@ class CzshareCom(SimpleHoster): self.pyfile.size = int(inputs['size']) except Exception, e: self.logError(e) - raise PluginParseError('Form') + self.parseError('Form') # get and decrypt captcha captcha_url = 'http://sdilej.cz/captcha.php' @@ -129,7 +131,7 @@ class CzshareCom(SimpleHoster): self.logDebug("WAIT URL", self.req.lastEffectiveURL) found = re.search("free_wait.php\?server=(.*?)&(.*)", self.req.lastEffectiveURL) if not found: - raise PluginParseError('Download URL') + self.parseError('Download URL') url = "http://%s/download.php?%s" % (found.group(1), found.group(2)) diff --git a/module/plugins/hoster/DataHu.py b/module/plugins/hoster/DataHu.py index 74333d743..9a7af288b 100644 --- a/module/plugins/hoster/DataHu.py +++ b/module/plugins/hoster/DataHu.py @@ -33,13 +33,13 @@ class DataHu(SimpleHoster): FILE_INFO_PATTERN = ur'<title>(?P<N>.*) \((?P<S>[^)]+)\) let\xf6lt\xe9se</title>' OFFLINE_PATTERN = ur'Az adott f\xe1jl nem l\xe9tezik' - DIRECT_LINK_PATTERN = r'<div class="download_box_button"><a href="([^"]+)">' + LINK_PATTERN = r'<div class="download_box_button"><a href="([^"]+)">' def handleFree(self): self.resumeDownload = True self.html = self.load(self.pyfile.url, decode=True) - m = re.search(self.DIRECT_LINK_PATTERN, self.html) + m = re.search(self.LINK_PATTERN, self.html) if m: url = m.group(1) self.logDebug('Direct link: ' + url) diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index a5ff05f39..582312b29 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -17,7 +17,7 @@ @author: zoidberg """ -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DataportCz(SimpleHoster): @@ -32,11 +32,13 @@ class DataportCz(SimpleHoster): FILE_NAME_PATTERN = r'<span itemprop="name">(?P<N>[^<]+)</span>' FILE_SIZE_PATTERN = r'<td class="fil">Velikost</td>\s*<td>(?P<S>[^<]+)</td>' OFFLINE_PATTERN = r'<h2>Soubor nebyl nalezen</h2>' + FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.dataport.cz/file/\1')] CAPTCHA_URL_PATTERN = r'<section id="captcha_bg">\s*<img src="(.*?)"' FREE_SLOTS_PATTERN = ur'Počet volných slotů: <span class="darkblue">(\d+)</span><br />' + def handleFree(self): captchas = {"1": "jkeG", "2": "hMJQ", "3": "vmEK", "4": "ePQM", "5": "blBd"} @@ -44,19 +46,19 @@ class DataportCz(SimpleHoster): action, inputs = self.parseHtmlForm('free_download_form') self.logDebug(action, inputs) if not action or not inputs: - raise PluginParseError('free_download_form') + self.parseError('free_download_form') if "captchaId" in inputs and inputs["captchaId"] in captchas: inputs['captchaCode'] = captchas[inputs["captchaId"]] else: - raise PluginParseError('captcha') + self.parseError('captcha') self.html = self.download("http://www.dataport.cz%s" % action, post=inputs) check = self.checkDownload({"captcha": 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");', "slot": 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'}) if check == "captcha": - raise PluginParseError('invalid captcha') + self.parseError('invalid captcha') elif check == "slot": self.logDebug("No free slots - wait 60s and retry") self.wait(60, False) diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 7b9713861..9089aecff 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -23,7 +23,7 @@ class DepositfilesCom(SimpleHoster): (r'.*<b title="(?P<N>[^"]+).*', "\g<N>")] RECAPTCHA_PATTERN = r"Recaptcha.create\('([^']+)'" - DOWNLOAD_LINK_PATTERN = r'<form id="downloader_file_form" action="(http://.+?\.(dfiles\.eu|depositfiles\.com)/.+?)" method="post"' + LINK_PATTERN = r'<form id="downloader_file_form" action="(http://.+?\.(dfiles\.eu|depositfiles\.com)/.+?)" method="post"' def handleFree(self): self.html = self.load(self.pyfile.url, post={"gateway_result": "1"}, cookies=True) @@ -79,7 +79,7 @@ class DepositfilesCom(SimpleHoster): self.logDebug(params) continue - found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if found: if 'response' in params: self.correctCaptcha() diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py index 566c71932..5bbf48e9a 100644 --- a/module/plugins/hoster/DlFreeFr.py +++ b/module/plugins/hoster/DlFreeFr.py @@ -112,10 +112,10 @@ class DlFreeFr(SimpleHoster): __author_name__ = ("the-razer", "zoidberg", "Toilal") __author_mail__ = ("daniel_ AT gmx DOT net", "zoidberg@mujmail.cz", "toilal.dev@gmail.com") - FILE_NAME_PATTERN = r"Fichier:</td>\s*<td[^>]*>(?P<N>[^>]*)</td>" - FILE_SIZE_PATTERN = r"Taille:</td>\s*<td[^>]*>(?P<S>[\d.]+[KMG])o" + FILE_NAME_PATTERN = r'Fichier:</td>\s*<td[^>]*>(?P<N>[^>]*)</td>' + FILE_SIZE_PATTERN = r'Taille:</td>\s*<td[^>]*>(?P<S>[\d.]+[KMG])o' OFFLINE_PATTERN = r"Erreur 404 - Document non trouv|Fichier inexistant|Le fichier demandé n'a pas été trouvé" - #FILE_URL_PATTERN = r'href="(?P<url>http://.*?)">Télécharger ce fichier' + def setup(self): self.multiDL = self.resumeDownload = True diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py index 43f823404..9926c80f0 100644 --- a/module/plugins/hoster/EasybytezCom.py +++ b/module/plugins/hoster/EasybytezCom.py @@ -34,9 +34,8 @@ class EasybytezCom(XFileSharingPro): FILE_INFO_PATTERN = r'<span class="name">(?P<N>.+)</span><br>\s*<span class="size">(?P<S>[^<]+)</span>' OFFLINE_PATTERN = r'<h1>File not available</h1>' - DIRECT_LINK_PATTERN = r'(http://(\w+\.(easyload|easybytez|zingload)\.(com|to)|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)' - OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)' - OVR_KILL_LINK_PATTERN = r'<h2>Delete Link</h2>\s*<textarea[^>]*>([^<]+)' + LINK_PATTERN = r'(http://(\w+\.(easyload|easybytez|zingload)\.(com|to)|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)' + OVR_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)' ERROR_PATTERN = r'(?:class=["\']err["\'][^>]*>|<Center><b>)(.*?)</' def setup(self): diff --git a/module/plugins/hoster/EdiskCz.py b/module/plugins/hoster/EdiskCz.py index e01c1130f..ae0d1c80f 100644 --- a/module/plugins/hoster/EdiskCz.py +++ b/module/plugins/hoster/EdiskCz.py @@ -30,12 +30,13 @@ class EdiskCz(SimpleHoster): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - URL_PATTERN = r'<form name = "formular" action = "([^"]+)" method = "post">' FILE_INFO_PATTERN = r'<span class="fl" title="(?P<N>[^"]+)">\s*.*?\((?P<S>[0-9.]*) (?P<U>[kKMG])i?B\)</h1></span>' - ACTION_PATTERN = r'/en/download/(\d+/.*\.html)' - DLLINK_PATTERN = r'http://.*edisk.cz.*\.html' OFFLINE_PATTERN = r'<h3>This file does not exist due to one of the following:</h3><ul><li>' + ACTION_PATTERN = r'/en/download/(\d+/.*\.html)' + LINK_PATTERN = r'http://.*edisk.cz.*\.html' + + def setup(self): self.multiDL = False @@ -58,7 +59,7 @@ class EdiskCz(SimpleHoster): "action": action }) - if not re.match(self.DLLINK_PATTERN, url): + if not re.match(self.LINK_PATTERN, url): self.fail("Unexpected server response") self.download(url) diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 000a89901..2a7c3c508 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -35,8 +35,9 @@ class EgoFilesCom(SimpleHoster): FILE_INFO_PATTERN = r'<div class="down-file">\s+(?P<N>[^\t]+)\s+<div class="file-properties">\s+(File size|Rozmiar): (?P<S>[\w.]+) (?P<U>\w+) \|' OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB' WAIT_TIME_PATTERN = r'For next free download you have to wait <strong>((?P<m>\d*)m)? ?((?P<s>\d+)s)?</strong>' - DIRECT_LINK_PATTERN = r'<a href="(?P<link>[^"]+)">Download ></a>' - RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX' + LINK_PATTERN = r'<a href="(?P<link>[^"]+)">Download ></a>' + RECAPTCHA_KEY = "6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX" + def setup(self): # Set English language @@ -58,14 +59,14 @@ class EgoFilesCom(SimpleHoster): waittime = int(m['m']) * 60 + int(m['s']) self.wait(waittime, True) - downloadURL = '' + downloadURL = r'' recaptcha = ReCaptcha(self) for _ in xrange(5): challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response} self.html = self.load(self.pyfile.url, post=post_data, decode=True) - m = re.search(self.DIRECT_LINK_PATTERN, self.html) + m = re.search(self.LINK_PATTERN, self.html) if not m: self.logInfo('Wrong captcha') self.invalidCaptcha() diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py index dcfddb367..4ecd97533 100644 --- a/module/plugins/hoster/EuroshareEu.py +++ b/module/plugins/hoster/EuroshareEu.py @@ -39,6 +39,7 @@ class EuroshareEu(SimpleHoster): FILE_URL_REPLACEMENTS = [(r"(http://[^/]*\.)(sk|cz|hu|pl)/", r"\1eu/")] + def setup(self): self.multiDL = self.resumeDownload = self.premium self.req.setOption("timeout", 120) diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index c2b5098e9..874eeb824 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -36,9 +36,9 @@ class ExtabitCom(SimpleHoster): FILE_NAME_PATTERN = r'<th>File:</th>\s*<td class="col-fileinfo">\s*<div title="(?P<N>[^"]+)">' FILE_SIZE_PATTERN = r'<th>Size:</th>\s*<td class="col-fileinfo">(?P<S>[^<]+)</td>' OFFLINE_PATTERN = r'>File not found<' - TEMP_OFFLINE_PATTERN = r">(File is temporary unavailable|No download mirror)<" + TEMP_OFFLINE_PATTERN = r'>(File is temporary unavailable|No download mirror)<' - DOWNLOAD_LINK_PATTERN = r'[\'"](http://guest\d+\.extabit\.com/[a-z0-9]+/.*?)[\'"]' + LINK_PATTERN = r'[\'"](http://guest\d+\.extabit\.com/[a-z0-9]+/.*?)[\'"]' def handleFree(self): if r">Only premium users can download this file" in self.html: @@ -78,7 +78,7 @@ class ExtabitCom(SimpleHoster): self.parseError('JSON') self.html = self.load("http://extabit.com/file/%s%s" % (fileID, response['href'])) - m = re.search(self.DOWNLOAD_LINK_PATTERN, self.html) + m = re.search(self.LINK_PATTERN, self.html) if not m: self.parseError('Download URL') url = m.group(1) diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index 996dea2f5..c7008ccd0 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -35,14 +35,16 @@ class FastshareCz(SimpleHoster): __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it", "vuolter@gmail.com") FILE_INFO_PATTERN = r'<h1 class="dwp">(?P<N>[^<]+)</h1>\s*<div class="fileinfo">\s*Size\s*: (?P<S>\d+) (?P<U>\w+),' - OFFLINE_PATTERN = '>(The file has been deleted|Requested page not found)' + OFFLINE_PATTERN = r'>(The file has been deleted|Requested page not found)' FILE_URL_REPLACEMENTS = [("#.*", "")] + SH_COOKIES = [(".fastshare.cz", "lang", "en")] FREE_URL_PATTERN = r'action=(/free/.*?)>\s*<img src="([^"]*)"><br' PREMIUM_URL_PATTERN = r'(http://data\d+\.fastshare\.cz/download\.php\?id=\d+&)' - CREDIT_PATTERN = " credit for " + CREDIT_PATTERN = r' credit for ' + def handleFree(self): if "> 100% of FREE slots are full" in self.html: diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index 9e06972e2..da63316ad 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -26,7 +26,7 @@ class File4safeCom(XFileSharingPro): self.req.http.c.setopt(FOLLOWLOCATION, 1) found = re.search(r"Location\s*:\s*(.*)", self.header, re.I) - if found and re.match(self.DIRECT_LINK_PATTERN, found.group(1)): + if found and re.match(self.LINK_PATTERN, found.group(1)): location = found.group(1).strip() self.startDownload(location) else: diff --git a/module/plugins/hoster/FileParadoxIn.py b/module/plugins/hoster/FileParadoxIn.py index b3b89575e..6234c36df 100644 --- a/module/plugins/hoster/FileParadoxIn.py +++ b/module/plugins/hoster/FileParadoxIn.py @@ -17,7 +17,7 @@ class FileParadoxIn(XFileSharingPro): HOSTER_NAME = "fileparadox.in" FILE_SIZE_PATTERN = r'</font>\s*\(\s*(?P<S>[^)]+)\s*\)</font>' - DIRECT_LINK_PATTERN = r'(http://([^/]*?fileparadox.in|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\w+/\w+/)[^"\'<]+)' + LINK_PATTERN = r'(http://([^/]*?fileparadox.in|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\w+/\w+/)[^"\'<]+)' getInfo = create_getInfo(FileParadoxIn) diff --git a/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py index 4977742af..5b9d86007 100644 --- a/module/plugins/hoster/FilecloudIo.py +++ b/module/plugins/hoster/FilecloudIo.py @@ -18,7 +18,7 @@ """ import re -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.common.json_layer import json_loads from module.plugins.internal.CaptchaService import ReCaptcha @@ -39,10 +39,11 @@ class FilecloudIo(SimpleHoster): UKEY_PATTERN = r"'ukey'\s*:'(\w+)'," AB1_PATTERN = r"if\( __ab1 == '(\w+)' \)" - ERROR_MSG_PATTERN = r"var __error_msg\s*=\s*l10n\.(.*?);" - DOWNLOAD_LINK_PATTERN = r'"(http://s\d+.filecloud.io/%s/\d+/.*?)"' + ERROR_MSG_PATTERN = r'var __error_msg\s*=\s*l10n\.(.*?);' + LINK_PATTERN = r'"(http://s\d+.filecloud.io/%s/\d+/.*?)"' RECAPTCHA_KEY_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" - RECAPTCHA_KEY = '6Lf5OdISAAAAAEZObLcx5Wlv4daMaASRov1ysDB1' + RECAPTCHA_KEY = "6Lf5OdISAAAAAEZObLcx5Wlv4daMaASRov1ysDB1" + def setup(self): self.resumeDownload = self.multiDL = True @@ -53,7 +54,7 @@ class FilecloudIo(SimpleHoster): found = re.search(self.AB1_PATTERN, self.html) if not found: - raise PluginParseError("__AB1") + self.parseError("__AB1") data["__ab1"] = found.group(1) if not self.account: @@ -99,9 +100,9 @@ class FilecloudIo(SimpleHoster): if response["dl"]: self.html = self.load('http://filecloud.io/download.html') - found = re.search(self.DOWNLOAD_LINK_PATTERN % self.file_info['ID'], self.html) + found = re.search(self.LINK_PATTERN % self.file_info['ID'], self.html) if not found: - raise PluginParseError("Download URL") + self.parseError("Download URL") download_url = found.group(1) self.logDebug("Download URL: %s" % download_url) diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index d6a15b0ea..bcef5a5db 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -41,7 +41,7 @@ class FilefactoryCom(SimpleHoster): __author_mail__ = "l.stickell@yahoo.it" FILE_INFO_PATTERN = r'<div id="file_name"[^>]*>\s*<h2>(?P<N>[^<]+)</h2>\s*<div id="file_info">\s*(?P<S>[\d.]+) (?P<U>\w+) uploaded' - DIRECT_LINK_PATTERN = r'<a href="(https?://[^"]+)"[^>]*><i[^>]*></i> Download with FileFactory Premium</a>' + LINK_PATTERN = r'<a href="(https?://[^"]+)"[^>]*><i[^>]*></i> Download with FileFactory Premium</a>' OFFLINE_PATTERN = r'<h2>File Removed</h2>|This file is no longer available' PREMIUM_ONLY_PATTERN = r'>Premium Account Required<' SH_COOKIES = [('.filefactory.com', 'locale', 'en_US.utf8')] @@ -106,7 +106,7 @@ class FilefactoryCom(SimpleHoster): else: self.logInfo('You could enable "Direct Downloads" on http://filefactory.com/account/') html = self.load(self.pyfile.url) - found = re.search(self.DIRECT_LINK_PATTERN, html) + found = re.search(self.LINK_PATTERN, html) if found: url = found.group(1) else: diff --git a/module/plugins/hoster/FileomCom.py b/module/plugins/hoster/FileomCom.py index 9fda2353c..70975e6d9 100644 --- a/module/plugins/hoster/FileomCom.py +++ b/module/plugins/hoster/FileomCom.py @@ -41,7 +41,7 @@ class FileomCom(XFileSharingPro): ERROR_PATTERN = r'class=["\']err["\'][^>]*>(.*?)(?:\'|</)' - DIRECT_LINK_PATTERN = r"var url2 = '(.+?)';" + LINK_PATTERN = r"var url2 = '(.+?)';" def setup(self): self.resumeDownload = self.premium diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 9a2bbafbf..72396fac6 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -37,8 +37,9 @@ class FilerNet(SimpleHoster): FILE_INFO_PATTERN = r'<h1 class="page-header">Free Download (?P<N>\S+) <small>(?P<S>[\w.]+) (?P<U>\w+)</small></h1>' OFFLINE_PATTERN = r'Nicht gefunden' - RECAPTCHA_KEY = '6LcFctISAAAAAAgaeHgyqhNecGJJRnxV1m_vAz3V' - DIRECT_LINK_PATTERN = r'href="([^"]+)">Get download</a>' + RECAPTCHA_KEY = "6LcFctISAAAAAAgaeHgyqhNecGJJRnxV1m_vAz3V" + LINK_PATTERN = r'href="([^"]+)">Get download</a>' + def process(self, pyfile): if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()): @@ -74,7 +75,7 @@ class FilerNet(SimpleHoster): hash_data = inputs['hash'] self.logDebug('Hash: ' + hash_data) - downloadURL = '' + downloadURL = r'' recaptcha = ReCaptcha(self) for _ in xrange(5): challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) @@ -107,7 +108,7 @@ class FilerNet(SimpleHoster): dl = self.pyfile.url else: # Direct Download OFF html = self.load(self.pyfile.url) - m = re.search(self.DIRECT_LINK_PATTERN, html) + m = re.search(self.LINK_PATTERN, html) if not m: self.parseError("Unable to detect direct link, try to enable 'Direct download' in your user settings") dl = 'http://filer.net' + m.group(1) diff --git a/module/plugins/hoster/FilerioCom.py b/module/plugins/hoster/FilerioCom.py index 1c6c375f6..72c8c6c1c 100644 --- a/module/plugins/hoster/FilerioCom.py +++ b/module/plugins/hoster/FilerioCom.py @@ -14,7 +14,7 @@ class FilerioCom(XFileSharingPro): HOSTER_NAME = "filerio.in" - OFFLINE_PATTERN = '<b>"File Not Found"</b>|File has been removed due to Copyright Claim' + OFFLINE_PATTERN = r'<b>"File Not Found"</b>|File has been removed due to Copyright Claim' FILE_URL_REPLACEMENTS = [(r'http://.*?/', 'http://filerio.in/')] def setup(self): diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index f6e102f08..ebb6204c3 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -62,9 +62,9 @@ class FileserveCom(Hoster): CAPTCHA_KEY_PATTERN = r"var reCAPTCHA_publickey='(?P<key>[^']+)'" LONG_WAIT_PATTERN = r'<li class="title">You need to wait (\d+) (\w+) to start another download\.</li>' - LINK_EXPIRED_PATTERN = "Your download link has expired" - DAILY_LIMIT_PATTERN = "Your daily download limit has been reached" - NOT_LOGGED_IN_PATTERN = '<form (name="loginDialogBoxForm"|id="login_form")|<li><a href="/login.php">Login</a></li>' + LINK_EXPIRED_PATTERN = r'Your download link has expired' + DAILY_LIMIT_PATTERN = r'Your daily download limit has been reached' + NOT_LOGGED_IN_PATTERN = r'<form (name="loginDialogBoxForm"|id="login_form")|<li><a href="/login.php">Login</a></li>' # shares code with FilejungleCom and UploadstationCom diff --git a/module/plugins/hoster/FileshareInUa.py b/module/plugins/hoster/FileshareInUa.py index db2b1a998..4ec33485e 100644 --- a/module/plugins/hoster/FileshareInUa.py +++ b/module/plugins/hoster/FileshareInUa.py @@ -17,7 +17,7 @@ class FileshareInUa(Hoster): PATTERN_FILENAME = r'<h3 class="b-filename">(.*?)</h3>' PATTERN_FILESIZE = r'<b class="b-filesize">(.*?)</b>' - PATTERN_OFFLINE = "This file doesn't exist, or has been removed." + PATTERN_OFFLINE = r"This file doesn't exist, or has been removed." def setup(self): self.resumeDownload = self.multiDL = True diff --git a/module/plugins/hoster/FilezyNet.py b/module/plugins/hoster/FilezyNet.py index cd0902ab3..c9d603939 100644 --- a/module/plugins/hoster/FilezyNet.py +++ b/module/plugins/hoster/FilezyNet.py @@ -29,7 +29,7 @@ class FilezyNet(XFileSharingPro): obfuscated_js = re.search(self.DOWNLOAD_JS_PATTERN, self.html) dl_file_now = self.js.eval(obfuscated_js.group(1)) - link = re.search(self.DIRECT_LINK_PATTERN, dl_file_now) + link = re.search(self.LINK_PATTERN, dl_file_now) return link.group(1) diff --git a/module/plugins/hoster/FourSharedCom.py b/module/plugins/hoster/FourSharedCom.py index 9b8b3b1f0..93d784d63 100644 --- a/module/plugins/hoster/FourSharedCom.py +++ b/module/plugins/hoster/FourSharedCom.py @@ -15,14 +15,16 @@ class FourSharedCom(SimpleHoster): __author_mail__ = ("jeix@hasnomail.de", "zoidberg@mujmail.cz") FILE_NAME_PATTERN = r'<meta name="title" content="(?P<N>.+?)"' - FILE_SIZE_PATTERN = '<span title="Size: (?P<S>[0-9,.]+) (?P<U>[kKMG])i?B">' - OFFLINE_PATTERN = 'The file link that you requested is not valid\.|This file was deleted.' + FILE_SIZE_PATTERN = r'<span title="Size: (?P<S>[0-9,.]+) (?P<U>[kKMG])i?B">' + OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted.' + FILE_NAME_REPLACEMENTS = [(r"&#(\d+).", lambda m: unichr(int(m.group(1))))] FILE_SIZE_REPLACEMENTS = [(",", "")] - DOWNLOAD_BUTTON_PATTERN = 'id="btnLink" href="(.*?)"' - FID_PATTERN = 'name="d3fid" value="(.*?)"' DOWNLOAD_URL_PATTERN = r'name="d3link" value="(.*?)"' + DOWNLOAD_BUTTON_PATTERN = r'id="btnLink" href="(.*?)"' + FID_PATTERN = r'name="d3fid" value="(.*?)"' + def handleFree(self): if not self.account: diff --git a/module/plugins/hoster/FreevideoCz.py b/module/plugins/hoster/FreevideoCz.py index 21948a83d..175d317be 100644 --- a/module/plugins/hoster/FreevideoCz.py +++ b/module/plugins/hoster/FreevideoCz.py @@ -45,9 +45,11 @@ class FreevideoCz(Hoster): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - URL_PATTERN = r'clip: {\s*url: "([^"]+)"' OFFLINE_PATTERN = r'<h2 class="red-corner-full">Str.nka nebyla nalezena</h2>' + LINK_PATTERN = r'clip: {\s*url: "([^"]+)"' + + def setup(self): self.multiDL = self.resumeDownload = True @@ -58,7 +60,7 @@ class FreevideoCz(Hoster): if re.search(self.OFFLINE_PATTERN, self.html): self.offline() - found = re.search(self.URL_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if found is None: self.fail("Parse error (URL)") download_url = found.group(1) diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 63cc69161..75b37b4c3 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -34,11 +34,13 @@ class FshareVn(SimpleHoster): FILE_INFO_PATTERN = r'<p>(?P<N>[^<]+)<\\/p>[\\trn\s]*<p>(?P<S>[0-9,.]+)\s*(?P<U>[kKMG])i?B<\\/p>' OFFLINE_PATTERN = r'<div class=\\"f_left file_w\\"|<\\/p>\\t\\t\\t\\t\\r\\n\\t\\t<p><\\/p>\\t\\t\\r\\n\\t\\t<p>0 KB<\\/p>' + FILE_NAME_REPLACEMENTS = [("(.*)", doubleDecode)] - DOWNLOAD_URL_PATTERN = r'action="(http://download.*?)[#"]' - VIP_URL_PATTERN = r'<form action="([^>]+)" method="get" name="frm_download">' + + LINK_PATTERN = r'action="(http://download.*?)[#"]' WAIT_PATTERN = ur'Lượt tải xuống kế tiếp là:\s*(.*?)\s*<' + def process(self, pyfile): self.html = self.load('http://www.fshare.vn/check_link.php', post={ "action": "check_link", @@ -79,7 +81,7 @@ class FshareVn(SimpleHoster): found = re.search(r'var count = (\d+)', self.html) self.setWait(int(found.group(1)) if found else 30) - found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if not found: self.parseError('FREE DL URL') self.url = found.group(1) diff --git a/module/plugins/hoster/GamefrontCom.py b/module/plugins/hoster/GamefrontCom.py index 0cd54d2ea..941aa2d50 100644 --- a/module/plugins/hoster/GamefrontCom.py +++ b/module/plugins/hoster/GamefrontCom.py @@ -17,7 +17,7 @@ class GamefrontCom(Hoster): PATTERN_FILENAME = r'<title>(.*?) | Game Front' PATTERN_FILESIZE = r'<dt>File Size:</dt>[\n\s]*<dd>(.*?)</dd>' - PATTERN_OFFLINE = "This file doesn't exist, or has been removed." + PATTERN_OFFLINE = r"This file doesn't exist, or has been removed." def setup(self): self.resumeDownload = self.multiDL = True diff --git a/module/plugins/hoster/IFileWs.py b/module/plugins/hoster/IFileWs.py index 6f7fe8388..35b3544a1 100644 --- a/module/plugins/hoster/IFileWs.py +++ b/module/plugins/hoster/IFileWs.py @@ -14,9 +14,8 @@ class IFileWs(XFileSharingPro): HOSTER_NAME = "ifile.ws" - FILE_INFO_PATTERN = '<h1\s+style="display:inline;">(?P<N>[^<]+)</h1>\s+\[(?P<S>[^]]+)\]' - OFFLINE_PATTERN = 'File Not Found|The file was removed by administrator' - LONG_WAIT_PATTERN = "(?P<M>\d(?=\s+minutes)).*(?P<S>\d+(?=\s+seconds))" + FILE_INFO_PATTERN = r'<h1\s+style="display:inline;">(?P<N>[^<]+)</h1>\s+\[(?P<S>[^]]+)\]' + OFFLINE_PATTERN = r'File Not Found|The file was removed by administrator' getInfo = create_getInfo(IFileWs) diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 64dac7d13..41c0cd5cc 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -33,8 +33,8 @@ class IfileIt(SimpleHoster): __author_mail__ = "zoidberg@mujmail.cz" #EVAL_PATTERN = r'(eval\(function\(p,a,c,k,e,d\).*)' - #DEC_PATTERN = r"requestBtn_clickEvent[^}]*url:\s*([^,]+)" - DOWNLOAD_LINK_PATTERN = r'</span> If it doesn\'t, <a target="_blank" href="([^"]+)">' + #DEC_PATTERN = r'requestBtn_clickEvent[^}]*url:\s*([^,]+)' + LINK_PATTERN = r'</span> If it doesn\'t, <a target="_blank" href="([^"]+)">' RECAPTCHA_KEY_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" FILE_INFO_PATTERN = r'<span style="cursor: default;[^>]*>\s*(?P<N>.*?)\s* \s*<strong>\s*(?P<S>[0-9.]+)\s*(?P<U>[kKMG])i?B\s*</strong>\s*</span>' OFFLINE_PATTERN = r'<span style="cursor: default;[^>]*>\s* \s*<strong>\s*</strong>\s*</span>' diff --git a/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py index ca38ca418..b5c0e7c62 100644 --- a/module/plugins/hoster/IfolderRu.py +++ b/module/plugins/hoster/IfolderRu.py @@ -38,7 +38,7 @@ class IfolderRu(SimpleHoster): SESSION_ID_PATTERN = r'<a href=(http://ints.(?:rusfolder.com|ifolder.ru)/ints/sponsor/\?bi=\d*&session=([^&]+)&u=[^>]+)>' INTS_SESSION_PATTERN = r'\(\'ints_session\'\);\s*if\(tag\)\{tag.value = "([^"]+)";\}' HIDDEN_INPUT_PATTERN = r"var v = .*?name='([^']+)' value='1'" - DOWNLOAD_LINK_PATTERN = r'<a id="download_file_href" href="([^"]+)"' + LINK_PATTERN = r'<a id="download_file_href" href="([^"]+)"' WRONG_CAPTCHA_PATTERN = ur'<font color=Red>неверный код,<br>введите еще раз</font><br>' def setup(self): @@ -79,7 +79,7 @@ class IfolderRu(SimpleHoster): else: self.fail("Invalid captcha") - download_url = re.search(self.DOWNLOAD_LINK_PATTERN, self.html).group(1) + download_url = re.search(self.LINK_PATTERN, self.html).group(1) self.correctCaptcha() self.logDebug("Download URL: %s" % download_url) self.download(download_url) diff --git a/module/plugins/hoster/JumbofilesCom.py b/module/plugins/hoster/JumbofilesCom.py index 55d179b4e..ad648dacf 100644 --- a/module/plugins/hoster/JumbofilesCom.py +++ b/module/plugins/hoster/JumbofilesCom.py @@ -13,9 +13,9 @@ class JumbofilesCom(SimpleHoster): __author_name__ = "godofdream" __author_mail__ = "soilfiction@gmail.com" - FILE_INFO_PATTERN = '<TR><TD>(?P<N>[^<]+?)\s*<small>\((?P<S>[\d.]+)\s*(?P<U>[KMG][bB])\)</small></TD></TR>' - OFFLINE_PATTERN = 'Not Found or Deleted / Disabled due to inactivity or DMCA' - DIRECT_LINK_PATTERN = '<meta http-equiv="refresh" content="10;url=(.+)">' + FILE_INFO_PATTERN = r'<TR><TD>(?P<N>[^<]+?)\s*<small>\((?P<S>[\d.]+)\s*(?P<U>[KMG][bB])\)</small></TD></TR>' + OFFLINE_PATTERN = r'Not Found or Deleted / Disabled due to inactivity or DMCA' + LINK_PATTERN = r'<meta http-equiv="refresh" content="10;url=(.+)">' def setup(self): self.resumeDownload = self.multiDL = True @@ -24,7 +24,7 @@ class JumbofilesCom(SimpleHoster): ukey = re.match(self.__pattern__, self.pyfile.url).group(1) post_data = {"id": ukey, "op": "download3", "rand": ""} html = self.load(self.pyfile.url, post=post_data, decode=True) - url = re.search(self.DIRECT_LINK_PATTERN, html).group(1) + url = re.search(self.LINK_PATTERN, html).group(1) self.logDebug("Download " + url) self.download(url) diff --git a/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py index e9f294087..74dc05b89 100644 --- a/module/plugins/hoster/Keep2shareCC.py +++ b/module/plugins/hoster/Keep2shareCC.py @@ -37,11 +37,12 @@ class Keep2shareCC(SimpleHoster): FILE_SIZE_PATTERN = r'Size: (?P<S>[^<]+)</div>' OFFLINE_PATTERN = r'File not found or deleted|Sorry, this file is blocked or deleted|Error 404' - DIRECT_LINK_PATTERN = r'To download this file with slow speed, use <a href="([^"]+)">this link</a>' + LINK_PATTERN = r'To download this file with slow speed, use <a href="([^"]+)">this link</a>' WAIT_PATTERN = r'Please wait ([\d:]+) to download this file' ALREADY_DOWNLOADING_PATTERN = r'Free account does not allow to download more than one file at the same time' - RECAPTCHA_KEY = '6LcYcN0SAAAAABtMlxKj7X0hRxOY8_2U86kI1vbb' + RECAPTCHA_KEY = "6LcYcN0SAAAAABtMlxKj7X0hRxOY8_2U86kI1vbb" + def handleFree(self): self.sanitize_url() @@ -76,7 +77,7 @@ class Keep2shareCC(SimpleHoster): self.wait(30 * 60, reconnect=True) self.retry() - m = re.search(self.DIRECT_LINK_PATTERN, self.html) + m = re.search(self.LINK_PATTERN, self.html) if not m: self.parseError("Unable to detect direct link") self.startDownload(m.group(1)) diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index 62743d468..3814cfd9b 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -56,14 +56,16 @@ class LetitbitNet(SimpleHoster): __author_name__ = ("zoidberg", "z00nx") __author_mail__ = ("zoidberg@mujmail.cz", "z00nx0@gmail.com") - CHECK_URL_PATTERN = r"ajax_check_url\s*=\s*'((http://[^/]+)[^']+)';" - SECONDS_PATTERN = r"seconds\s*=\s*(\d+);" - CAPTCHA_CONTROL_FIELD = r"recaptcha_control_field\s=\s'(?P<value>[^']+)'" - - DOMAIN = "http://letitbit.net" FILE_URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "letitbit.net")] + + HOSTER_NAME = "letitbit.net" + + #CHECK_URL_PATTERN = r"ajax_check_url\s*=\s*'((http://[^/]+)[^']+)';" + SECONDS_PATTERN = r'seconds\s*=\s*(\d+);' + CAPTCHA_CONTROL_FIELD = r"recaptcha_control_field\s=\s'(?P<value>[^']+)'" RECAPTCHA_KEY = "6Lc9zdMSAAAAAF-7s2wuQ-036pLRbM0p8dDaQdAM" + def setup(self): self.resumeDownload = True #TODO confirm that resume works @@ -81,11 +83,13 @@ class LetitbitNet(SimpleHoster): action, inputs = self.parseHtmlForm('id="ifree_form"') if not action: self.parseError("page 1 / ifree_form") + + domain = "http://www." + self.HOSTER_NAME self.pyfile.size = float(inputs['sssize']) self.logDebug(action, inputs) inputs['desc'] = "" - self.html = self.load(self.DOMAIN + action, post=inputs, cookies=True) + self.html = self.load(domain + action, post=inputs, cookies=True) # action, inputs = self.parseHtmlForm('id="d3_form"') # if not action: self.parseError("page 2 / d3_form") @@ -110,7 +114,7 @@ class LetitbitNet(SimpleHoster): self.logDebug("ReCaptcha control field found", recaptcha_control_field) self.wait(seconds + 1) - response = self.load("%s/ajax/download3.php" % self.DOMAIN, post=" ", cookies=True) + response = self.load("%s/ajax/download3.php" % domain, post=" ", cookies=True) if response != '1': self.parseError('Unknown response - ajax_check_url') self.logDebug(response) @@ -120,7 +124,7 @@ class LetitbitNet(SimpleHoster): post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": response, "recaptcha_control_field": recaptcha_control_field} self.logDebug("Post data to send", post_data) - response = self.load('%s/ajax/check_recaptcha.php' % self.DOMAIN, post=post_data, cookies=True) + response = self.load('%s/ajax/check_recaptcha.php' % domain, post=post_data, cookies=True) self.logDebug(response) if not response: self.invalidCaptcha() diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index 5daf1b8e3..b5f0e4109 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -35,11 +35,13 @@ class LoadTo(SimpleHoster): FILE_INFO_PATTERN = r'<head><title>(?P<N>.+) \/\/ Load.to</title>' FILE_SIZE_PATTERN = r'<a [^>]+>(?P<Z>.+)</a></h3>\s*Size: (?P<S>.*) (?P<U>[kKmMgG]?i?[bB])' - URL_PATTERN = r'<form method="post" action="(.+?)"' - OFFLINE_PATTERN = r'Can\'t find file. Please check URL.' + OFFLINE_PATTERN = r'Can\'t find file\. Please check URL' + + LINK_PATTERN = r'<form method="post" action="(.+?)"' WAIT_PATTERN = r'type="submit" value="Download \((\d+)\)"' SOLVEMEDIA_PATTERN = r'http://api\.solvemedia\.com/papi/challenge\.noscript\?k=([^"]+)' + def setup(self): self.multiDL = True self.chunkLimit = 1 @@ -53,7 +55,7 @@ class LoadTo(SimpleHoster): self.offline() # Search for Download URL - m = re.search(self.URL_PATTERN, self.html) + m = re.search(self.LINK_PATTERN, self.html) if not m: self.parseError("Unable to detect download URL") @@ -72,7 +74,7 @@ class LoadTo(SimpleHoster): captcha_key = found.group(1) solvemedia = SolveMedia(self) captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) - self.download(download_url,post={"adcopy_challenge": captcha_challenge, "adcopy_response": captcha_response}) + self.download(download_url, post={"adcopy_challenge": captcha_challenge, "adcopy_response": captcha_response}) check = self.checkDownload({"404": re.compile("\A<h1>404 Not Found</h1>")}) if check == "404": self.logWarning("The captcha you entered was incorrect. Please try again.") diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index b5327d175..9479f583e 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -17,8 +17,9 @@ class LuckyShareNet(SimpleHoster): __author_mail__ = "l.stickell@yahoo.it" FILE_INFO_PATTERN = r"<h1 class='file_name'>(?P<N>\S+)</h1>\s*<span class='file_size'>Filesize: (?P<S>[\d.]+)(?P<U>\w+)</span>" - OFFLINE_PATTERN = 'There is no such file available' - RECAPTCHA_KEY = '6LdivsgSAAAAANWh-d7rPE1mus4yVWuSQIJKIYNw' + OFFLINE_PATTERN = r'There is no such file available' + RECAPTCHA_KEY = "6LdivsgSAAAAANWh-d7rPE1mus4yVWuSQIJKIYNw" + def parseJson(self, rep): if 'AJAX Error' in rep: diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index 60c7d7bb5..0348b9c6d 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -69,7 +69,7 @@ class MediafireCom(SimpleHoster): __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") - DOWNLOAD_LINK_PATTERN = r'<div class="download_link"[^>]*(?:z-index:(?P<zindex>\d+))?[^>]*>\s*<a href="(?P<href>http://[^"]+)"' + LINK_PATTERN = r'<div class="download_link"[^>]*(?:z-index:(?P<zindex>\d+))?[^>]*>\s*<a href="(?P<href>http://[^"]+)"' JS_KEY_PATTERN = r"DoShow\('mfpromo1'\);[^{]*{((\w+)='';.*?)eval\(\2\);" JS_ZMODULO_PATTERN = r"\('z-index'\)\) \% (\d+)\)\);" SOLVEMEDIA_PATTERN = r'http://api\.solvemedia\.com/papi/challenge\.noscript\?k=([^"]+)' @@ -115,7 +115,7 @@ class MediafireCom(SimpleHoster): else: self.fail("No or incorrect password") - found = re.search(r'kNO = "(http://.*?)";', self.html) + found = re.search(r'kNO = r"(http://.*?)";', self.html) if not found: self.parseError("Download URL") download_url = found.group(1) diff --git a/module/plugins/hoster/MegasharesCom.py b/module/plugins/hoster/MegasharesCom.py index 5168b177d..ac2752daa 100644 --- a/module/plugins/hoster/MegasharesCom.py +++ b/module/plugins/hoster/MegasharesCom.py @@ -31,16 +31,18 @@ class MegasharesCom(SimpleHoster): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - FILE_NAME_PATTERN = '<h1 class="black xxl"[^>]*title="(?P<N>[^"]+)">' - FILE_SIZE_PATTERN = '<strong><span class="black">Filesize:</span></strong> (?P<S>[0-9.]+) (?P<U>[kKMG])i?B<br />' - DOWNLOAD_URL_PATTERN = r'<div id="show_download_button_%d"[^>]*>\s*<a href="([^"]+)">' + FILE_NAME_PATTERN = r'<h1 class="black xxl"[^>]*title="(?P<N>[^"]+)">' + FILE_SIZE_PATTERN = r'<strong><span class="black">Filesize:</span></strong> (?P<S>[0-9.]+) (?P<U>[kKMG])i?B<br />' + OFFLINE_PATTERN = r'<dd class="red">(Invalid Link Request|Link has been deleted)' + + LINK_PATTERN = r'<div id="show_download_button_%d"[^>]*>\s*<a href="([^"]+)">' PASSPORT_LEFT_PATTERN = r'Your Download Passport is: <[^>]*>(\w+).*\s*You have\s*<[^>]*>\s*([0-9.]+) ([kKMG]i?B)' PASSPORT_RENEW_PATTERN = r'Your download passport will renew in\s*<strong>(\d+)</strong>:<strong>(\d+)</strong>:<strong>(\d+)</strong>' REACTIVATE_NUM_PATTERN = r'<input[^>]*id="random_num" value="(\d+)" />' REACTIVATE_PASSPORT_PATTERN = r'<input[^>]*id="passport_num" value="(\w+)" />' REQUEST_URI_PATTERN = r'var request_uri = "([^"]+)";' NO_SLOTS_PATTERN = r'<dd class="red">All download slots for this link are currently filled' - OFFLINE_PATTERN = r'<dd class="red">(Invalid Link Request|Link has been deleted)' + def setup(self): self.resumeDownload = True @@ -102,7 +104,7 @@ class MegasharesCom(SimpleHoster): def handleDownload(self, premium=False): # Find download link; - found = re.search(self.DOWNLOAD_URL_PATTERN % (1 if premium else 2), self.html) + found = re.search(self.LINK_PATTERN % (1 if premium else 2), self.html) msg = '%s download URL' % ('Premium' if premium else 'Free') if not found: self.parseError(msg) diff --git a/module/plugins/hoster/MovReelCom.py b/module/plugins/hoster/MovReelCom.py index 5d7bbe71b..f719982cb 100644 --- a/module/plugins/hoster/MovReelCom.py +++ b/module/plugins/hoster/MovReelCom.py @@ -16,12 +16,9 @@ class MovReelCom(XFileSharingPro): HOSTER_NAME = "movreel.com" - #FILE_NAME_PATTERN = r'<b>Filename:</b>(?P<N>.*?)<br>' - #FILE_SIZE_PATTERN = r'<b>Size:</b>(?P<S>.*?)<br>' FILE_INFO_PATTERN = r'<h3>(?P<N>.+?) <small><sup>(?P<S>[\d.]+) (?P<U>..)</sup> </small></h3>' OFFLINE_PATTERN = r'<b>File Not Found</b><br><br>' - DIRECT_LINK_PATTERN = r'<a href="(http://[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/.*)">Download Link</a>' - #OVR_DOWNLOAD_LINK_PATTERN = "var file_link = '(.*)';" + LINK_PATTERN = r'<a href="(http://[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/.*)">Download Link</a>' getInfo = create_getInfo(MovReelCom) diff --git a/module/plugins/hoster/NarodRu.py b/module/plugins/hoster/NarodRu.py index d47221444..68815cf7c 100644 --- a/module/plugins/hoster/NarodRu.py +++ b/module/plugins/hoster/NarodRu.py @@ -40,7 +40,7 @@ class NarodRu(SimpleHoster): (r"/start/[0-9]+\.\w+-narod\.yandex\.ru/([0-9]{6,15})/\w+/(\w+)", r"/disk/\1/\2")] CAPTCHA_PATTERN = r'<number url="(.*?)">(\w+)</number>' - DOWNLOAD_LINK_PATTERN = r'<a class="h-link" rel="yandex_bar" href="(.+?)">' + LINK_PATTERN = r'<a class="h-link" rel="yandex_bar" href="(.+?)">' def handleFree(self): for _ in xrange(5): @@ -53,7 +53,7 @@ class NarodRu(SimpleHoster): post_data['rep'] = self.decryptCaptcha(captcha_url) self.html = self.load(self.pyfile.url, post=post_data, decode=True) - found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if found: url = 'http://narod.ru' + found.group(1) self.correctCaptcha() diff --git a/module/plugins/hoster/NosuploadCom.py b/module/plugins/hoster/NosuploadCom.py index 1de734222..ff7628c46 100644 --- a/module/plugins/hoster/NosuploadCom.py +++ b/module/plugins/hoster/NosuploadCom.py @@ -17,7 +17,7 @@ class NosuploadCom(XFileSharingPro): HOSTER_NAME = "nosupload.com" FILE_SIZE_PATTERN = r'<p><strong>Size:</strong> (?P<S>[0-9\.]+) (?P<U>[kKMG]?B)</p>' - DIRECT_LINK_PATTERN = r'<a class="select" href="(http://.+?)">Download</a>' + LINK_PATTERN = r'<a class="select" href="(http://.+?)">Download</a>' WAIT_PATTERN = r'Please wait.*?>(\d+)</span>' def getDownloadLink(self): @@ -33,7 +33,7 @@ class NosuploadCom(XFileSharingPro): self.html = self.load(self.pyfile.url, post=data, ref=True, decode=True) # stage3: get the download link - return re.search(self.DIRECT_LINK_PATTERN, self.html, re.S).group(1) + return re.search(self.LINK_PATTERN, self.html, re.S).group(1) getInfo = create_getInfo(NosuploadCom) diff --git a/module/plugins/hoster/NovafileCom.py b/module/plugins/hoster/NovafileCom.py index c552c166c..9b4d50907 100644 --- a/module/plugins/hoster/NovafileCom.py +++ b/module/plugins/hoster/NovafileCom.py @@ -20,7 +20,7 @@ class NovafileCom(XFileSharingPro): FILE_SIZE_PATTERN = r'<div class="size">(?P<S>.+?)</div>' ERROR_PATTERN = r'class="alert[^"]*alert-separate"[^>]*>\s*(?:<p>)?(.*?)\s*</' - DIRECT_LINK_PATTERN = r'<a href="(http://s\d+\.novafile\.com/.*?)" class="btn btn-green">Download File</a>' + LINK_PATTERN = r'<a href="(http://s\d+\.novafile\.com/.*?)" class="btn btn-green">Download File</a>' WAIT_PATTERN = r'<p>Please wait <span id="count"[^>]*>(\d+)</span> seconds</p>' def setup(self): diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index 4619c035d..c6154c0e0 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -33,24 +33,26 @@ class NowDownloadEu(SimpleHoster): FILE_INFO_PATTERN = r'Downloading</span> <br> (?P<N>.*) (?P<S>[0-9,.]+) (?P<U>[kKMG])i?B </h4>' OFFLINE_PATTERN = r'(This file does not exist!)' - FILE_TOKEN_PATTERN = r'"(/api/token\.php\?token=[a-z0-9]+)"' - FILE_CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"' - FILE_WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' - FILE_DOWNLOAD_LINK = r'"(http://f\d+\.nowdownload\.ch/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"' + + TOKEN_PATTERN = r'"(/api/token\.php\?token=[a-z0-9]+)"' + CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"' + WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' + LINK_PATTERN = r'"(http://f\d+\.nowdownload\.ch/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"' FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<[^>]*>', '')] + def setup(self): self.multiDL = self.resumeDownload = True self.chunkLimit = -1 def handleFree(self): - tokenlink = re.search(self.FILE_TOKEN_PATTERN, self.html) - continuelink = re.search(self.FILE_CONTINUE_PATTERN, self.html) + tokenlink = re.search(self.TOKEN_PATTERN, self.html) + continuelink = re.search(self.CONTINUE_PATTERN, self.html) if not tokenlink or not continuelink: self.fail('Plugin out of Date') - found = re.search(self.FILE_WAIT_PATTERN, self.html) + found = re.search(self.WAIT_PATTERN, self.html) if found: wait = int(found.group(1)) else: @@ -62,7 +64,7 @@ class NowDownloadEu(SimpleHoster): self.html = self.load(baseurl + str(continuelink.group(1))) - url = re.search(self.FILE_DOWNLOAD_LINK, self.html) + url = re.search(self.LINK_PATTERN, self.html) if not url: self.fail('Download Link not Found (Plugin out of Date?)') self.logDebug('Download link: ' + str(url.group(1))) diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py index 1e0508d32..2a6bf8759 100644 --- a/module/plugins/hoster/OboomCom.py +++ b/module/plugins/hoster/OboomCom.py @@ -21,6 +21,7 @@ class OboomCom(Hoster): RECAPTCHA_KEY = "6LdqpO0SAAAAAJGHXo63HyalP7H4qlRs_vff0kJX" + def loadUrl(self, url, get=None): if not get: get = dict() diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 2c842d77b..2d539f851 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -24,8 +24,8 @@ class OneFichierCom(SimpleHoster): FILE_URL_REPLACEMENTS = [(__pattern__, r'http://\g<id>.\g<host>/en/')] - WAITING_PATTERN = "Warning ! Without premium status, you must wait between each downloads" - NOT_PARALLEL = r"Warning ! Without premium status, you can download only one file at a time" + WAITING_PATTERN = r'Warning ! Without premium status, you must wait between each downloads' + NOT_PARALLEL = r'Warning ! Without premium status, you can download only one file at a time' WAIT_TIME = 10 * 60 # Retry time between each free download RETRY_TIME = 15 * 60 # Default retry time in seconds (if detected parallel download) diff --git a/module/plugins/hoster/PandaPlanet.py b/module/plugins/hoster/PandaPlanet.py index b6aa77b03..aebc15dd9 100644 --- a/module/plugins/hoster/PandaPlanet.py +++ b/module/plugins/hoster/PandaPlanet.py @@ -20,7 +20,7 @@ class PandaPlanet(XFileSharingPro): FILE_SIZE_PATTERN = r'File Size:</b>\s*</td>\s*<td[^>]*>(?P<S>[^<]+)</td>\s*</tr>' FILE_NAME_PATTERN = r'File Name:</b>\s*</td>\s*<td[^>]*>(?P<N>[^<]+)</td>\s*</tr>' - DIRECT_LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<]+\/(?!video\.mp4)[^"\'<]+)' % HOSTER_NAME + LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<]+\/(?!video\.mp4)[^"\'<]+)' % HOSTER_NAME getInfo = create_getInfo(PandaPlanet) diff --git a/module/plugins/hoster/PromptfileCom.py b/module/plugins/hoster/PromptfileCom.py index f001a6625..0b20094aa 100644 --- a/module/plugins/hoster/PromptfileCom.py +++ b/module/plugins/hoster/PromptfileCom.py @@ -32,7 +32,7 @@ class PromptfileCom(SimpleHoster): OFFLINE_PATTERN = r'<span style="[^"]*" title="File Not Found">File Not Found</span>' CHASH_PATTERN = r'<input type="hidden" name="chash" value="([^"]*)" />' - DIRECT_LINK_PATTERN = r"clip: {\s*url: '(https?://(?:www\.)promptfile[^']*)'," + LINK_PATTERN = r"clip: {\s*url: '(https?://(?:www\.)promptfile[^']*)'," def handleFree(self): # STAGE 1: get link to continue @@ -45,7 +45,7 @@ class PromptfileCom(SimpleHoster): self.html = self.load(self.pyfile.url, decode=True, post={'chash': chash}) # STAGE 2: get the direct link - m = re.search(self.DIRECT_LINK_PATTERN, self.html, re.MULTILINE | re.DOTALL) + m = re.search(self.LINK_PATTERN, self.html, re.MULTILINE | re.DOTALL) if not m: self.parseError("Unable to detect direct link") direct = m.group(1) diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index d3399722e..b15201522 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -37,7 +37,7 @@ class RapidgatorNet(SimpleHoster): __author_name__ = ("zoidberg", "chrox", "stickell", "Walter Purcaro") __author_mail__ = ("zoidberg@mujmail.cz", "", "l.stickell@yahoo.it", "vuolter@gmail.com") - API_URL = 'http://rapidgator.net/api/file' + API_URL = "http://rapidgator.net/api/file" FILE_NAME_PATTERN = r'<title>Download file (?P<N>.*)</title>' FILE_SIZE_PATTERN = r'File size:\s*<strong>(?P<S>[\d\.]+) (?P<U>\w+)</strong>' @@ -47,7 +47,7 @@ class RapidgatorNet(SimpleHoster): PREMIUM_ONLY_ERROR_PATTERN = r'You can download files up to|This file can be downloaded by premium only<' DOWNLOAD_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)\s*(\d+)\s*(hour|min)' - DOWNLOAD_LINK_PATTERN = r"return '(http://\w+.rapidgator.net/.*)';" + LINK_PATTERN = r"return '(http://\w+.rapidgator.net/.*)';" RECAPTCHA_KEY_PATTERN = r'"http://api\.recaptcha\.net/challenge\?k=(.*?)"' ADSCAPTCHA_SRC_PATTERN = r'(http://api\.adscaptcha\.com/Get\.aspx[^"\']*)' @@ -128,7 +128,7 @@ class RapidgatorNet(SimpleHoster): self.html = self.load(url) for _ in xrange(5): - found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if found: link = found.group(1) self.logDebug(link) diff --git a/module/plugins/hoster/RarefileNet.py b/module/plugins/hoster/RarefileNet.py index 8f2aacbcf..7dd4164f6 100644 --- a/module/plugins/hoster/RarefileNet.py +++ b/module/plugins/hoster/RarefileNet.py @@ -19,7 +19,7 @@ class RarefileNet(XFileSharingPro): FILE_NAME_PATTERN = r'<td><font color="red">(?P<N>.*?)</font></td>' FILE_SIZE_PATTERN = r'<td>Size : (?P<S>.+?) ' - DIRECT_LINK_PATTERN = r'<a href="(?P<link>[^"]+)">(?P=link)</a>' + LINK_PATTERN = r'<a href="(?P<link>[^"]+)">(?P=link)</a>' def setup(self): self.resumeDownload = self.multiDL = self.premium diff --git a/module/plugins/hoster/RemixshareCom.py b/module/plugins/hoster/RemixshareCom.py index dedb3b8e1..a0f67e0b2 100644 --- a/module/plugins/hoster/RemixshareCom.py +++ b/module/plugins/hoster/RemixshareCom.py @@ -1,11 +1,13 @@ # -*- coding: utf-8 -*- -#Testlink: -#http://remixshare.com/download/p946u -# + +# Test link: +# http://remixshare.com/download/p946u + +# Note: # The remixshare.com website is very very slow, so # if your download not starts because of pycurl timeouts: # Adjust timeouts in /usr/share/pyload/module/network/HTTPRequest.py -# + import re @@ -24,9 +26,9 @@ class RemixshareCom(SimpleHoster): FILE_INFO_PATTERN = r'title=\'.+?\'>(?P<N>.+?)</span><span class=\'light2\'> \((?P<S>\d+) (?P<U>\w+)\)<' OFFLINE_PATTERN = r'<h1>Ooops!<' - WAIT_PATTERN = r'var XYZ = "(\d+)"' - FILE_URL_PATTERN = r'(http://remixshare.com/downloadfinal/.+?)"' - FILE_TOKEN_PATTERN = r'var acc = (\d+)' + LINK_PATTERN = r'(http://remixshare\.com/downloadfinal/.+?)"' + TOKEN_PATTERN = r'var acc = (\d+)' + WAIT_PATTERN = r'var XYZ = r"(\d+)"' def setup(self): @@ -34,12 +36,12 @@ class RemixshareCom(SimpleHoster): self.chunkLimit = 1 def handleFree(self): - b = re.search(self.FILE_URL_PATTERN, self.html) + b = re.search(self.LINK_PATTERN, self.html) if not b: - self.fail("Can not parse download url") - c = re.search(self.FILE_TOKEN_PATTERN, self.html) + self.parseError("Cannot parse download url") + c = re.search(self.TOKEN_PATTERN, self.html) if not c: - self.fail("Can not parse file token") + self.parseError("Cannot parse file token") dl_url = b.group(1) + c.group(1) #Check if we have to wait @@ -49,7 +51,7 @@ class RemixshareCom(SimpleHoster): self.wait(seconds.group(1)) # Finally start downloading... - self.logDebug("Download-URL: " + dl_url) + self.logDebug("Download URL = r" + dl_url) self.download(dl_url, disposition=True) diff --git a/module/plugins/hoster/RgHostNet.py b/module/plugins/hoster/RgHostNet.py index 4c6e040cb..b6d34e4fc 100644 --- a/module/plugins/hoster/RgHostNet.py +++ b/module/plugins/hoster/RgHostNet.py @@ -15,10 +15,10 @@ class RgHostNet(SimpleHoster): FILE_INFO_PATTERN = r'<h1>\s+(<a[^>]+>)?(?P<N>[^<]+)(</a>)?\s+<small[^>]+>\s+\((?P<S>[^)]+)\)\s+</small>\s+</h1>' OFFLINE_PATTERN = r'File is deleted|this page is not found' - DOWNLOAD_LINK_PATTERN = '''<a\s+href="([^"]+)"\s+class="btn\s+large\s+download"[^>]+>Download</a>''' + LINK_PATTERN = r'''<a\s+href="([^"]+)"\s+class="btn\s+large\s+download"[^>]+>Download</a>''' def handleFree(self): - found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if not found: self.parseError("Unable to detect the direct link") download_link = found.group(1) diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index 4d3e9b7f3..ecfe389e3 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -23,7 +23,7 @@ class RyushareCom(XFileSharingPro): FILE_SIZE_PATTERN = r'You have requested <font color="red">[^<]+</font> \((?P<S>[\d\.]+) (?P<U>\w+)' WAIT_PATTERN = r'You have to wait ((?P<hour>\d+) hour[s]?, )?((?P<min>\d+) minute[s], )?(?P<sec>\d+) second[s]' - DIRECT_LINK_PATTERN = r'(http://([^/]*?ryushare.com|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\w+/\w+/)[^"\'<]+)' + LINK_PATTERN = r'(http://([^/]*?ryushare.com|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\w+/\w+/)[^"\'<]+)' SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' def getDownloadLink(self): diff --git a/module/plugins/hoster/SecureUploadEu.py b/module/plugins/hoster/SecureUploadEu.py index bf0b349e6..aef6ac1bd 100644 --- a/module/plugins/hoster/SecureUploadEu.py +++ b/module/plugins/hoster/SecureUploadEu.py @@ -14,8 +14,8 @@ class SecureUploadEu(XFileSharingPro): HOSTER_NAME = "secureupload.eu" - FILE_INFO_PATTERN = '<h3>Downloading (?P<N>[^<]+) \((?P<S>[^<]+)\)</h3>' - OFFLINE_PATTERN = 'The file was removed|File Not Found' + FILE_INFO_PATTERN = r'<h3>Downloading (?P<N>[^<]+) \((?P<S>[^<]+)\)</h3>' + OFFLINE_PATTERN = r'The file was removed|File Not Found' getInfo = create_getInfo(SecureUploadEu) diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py index 8b6c9781a..e441a594d 100644 --- a/module/plugins/hoster/SendspaceCom.py +++ b/module/plugins/hoster/SendspaceCom.py @@ -30,17 +30,19 @@ class SendspaceCom(SimpleHoster): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - DOWNLOAD_URL_PATTERN = r'<a id="download_button" href="([^"]+)"' FILE_NAME_PATTERN = r'<h2 class="bgray">\s*<(?:b|strong)>(?P<N>[^<]+)</' FILE_SIZE_PATTERN = r'<div class="file_description reverse margin_center">\s*<b>File Size:</b>\s*(?P<S>[0-9.]+)(?P<U>[kKMG])i?B\s*</div>' OFFLINE_PATTERN = r'<div class="msg error" style="cursor: default">Sorry, the file you requested is not available.</div>' + + LINK_PATTERN = r'<a id="download_button" href="([^"]+)"' CAPTCHA_PATTERN = r'<td><img src="(/captchas/captcha.php?captcha=([^"]+))"></td>' USER_CAPTCHA_PATTERN = r'<td><img src="/captchas/captcha.php?user=([^"]+))"></td>' + def handleFree(self): params = {} for _ in xrange(3): - found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if found: if 'captcha_hash' in params: self.correctCaptcha() diff --git a/module/plugins/hoster/Share4webCom.py b/module/plugins/hoster/Share4webCom.py index e25216cb8..01935ee72 100644 --- a/module/plugins/hoster/Share4webCom.py +++ b/module/plugins/hoster/Share4webCom.py @@ -13,7 +13,7 @@ class Share4webCom(UnibytesCom): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - DOMAIN = 'http://www.share4web.com' + HOSTER_NAME = "share4web.com" getInfo = create_getInfo(UnibytesCom) diff --git a/module/plugins/hoster/ShareRapidCom.py b/module/plugins/hoster/ShareRapidCom.py index aca7e995b..dad75ae74 100644 --- a/module/plugins/hoster/ShareRapidCom.py +++ b/module/plugins/hoster/ShareRapidCom.py @@ -32,11 +32,12 @@ class ShareRapidCom(SimpleHoster): FILE_SIZE_PATTERN = r'<td class="i">Velikost:</td>\s*<td class="h"><strong>\s*(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</strong></td>' OFFLINE_PATTERN = ur'Nastala chyba 404|Soubor byl smazán' - DOWNLOAD_URL_PATTERN = r'<a href="([^"]+)" title="Stahnout">([^<]+)</a>' + FILE_URL_REPLACEMENTS = [(__pattern__, r'http://share-rapid.com/stahuj/\g<id>')] + + LINK_PATTERN = r'<a href="([^"]+)" title="Stahnout">([^<]+)</a>' ERR_LOGIN_PATTERN = ur'<div class="error_div"><strong>Stahování je přístupné pouze přihlášeným uživatelům' ERR_CREDIT_PATTERN = ur'<div class="error_div"><strong>Stahování zdarma je možné jen přes náš' - FILE_URL_REPLACEMENTS = [(__pattern__, r'http://share-rapid.com/stahuj/\g<id>')] def setup(self): self.chunkLimit = 1 @@ -54,7 +55,7 @@ class ShareRapidCom(SimpleHoster): self.getFileInfo() - found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if found: link = found.group(1) self.logDebug("Premium link: %s" % link) diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index 388eb7876..849f3797a 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -18,14 +18,14 @@ class StreamcloudEu(XFileSharingPro): HOSTER_NAME = "streamcloud.eu" - DIRECT_LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud.eu:?\d*/.*/video\.(mp4|flv))",' + LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud.eu:?\d*/.*/video\.(mp4|flv))",' def setup(self): super(StreamcloudEu, self).setup() self.multiDL = True def getDownloadLink(self): - found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S) + found = re.search(self.LINK_PATTERN, self.html, re.S) if found: return found.group(1) @@ -42,7 +42,7 @@ class StreamcloudEu(XFileSharingPro): if found: break - found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S) + found = re.search(self.LINK_PATTERN, self.html, re.S) if found: break diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index af9cdc59f..34b449f7c 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -42,19 +42,20 @@ class TurbobitNet(SimpleHoster): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - # long filenames are shortened - FILE_INFO_PATTERN = r"<span class='file-icon1[^>]*>(?P<N>[^<]+)</span>\s*\((?P<S>[^\)]+)\)\s*</h1>" - FILE_NAME_PATTERN = r'<meta name="keywords" content="\s+(?P<N>[^,]+)' # full name but missing on page2 + FILE_INFO_PATTERN = r"<span class='file-icon1[^>]*>(?P<N>[^<]+)</span>\s*\((?P<S>[^\)]+)\)\s*</h1>" #: long filenames are shortened + FILE_NAME_PATTERN = r'<meta name="keywords" content="\s+(?P<N>[^,]+)' #: full name but missing on page2 OFFLINE_PATTERN = r'<h2>File Not Found</h2>|html\(\'File (?:was )?not found' + FILE_URL_REPLACEMENTS = [(r"http://(?:www\.)?(turbobit.net|unextfiles.com)/(?:download/free/)?(?P<ID>\w+).*", "http://turbobit.net/\g<ID>.html")] SH_COOKIES = [("turbobit.net", "user_lang", "en")] - CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' - DOWNLOAD_URL_PATTERN = r'(?P<url>/download/redirect/[^"\']+)' + LINK_PATTERN = r'(?P<url>/download/redirect/[^"\']+)' LIMIT_WAIT_PATTERN = r'<div id="time-limit-text">\s*.*?<span id=\'timeout\'>(\d+)</span>' + CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' CAPTCHA_SRC_PATTERN = r'<img alt="Captcha" src="(.*?)"' + def handleFree(self): self.url = "http://turbobit.net/download/free/%s" % self.file_info['ID'] self.html = self.load(self.url) @@ -172,7 +173,7 @@ class TurbobitNet(SimpleHoster): self.downloadFile() def downloadFile(self): - found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if not found: self.parseError("download link") self.url = "http://turbobit.net" + found.group('url') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index bb9737d2e..74a9dbe08 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -17,13 +17,15 @@ class TwoSharedCom(SimpleHoster): FILE_NAME_PATTERN = r'<h1>(?P<N>.*)</h1>' FILE_SIZE_PATTERN = r'<span class="dtitle">File size:</span>\s*(?P<S>[0-9,.]+) (?P<U>[kKMG])i?B' OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.' - DOWNLOAD_URL_PATTERN = r"window.location ='([^']+)';" + + LINK_PATTERN = r"window.location ='([^']+)';" + def setup(self): self.resumeDownload = self.multiDL = True def handleFree(self): - found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if not found: self.parseError('Download link') link = found.group(1) diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index d540505f1..0366c6db4 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -36,10 +36,11 @@ class UlozTo(SimpleHoster): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + FILE_INFO_PATTERN = r'<p>File <strong>(?P<N>[^<]+)</strong> is password protected</p>' FILE_NAME_PATTERN = r'<title>(?P<N>[^<]+) \| Uloz.to</title>' FILE_SIZE_PATTERN = r'<span id="fileSize">.*?(?P<S>[0-9.]+\s[kMG]?B)</span>' - FILE_INFO_PATTERN = r'<p>File <strong>(?P<N>[^<]+)</strong> is password protected</p>' OFFLINE_PATTERN = r'<title>404 - Page not found</title>|<h1 class="h1">File (has been deleted|was banned)</h1>' + FILE_SIZE_REPLACEMENTS = [('([0-9.]+)\s([kMG])B', convertDecimalPrefix)] FILE_URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "www.ulozto.net")] @@ -50,6 +51,7 @@ class UlozTo(SimpleHoster): PREMIUM_URL_PATTERN = r'<div class="downloadForm"><form action="([^"]+)"' TOKEN_PATTERN = r'<input type="hidden" name="_token_" id="[^\"]*" value="(?P<token>[^\"]*)" />' + def setup(self): self.multiDL = self.premium self.resumeDownload = True diff --git a/module/plugins/hoster/UloziskoSk.py b/module/plugins/hoster/UloziskoSk.py index 259f415ca..2778efa6b 100644 --- a/module/plugins/hoster/UloziskoSk.py +++ b/module/plugins/hoster/UloziskoSk.py @@ -18,7 +18,7 @@ """ import re -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class UloziskoSk(SimpleHoster): @@ -30,14 +30,16 @@ class UloziskoSk(SimpleHoster): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - URL_PATTERN = r'<form name = "formular" action = "([^"]+)" method = "post">' - ID_PATTERN = r'<input type = "hidden" name = "id" value = "([^"]+)" />' FILE_NAME_PATTERN = r'<div class="down1">(?P<N>[^<]+)</div>' FILE_SIZE_PATTERN = ur'Veľkosť súboru: <strong>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</strong><br />' - CAPTCHA_PATTERN = r'<img src="(/obrazky/obrazky.php\?fid=[^"]+)" alt="" />' OFFLINE_PATTERN = ur'<span class = "red">Zadaný súbor neexistuje z jedného z nasledujúcich dôvodov:</span>' + + LINK_PATTERN = r'<form name = "formular" action = "([^"]+)" method = "post">' + ID_PATTERN = r'<input type = "hidden" name = "id" value = "([^"]+)" />' + CAPTCHA_PATTERN = r'<img src="(/obrazky/obrazky.php\?fid=[^"]+)" alt="" />' IMG_PATTERN = ur'<strong>PRE ZVÄČŠENIE KLIKNITE NA OBRÁZOK</strong><br /><a href = "([^"]+)">' + def process(self, pyfile): self.html = self.load(pyfile.url, decode=True) self.getFileInfo() @@ -50,21 +52,21 @@ class UloziskoSk(SimpleHoster): self.handleFree() def handleFree(self): - found = re.search(self.URL_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if found is None: - raise PluginParseError('URL') + self.parseError('URL') parsed_url = 'http://www.ulozisko.sk' + found.group(1) found = re.search(self.ID_PATTERN, self.html) if found is None: - raise PluginParseError('ID') + self.parseError('ID') id = found.group(1) self.logDebug('URL:' + parsed_url + ' ID:' + id) found = re.search(self.CAPTCHA_PATTERN, self.html) if found is None: - raise PluginParseError('CAPTCHA') + self.parseError('CAPTCHA') captcha_url = 'http://www.ulozisko.sk' + found.group(1) captcha = self.decryptCaptcha(captcha_url, cookies=True) diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py index 1a64146c4..a90b75439 100644 --- a/module/plugins/hoster/UnibytesCom.py +++ b/module/plugins/hoster/UnibytesCom.py @@ -32,18 +32,20 @@ class UnibytesCom(SimpleHoster): __author_mail__ = "zoidberg@mujmail.cz" FILE_INFO_PATTERN = r'<span[^>]*?id="fileName"[^>]*>(?P<N>[^>]+)</span>\s*\((?P<S>\d.*?)\)' - DOMAIN = 'http://www.unibytes.com' + HOSTER_NAME = "unibytes.com" WAIT_PATTERN = r'Wait for <span id="slowRest">(\d+)</span> sec' - DOWNLOAD_LINK_PATTERN = r'<a href="([^"]+)">Download</a>' + LINK_PATTERN = r'<a href="([^"]+)">Download</a>' + def handleFree(self): + domain = "http://www." + self.HOSTER_NAME action, post_data = self.parseHtmlForm('id="startForm"') self.req.http.c.setopt(FOLLOWLOCATION, 0) for _ in xrange(8): self.logDebug(action, post_data) - self.html = self.load(self.DOMAIN + action, post=post_data) + self.html = self.load(domain + action, post=post_data) found = re.search(r'location:\s*(\S+)', self.req.http.header, re.I) if found: @@ -55,7 +57,7 @@ class UnibytesCom(SimpleHoster): self.retry() if post_data['step'] == 'last': - found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if found: url = found.group(1) self.correctCaptcha() @@ -70,7 +72,7 @@ class UnibytesCom(SimpleHoster): found = re.search(self.WAIT_PATTERN, self.html) self.wait(int(found.group(1)) if found else 60, False) elif last_step in ('captcha', 'last'): - post_data['captcha'] = self.decryptCaptcha(self.DOMAIN + '/captcha.jpg') + post_data['captcha'] = self.decryptCaptcha(domain + '/captcha.jpg') else: self.fail("No valid captcha code entered") diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 109ad0f1c..4cf8b35b5 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -97,7 +97,7 @@ class UploadedTo(Hoster): FILE_INFO_PATTERN = r'<a href="file/(?P<ID>\w+)" id="filename">(?P<N>[^<]+)</a> \s*<small[^>]*>(?P<S>[^<]+)</small>' OFFLINE_PATTERN = r'<small class="cL">Error: 404</small>' - DL_LIMIT_PATTERN = "You have reached the max. number of possible free downloads for this hour" + DL_LIMIT_PATTERN = r'You have reached the max. number of possible free downloads for this hour' def setup(self): self.multiDL = self.resumeDownload = self.premium diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index 11536028a..39797a5f3 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -33,18 +33,19 @@ class UploadheroCom(SimpleHoster): __author_name__ = ("mcmyst", "zoidberg") __author_mail__ = ("mcmyst@hotmail.fr", "zoidberg@mujmail.cz") - SH_COOKIES = [("http://uploadhero.co", "lang", "en")] FILE_NAME_PATTERN = r'<div class="nom_de_fichier">(?P<N>.*?)</div>' FILE_SIZE_PATTERN = r'Taille du fichier : </span><strong>(?P<S>.*?)</strong>' OFFLINE_PATTERN = r'<p class="titre_dl_2">|<div class="raison"><strong>Le lien du fichier ci-dessus n\'existe plus.' - DOWNLOAD_URL_PATTERN = r'<a href="([^"]+)" id="downloadnow"' + SH_COOKIES = [("http://uploadhero.co", "lang", "en")] IP_BLOCKED_PATTERN = r'href="(/lightbox_block_download.php\?min=.*?)"' IP_WAIT_PATTERN = r'<span id="minutes">(\d+)</span>.*\s*<span id="seconds">(\d+)</span>' CAPTCHA_PATTERN = r'"(/captchadl\.php\?[a-z0-9]+)"' FREE_URL_PATTERN = r'var magicomfg = \'<a href="(http://[^<>"]*?)"|"(http://storage\d+\.uploadhero\.co/\?d=[A-Za-z0-9]+/[^<>"/]+)"' + PREMIUM_URL_PATTERN = r'<a href="([^"]+)" id="downloadnow"' + def handleFree(self): self.checkErrors() @@ -72,7 +73,7 @@ class UploadheroCom(SimpleHoster): def handlePremium(self): self.logDebug("%s: Use Premium Account" % self.__name__) self.html = self.load(self.pyfile.url) - link = re.search(self.DOWNLOAD_URL_PATTERN, self.html).group(1) + link = re.search(self.PREMIUM_URL_PATTERN, self.html).group(1) self.logDebug("Downloading link : '%s'" % link) self.download(link) diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index f84035c90..8e39b3ed0 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -28,7 +28,7 @@ class UploadingCom(SimpleHoster): __name__ = "UploadingCom" __type__ = "hoster" __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P<ID>[\w\d]+)' - __version__ = "0.34" + __version__ = "0.35" __description__ = """Uploading.com hoster plugin""" __author_name__ = ("jeix", "mkaay", "zoidberg") __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz") @@ -85,21 +85,21 @@ class UploadingCom(SimpleHoster): self.logInfo("%s: Waiting %d seconds." % (self.__name__, wait_time)) self.wait(wait_time) else: - self.pluginParseError("AJAX/WAIT") + self.parseError("AJAX/WAIT") response = json_loads( self.load(ajax_url, post={'action': 'get_link', 'code': self.file_info['ID'], 'pass': 'false'})) if 'answer' in response and 'link' in response['answer']: url = response['answer']['link'] else: - self.pluginParseError("AJAX/URL") + self.parseError("AJAX/URL") self.html = self.load(url) found = re.search(r'<form id="file_form" action="(.*?)"', self.html) if found: url = found.group(1) else: - self.pluginParseError("URL") + self.parseError("URL") self.download(url) diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py index 69d209471..50dc431a9 100644 --- a/module/plugins/hoster/UpstoreNet.py +++ b/module/plugins/hoster/UpstoreNet.py @@ -16,9 +16,9 @@ class UpstoreNet(SimpleHoster): FILE_INFO_PATTERN = r'<div class="comment">.*?</div>\s*\n<h2 style="margin:0">(?P<N>.*?)</h2>\s*\n<div class="comment">\s*\n\s*(?P<S>[\d.]+) (?P<U>\w+)' OFFLINE_PATTERN = r'<span class="error">File not found</span>' - WAIT_PATTERN = r"var sec = (\d+)" + WAIT_PATTERN = r'var sec = (\d+)' CHASH_PATTERN = r'<input type="hidden" name="hash" value="([^"]*)">' - DIRECT_LINK_PATTERN = r'<a href="(https?://.*?)" target="_blank"><b>' + LINK_PATTERN = r'<a href="(https?://.*?)" target="_blank"><b>' def handleFree(self): # STAGE 1: get link to continue @@ -55,7 +55,7 @@ class UpstoreNet(SimpleHoster): self.html = self.load(self.pyfile.url, post=post_data, decode=True) # STAGE 3: get direct link - m = re.search(self.DIRECT_LINK_PATTERN, self.html, re.DOTALL) + m = re.search(self.LINK_PATTERN, self.html, re.DOTALL) if m: break diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py index f086a9bc0..802b84bbf 100644 --- a/module/plugins/hoster/UptoboxCom.py +++ b/module/plugins/hoster/UptoboxCom.py @@ -41,7 +41,7 @@ class UptoboxCom(XFileSharingPro): WAIT_PATTERN = r'>(\d+)</span> seconds<' - DIRECT_LINK_PATTERN = r'"(https?://\w+\.uptobox\.com/d/.*?)"' + LINK_PATTERN = r'"(https?://\w+\.uptobox\.com/d/.*?)"' def handleCaptcha(self, inputs): found = re.search(self.SOLVEMEDIA_PATTERN, self.html) diff --git a/module/plugins/hoster/VidPlayNet.py b/module/plugins/hoster/VidPlayNet.py index 8406f6b45..3407f4349 100644 --- a/module/plugins/hoster/VidPlayNet.py +++ b/module/plugins/hoster/VidPlayNet.py @@ -19,7 +19,7 @@ class VidPlayNet(XFileSharingPro): OFFLINE_PATTERN = r'<b>File Not Found</b><br>\s*<br>' FILE_NAME_PATTERN = r'<b>Password:</b></div>\s*<h[1-6]>(?P<N>[^<]+)</h[1-6]>' - DIRECT_LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<&]+)' % HOSTER_NAME + LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<&]+)' % HOSTER_NAME getInfo = create_getInfo(VidPlayNet) diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 162d0d8a8..fb6a912fa 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -42,21 +42,23 @@ class XFileSharingPro(SimpleHoster): __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + FILE_INFO_PATTERN = r'<tr><td align=right><b>Filename:</b></td><td nowrap>(?P<N>[^<]+)</td></tr>\s*.*?<small>\((?P<S>[^<]+)\)</small>' FILE_NAME_PATTERN = r'<input type="hidden" name="fname" value="(?P<N>[^"]+)"' FILE_SIZE_PATTERN = r'You have requested .*\((?P<S>[\d\.\,]+) ?(?P<U>\w+)?\)</font>' - FILE_INFO_PATTERN = r'<tr><td align=right><b>Filename:</b></td><td nowrap>(?P<N>[^<]+)</td></tr>\s*.*?<small>\((?P<S>[^<]+)\)</small>' OFFLINE_PATTERN = r'>\w+ (Not Found|file (was|has been) removed)' WAIT_PATTERN = r'<span id="countdown_str">.*?>(\d+)</span>' - #LONG_WAIT_PATTERN = r'(?P<H>\d+(?=\s*hour))?.*?(?P<M>\d+(?=\s*minute))?.*?(?P<S>\d+(?=\s*second))?' - OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)' - OVR_KILL_LINK_PATTERN = r'<h2>Delete Link</h2>\s*<textarea[^>]*>([^<]+)' + + OVR_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)' + CAPTCHA_URL_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)' RECAPTCHA_URL_PATTERN = r'http://[^"\']+?recaptcha[^"\']+?\?k=([^"\']+)"' CAPTCHA_DIV_PATTERN = r'>Enter code.*?<div.*?>(.*?)</div>' SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' + ERROR_PATTERN = r'class=["\']err["\'][^>]*>(.*?)</' + def setup(self): if self.__name__ == "XFileSharingPro": self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] @@ -103,8 +105,8 @@ class XFileSharingPro(SimpleHoster): """ Initialize important variables """ if not hasattr(self, "HOSTER_NAME"): self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1) - if not hasattr(self, "DIRECT_LINK_PATTERN"): - self.DIRECT_LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<]+)' % self.HOSTER_NAME + if not hasattr(self, "LINK_PATTERN"): + self.LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<]+)' % self.HOSTER_NAME self.captcha = self.errmsg = None self.passwords = self.getPassword().splitlines() @@ -120,7 +122,7 @@ class XFileSharingPro(SimpleHoster): location = None found = re.search(r"Location\s*:\s*(.*)", self.header, re.I) - if found and re.match(self.DIRECT_LINK_PATTERN, found.group(1)): + if found and re.match(self.LINK_PATTERN, found.group(1)): location = found.group(1).strip() return location @@ -144,7 +146,7 @@ class XFileSharingPro(SimpleHoster): if found: break - found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S) + found = re.search(self.LINK_PATTERN, self.html, re.S) if found: break @@ -158,7 +160,7 @@ class XFileSharingPro(SimpleHoster): def handlePremium(self): self.html = self.load(self.pyfile.url, post=self.getPostParameters()) - found = re.search(self.DIRECT_LINK_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if not found: self.parseError('DIRECT LINK') self.startDownload(found.group(1)) @@ -190,7 +192,7 @@ class XFileSharingPro(SimpleHoster): self.fail(inputs['st']) #get easybytez.com link for uploaded file - found = re.search(self.OVR_DOWNLOAD_LINK_PATTERN, self.html) + found = re.search(self.OVR_LINK_PATTERN, self.html) if not found: self.parseError('DIRECT LINK (OVR)') self.pyfile.url = found.group(1) diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py index a5cc80b0f..de4d0ff20 100644 --- a/module/plugins/hoster/YibaishiwuCom.py +++ b/module/plugins/hoster/YibaishiwuCom.py @@ -35,10 +35,11 @@ class YibaishiwuCom(SimpleHoster): FILE_SIZE_PATTERN = r"file_size: '(?P<S>[^']+)'" OFFLINE_PATTERN = ur'<h3><i style="color:red;">哎呀!提取码不存在!不妨搜搜看吧!</i></h3>' - AJAX_URL_PATTERN = r'(/\?ct=(pickcode|download)[^"\']+)' + LINK_PATTERN = r'(/\?ct=(pickcode|download)[^"\']+)' + def handleFree(self): - found = re.search(self.AJAX_URL_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if not found: self.parseError("AJAX URL") url = found.group(1) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index b5066437e..8e6b8b42f 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -194,8 +194,8 @@ class SimpleHoster(Hoster): example: PREMIUM_ONLY_PATTERN = r'Premium account required' """ - FILE_SIZE_REPLACEMENTS = [] FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup)] + FILE_SIZE_REPLACEMENTS = [] FILE_URL_REPLACEMENTS = [] SH_BROKEN_ENCODING = False # Set to True or encoding name if encoding in http header is not correct |