From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/crypter/DdlstorageComFolder.py | 2 +- module/plugins/crypter/DlProtectCom.py | 2 +- module/plugins/crypter/DontKnowMe.py | 2 +- module/plugins/crypter/FilestubeCom.py | 4 ++-- module/plugins/crypter/FiletramCom.py | 4 ++-- module/plugins/crypter/GooGl.py | 2 +- module/plugins/crypter/LinkSaveIn.py | 4 ++-- module/plugins/crypter/LixIn.py | 2 +- module/plugins/crypter/MediafireComFolder.py | 3 ++- module/plugins/crypter/NosvideoCom.py | 2 +- module/plugins/crypter/RelinkUs.py | 25 +++++++++++++------------ module/plugins/crypter/YoutubeBatch.py | 2 +- module/plugins/hoster/BasePlugin.py | 1 + module/plugins/hoster/BayfilesCom.py | 4 ++-- module/plugins/hoster/BitshareCom.py | 8 ++++---- module/plugins/hoster/CatShareNet.py | 5 ++++- module/plugins/hoster/CramitIn.py | 2 +- module/plugins/hoster/CrockoCom.py | 3 ++- module/plugins/hoster/CzshareCom.py | 10 ++++++---- module/plugins/hoster/DataHu.py | 4 ++-- module/plugins/hoster/DataportCz.py | 10 ++++++---- module/plugins/hoster/DepositfilesCom.py | 4 ++-- module/plugins/hoster/DlFreeFr.py | 6 +++--- module/plugins/hoster/EasybytezCom.py | 5 ++--- module/plugins/hoster/EdiskCz.py | 9 +++++---- module/plugins/hoster/EgoFilesCom.py | 9 +++++---- module/plugins/hoster/EuroshareEu.py | 1 + module/plugins/hoster/ExtabitCom.py | 6 +++--- module/plugins/hoster/FastshareCz.py | 6 ++++-- module/plugins/hoster/File4safeCom.py | 2 +- module/plugins/hoster/FileParadoxIn.py | 2 +- module/plugins/hoster/FilecloudIo.py | 15 ++++++++------- module/plugins/hoster/FilefactoryCom.py | 4 ++-- module/plugins/hoster/FileomCom.py | 2 +- module/plugins/hoster/FilerNet.py | 9 +++++---- module/plugins/hoster/FilerioCom.py | 2 +- module/plugins/hoster/FileserveCom.py | 6 +++--- module/plugins/hoster/FileshareInUa.py | 2 +- module/plugins/hoster/FilezyNet.py | 2 +- module/plugins/hoster/FourSharedCom.py | 10 ++++++---- module/plugins/hoster/FreevideoCz.py | 6 ++++-- module/plugins/hoster/FshareVn.py | 8 +++++--- module/plugins/hoster/GamefrontCom.py | 2 +- module/plugins/hoster/IFileWs.py | 5 ++--- module/plugins/hoster/IfileIt.py | 4 ++-- module/plugins/hoster/IfolderRu.py | 4 ++-- module/plugins/hoster/JumbofilesCom.py | 8 ++++---- module/plugins/hoster/Keep2shareCC.py | 7 ++++--- module/plugins/hoster/LetitbitNet.py | 20 ++++++++++++-------- module/plugins/hoster/LoadTo.py | 10 ++++++---- module/plugins/hoster/LuckyShareNet.py | 5 +++-- module/plugins/hoster/MediafireCom.py | 4 ++-- module/plugins/hoster/MegasharesCom.py | 12 +++++++----- module/plugins/hoster/MovReelCom.py | 5 +---- module/plugins/hoster/NarodRu.py | 4 ++-- module/plugins/hoster/NosuploadCom.py | 4 ++-- module/plugins/hoster/NovafileCom.py | 2 +- module/plugins/hoster/NowDownloadEu.py | 18 ++++++++++-------- module/plugins/hoster/OboomCom.py | 1 + module/plugins/hoster/OneFichierCom.py | 4 ++-- module/plugins/hoster/PandaPlanet.py | 2 +- module/plugins/hoster/PromptfileCom.py | 4 ++-- module/plugins/hoster/RapidgatorNet.py | 6 +++--- module/plugins/hoster/RarefileNet.py | 2 +- module/plugins/hoster/RemixshareCom.py | 26 ++++++++++++++------------ module/plugins/hoster/RgHostNet.py | 4 ++-- module/plugins/hoster/RyushareCom.py | 2 +- module/plugins/hoster/SecureUploadEu.py | 4 ++-- module/plugins/hoster/SendspaceCom.py | 6 ++++-- module/plugins/hoster/Share4webCom.py | 2 +- module/plugins/hoster/ShareRapidCom.py | 7 ++++--- module/plugins/hoster/StreamcloudEu.py | 6 +++--- module/plugins/hoster/TurbobitNet.py | 13 +++++++------ module/plugins/hoster/TwoSharedCom.py | 6 ++++-- module/plugins/hoster/UlozTo.py | 4 +++- module/plugins/hoster/UloziskoSk.py | 18 ++++++++++-------- module/plugins/hoster/UnibytesCom.py | 12 +++++++----- module/plugins/hoster/UploadedTo.py | 2 +- module/plugins/hoster/UploadheroCom.py | 7 ++++--- module/plugins/hoster/UploadingCom.py | 8 ++++---- module/plugins/hoster/UpstoreNet.py | 6 +++--- module/plugins/hoster/UptoboxCom.py | 2 +- module/plugins/hoster/VidPlayNet.py | 2 +- module/plugins/hoster/XFileSharingPro.py | 22 ++++++++++++---------- module/plugins/hoster/YibaishiwuCom.py | 5 +++-- module/plugins/internal/SimpleHoster.py | 2 +- 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 = '' + LINK_PATTERN = r'' 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"]* href=\"(http://[^\"]+)" - TITLE_PATTERN = r" (?P.+) 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[^<]*" + LINK_PATTERN = r'\s+(http://.+)' + TITLE_PATTERN = r'(?P<title>[^<]+) - Free Download[^<]*' 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 = '' + 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.+)</[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' OFFLINE_PATTERN = ur'Az adott f\xe1jl nem l\xe9tezik' - DIRECT_LINK_PATTERN = r'
' + LINK_PATTERN = r'
' 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'(?P[^<]+)' FILE_SIZE_PATTERN = r'Velikost\s*(?P[^<]+)' OFFLINE_PATTERN = r'

Soubor nebyl nalezen

' + FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.dataport.cz/file/\1')] CAPTCHA_URL_PATTERN = r'
\s*(\d+)
' + 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'.*")] RECAPTCHA_PATTERN = r"Recaptcha.create\('([^']+)'" - DOWNLOAD_LINK_PATTERN = r'
\s*]*>(?P[^>]*)" - FILE_SIZE_PATTERN = r"Taille:\s*]*>(?P[\d.]+[KMG])o" + FILE_NAME_PATTERN = r'Fichier:\s*]*>(?P[^>]*)' + FILE_SIZE_PATTERN = r'Taille:\s*]*>(?P[\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="(?Phttp://.*?)">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'(?P.+)
\s*(?P[^<]+)' OFFLINE_PATTERN = r'

File not available

' - DIRECT_LINK_PATTERN = r'(http://(\w+\.(easyload|easybytez|zingload)\.(com|to)|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)' - OVR_DOWNLOAD_LINK_PATTERN = r'

Download Link

\s*]*>([^<]+)' - OVR_KILL_LINK_PATTERN = r'

Delete Link

\s*]*>([^<]+)' + LINK_PATTERN = r'(http://(\w+\.(easyload|easybytez|zingload)\.(com|to)|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)' + OVR_LINK_PATTERN = r'

Download Link

\s*]*>([^<]+)' ERROR_PATTERN = r'(?:class=["\']err["\'][^>]*>|
)(.*?)' FILE_INFO_PATTERN = r'\s*.*?\((?P[0-9.]*) (?P[kKMG])i?B\)' - ACTION_PATTERN = r'/en/download/(\d+/.*\.html)' - DLLINK_PATTERN = r'http://.*edisk.cz.*\.html' OFFLINE_PATTERN = r'

This file does not exist due to one of the following: