diff options
author | Stefano <l.stickell@yahoo.it> | 2013-10-02 15:57:29 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-10-07 11:26:58 +0200 |
commit | 08b77b4cb91338f3c03ab21712387f7e2336c881 (patch) | |
tree | 172c1f5da771c24795e9bcae7d5e8b0023becc91 | |
parent | Merge pull request #285 from vuolter/s/hoster/OneFichierCom (diff) | |
download | pyload-08b77b4cb91338f3c03ab21712387f7e2336c881.tar.xz |
Plugins: cosmetics See #286
(cherry picked from commit f876908b6a1946845c1c7dff591d4d9f64643f82)
Conflicts:
pyload/plugins/hoster/DlFreeFr.py
23 files changed, 31 insertions, 45 deletions
diff --git a/pyload/plugins/hoster/CzshareCom.py b/pyload/plugins/hoster/CzshareCom.py index 8f6f76d84..fdfce6226 100644 --- a/pyload/plugins/hoster/CzshareCom.py +++ b/pyload/plugins/hoster/CzshareCom.py @@ -48,7 +48,7 @@ class CzshareCom(SimpleHoster): USER_CREDIT_PATTERN = r'<div class="credit">\s*kredit: <strong>([0-9., ]+)([kKMG]i?B)</strong>\s*</div><!-- .credit -->' def setup(self): - self.multiDL = self.resumeDownload = True if self.premium else False + self.multiDL = self.resumeDownload = self.premium self.chunkLimit = 1 def checkTrafficLeft(self): diff --git a/pyload/plugins/hoster/DailymotionCom.py b/pyload/plugins/hoster/DailymotionCom.py index ab8ff7910..7d33540f8 100644 --- a/pyload/plugins/hoster/DailymotionCom.py +++ b/pyload/plugins/hoster/DailymotionCom.py @@ -36,7 +36,8 @@ class DailymotionCom(Hoster): for quality in ('hd720URL', 'hqURL', 'sdURL', 'ldURL', ''): dlLink = self.getQuality(quality, allLinksInfo) - if dlLink is not None: break + if dlLink is not None: + break else: self.fail(r'Unable to find video URL') diff --git a/pyload/plugins/hoster/DlFreeFr.py b/pyload/plugins/hoster/DlFreeFr.py index 1f0e38acd..35b9ca6b8 100644 --- a/pyload/plugins/hoster/DlFreeFr.py +++ b/pyload/plugins/hoster/DlFreeFr.py @@ -119,8 +119,8 @@ class DlFreeFr(SimpleHoster): #FILE_URL_PATTERN = r'href="(?P<url>http://.*?)">Télécharger ce fichier' def setup(self): + self.multiDL = self.resumeDownload = True self.limitDL = 5 - self.resumeDownload = True self.chunkLimit = 1 def init(self): diff --git a/pyload/plugins/hoster/FileserveCom.py b/pyload/plugins/hoster/FileserveCom.py index e8e78f9b0..a9ff24d19 100644 --- a/pyload/plugins/hoster/FileserveCom.py +++ b/pyload/plugins/hoster/FileserveCom.py @@ -65,7 +65,7 @@ class FileserveCom(Hoster): # shares code with FilejungleCom and UploadstationCom def setup(self): - self.resumeDownload = self.multiDL = True if self.premium else False + self.resumeDownload = self.multiDL = self.premium self.file_id = re.search(self.__pattern__, self.pyfile.url).group('id') self.url = "%s%s" % (self.URLS[0], self.file_id) diff --git a/pyload/plugins/hoster/FileshareInUa.py b/pyload/plugins/hoster/FileshareInUa.py index d3724f728..11adc4e9c 100644 --- a/pyload/plugins/hoster/FileshareInUa.py +++ b/pyload/plugins/hoster/FileshareInUa.py @@ -19,8 +19,7 @@ class FileshareInUa(Hoster): PATTERN_OFFLINE = "This file doesn't exist, or has been removed." def setup(self): - self.resumeDownload = True - self.multiDL = True + self.resumeDownload = self.multiDL = True def process(self, pyfile): self.pyfile = pyfile diff --git a/pyload/plugins/hoster/FreevideoCz.py b/pyload/plugins/hoster/FreevideoCz.py index c5da074ed..3d8921c38 100644 --- a/pyload/plugins/hoster/FreevideoCz.py +++ b/pyload/plugins/hoster/FreevideoCz.py @@ -47,8 +47,7 @@ class FreevideoCz(Hoster): FILE_OFFLINE_PATTERN = r'<h2 class="red-corner-full">Str.nka nebyla nalezena</h2>' def setup(self): - self.multiDL = True - self.resumeDownload = True + self.multiDL = self.resumeDownload = True def process(self, pyfile): @@ -58,7 +57,8 @@ class FreevideoCz(Hoster): self.offline() found = re.search(self.URL_PATTERN, self.html) - if found is None: self.fail("Parse error (URL)") + if found is None: + self.fail("Parse error (URL)") download_url = found.group(1) pyfile.name = re.search(self.__pattern__, pyfile.url).group(1) + ".mp4" diff --git a/pyload/plugins/hoster/GamefrontCom.py b/pyload/plugins/hoster/GamefrontCom.py index f77868b16..c82cfdf50 100644 --- a/pyload/plugins/hoster/GamefrontCom.py +++ b/pyload/plugins/hoster/GamefrontCom.py @@ -19,8 +19,7 @@ class GamefrontCom(Hoster): PATTERN_OFFLINE = "This file doesn't exist, or has been removed." def setup(self): - self.resumeDownload = True - self.multiDL = True + self.resumeDownload = self.multiDL = True self.chunkLimit = -1 def process(self, pyfile): diff --git a/pyload/plugins/hoster/HellshareCz.py b/pyload/plugins/hoster/HellshareCz.py index 5fdcca7ae..8e39883e8 100644 --- a/pyload/plugins/hoster/HellshareCz.py +++ b/pyload/plugins/hoster/HellshareCz.py @@ -34,7 +34,7 @@ class HellshareCz(SimpleHoster): SHOW_WINDOW_PATTERN = r'<a href="([^?]+/(\d+)/\?do=(fileDownloadButton|relatedFileDownloadButton-\2)-showDownloadWindow)"' def setup(self): - self.resumeDownload = self.multiDL = True if self.account else False + self.resumeDownload = self.multiDL = self.account self.chunkLimit = 1 def process(self, pyfile): diff --git a/pyload/plugins/hoster/HotfileCom.py b/pyload/plugins/hoster/HotfileCom.py index 992899ef5..a7a46e03b 100644 --- a/pyload/plugins/hoster/HotfileCom.py +++ b/pyload/plugins/hoster/HotfileCom.py @@ -49,8 +49,7 @@ class HotfileCom(Hoster): self.url = None if self.premium: - self.multiDL = True - self.resumeDownload = True + self.multiDL = self.resumeDownload = True self.chunkLimit = -1 else: self.multiDL = False diff --git a/pyload/plugins/hoster/IfolderRu.py b/pyload/plugins/hoster/IfolderRu.py index 14e568f8f..78f7e7cd5 100644 --- a/pyload/plugins/hoster/IfolderRu.py +++ b/pyload/plugins/hoster/IfolderRu.py @@ -41,7 +41,7 @@ class IfolderRu(SimpleHoster): WRONG_CAPTCHA_PATTERN = ur'<font color=Red>неверный код,<br>введите еще раз</font><br>' def setup(self): - self.resumeDownload = self.multiDL = True if self.account else False + self.resumeDownload = self.multiDL = self.account self.chunkLimit = 1 def process(self, pyfile): diff --git a/pyload/plugins/hoster/JumbofilesCom.py b/pyload/plugins/hoster/JumbofilesCom.py index 93885a6a3..1b8a2d73b 100644 --- a/pyload/plugins/hoster/JumbofilesCom.py +++ b/pyload/plugins/hoster/JumbofilesCom.py @@ -17,8 +17,7 @@ class JumbofilesCom(SimpleHoster): DIRECT_LINK_PATTERN = '<meta http-equiv="refresh" content="10;url=(.+)">' def setup(self): - self.resumeDownload = True - self.multiDL = True + self.resumeDownload = self.multiDL = True def handleFree(self): ukey = re.search(self.__pattern__, self.pyfile.url).group(1) diff --git a/pyload/plugins/hoster/MediafireCom.py b/pyload/plugins/hoster/MediafireCom.py index 1e856c41d..494d0049e 100644 --- a/pyload/plugins/hoster/MediafireCom.py +++ b/pyload/plugins/hoster/MediafireCom.py @@ -36,7 +36,8 @@ def checkHTMLHeader(url): url = line.split(':', 1)[1].strip() if 'error.php?errno=320' in url: return url, 1 - if not url.startswith('http://'): url = 'http://www.mediafire.com' + url + if not url.startswith('http://'): + url = 'http://www.mediafire.com' + url break elif 'content-disposition' in line: return url, 2 @@ -114,7 +115,8 @@ class MediafireCom(SimpleHoster): self.fail("No or incorrect password") found = re.search(r'kNO = "(http://.*?)";', self.html) - if not found: self.parseError("Download URL") + if not found: + self.parseError("Download URL") download_url = found.group(1) self.logDebug("DOWNLOAD LINK:", download_url) diff --git a/pyload/plugins/hoster/MegasharesCom.py b/pyload/plugins/hoster/MegasharesCom.py index 7d089f717..4e43d4a00 100644 --- a/pyload/plugins/hoster/MegasharesCom.py +++ b/pyload/plugins/hoster/MegasharesCom.py @@ -43,7 +43,7 @@ class MegasharesCom(SimpleHoster): def setup(self): self.resumeDownload = True - self.multiDL = True if self.premium else False + self.multiDL = self.premium def handlePremium(self): self.handleDownload(True) diff --git a/pyload/plugins/hoster/NetloadIn.py b/pyload/plugins/hoster/NetloadIn.py index 0e658761a..773f2e427 100644 --- a/pyload/plugins/hoster/NetloadIn.py +++ b/pyload/plugins/hoster/NetloadIn.py @@ -62,9 +62,8 @@ class NetloadIn(Hoster): def setup(self): self.multiDL = False if self.premium: - self.multiDL = True + self.multiDL = self.resumeDownload = True self.chunkLimit = -1 - self.resumeDownload = True def process(self, pyfile): self.url = pyfile.url diff --git a/pyload/plugins/hoster/NowDownloadEu.py b/pyload/plugins/hoster/NowDownloadEu.py index 4e4c32373..f1cace73b 100644 --- a/pyload/plugins/hoster/NowDownloadEu.py +++ b/pyload/plugins/hoster/NowDownloadEu.py @@ -39,9 +39,8 @@ class NowDownloadEu(SimpleHoster): def setup(self): self.wantReconnect = False - self.multiDL = True + self.multiDL = self.resumeDownload = True self.chunkLimit = -1 - self.resumeDownload = True def handleFree(self): tokenlink = re.search(self.FILE_TOKEN_PATTERN, self.html) diff --git a/pyload/plugins/hoster/Premium4Me.py b/pyload/plugins/hoster/Premium4Me.py index d5dd30e2a..d98fea4c4 100644 --- a/pyload/plugins/hoster/Premium4Me.py +++ b/pyload/plugins/hoster/Premium4Me.py @@ -61,7 +61,8 @@ class Premium4Me(Hoster): trb = self.getTraffic() self.logInfo("Filesize: %d, Traffic used %d, traffic left %d" % (pyfile.size, tra - trb, trb)) - if err: self.fail(err) + if err: + self.fail(err) def getTraffic(self): try: diff --git a/pyload/plugins/hoster/PutlockerCom.py b/pyload/plugins/hoster/PutlockerCom.py index 0f62ea96d..02205f9cc 100644 --- a/pyload/plugins/hoster/PutlockerCom.py +++ b/pyload/plugins/hoster/PutlockerCom.py @@ -37,9 +37,8 @@ class PutlockerCom(SimpleHoster): FILE_INFO_PATTERN = r'site-content">\s*<h1>(?P<N>.+)<strong>\( (?P<S>[^)]+) \)</strong></h1>' def handleFree(self): - self.multiDL = True + self.multiDL = self.resumeDownload = True self.chunkLimit = -1 - self.resumeDownload = True self.pyfile.url = re.sub(r'http://putlocker\.com', r'http://www.putlocker.com', self.pyfile.url) self.html = self.load(self.pyfile.url, decode=True) diff --git a/pyload/plugins/hoster/RapidgatorNet.py b/pyload/plugins/hoster/RapidgatorNet.py index 543d73966..64ed6a4b3 100644 --- a/pyload/plugins/hoster/RapidgatorNet.py +++ b/pyload/plugins/hoster/RapidgatorNet.py @@ -46,8 +46,7 @@ class RapidgatorNet(SimpleHoster): SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' def setup(self): - self.resumeDownload = False - self.multiDL = False + self.resumeDownload = self.multiDL = False self.sid = None self.chunkLimit = 1 self.req.setOption("timeout", 120) diff --git a/pyload/plugins/hoster/Share76Com.py b/pyload/plugins/hoster/Share76Com.py index aaa8cd950..b48780652 100644 --- a/pyload/plugins/hoster/Share76Com.py +++ b/pyload/plugins/hoster/Share76Com.py @@ -13,9 +13,5 @@ class Share76Com(XFileSharingPro): FILE_INFO_PATTERN = r'<h2>\s*File:\s*<font[^>]*>(?P<N>[^>]+)</font>\s*\[<font[^>]*>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</font>\]</h2>' HOSTER_NAME = "share76.com" - def setup(self): - self.resumeDownload = self.multiDL = self.premium - self.chunkLimit = 1 - getInfo = create_getInfo(Share76Com) diff --git a/pyload/plugins/hoster/UploadedTo.py b/pyload/plugins/hoster/UploadedTo.py index 6ac3320c0..aee7f32b1 100644 --- a/pyload/plugins/hoster/UploadedTo.py +++ b/pyload/plugins/hoster/UploadedTo.py @@ -101,15 +101,13 @@ class UploadedTo(Hoster): def setup(self): self.html = None - self.multiDL = False - self.resumeDownload = False + self.multiDL = self.resumeDownload = False self.url = False self.chunkLimit = 1 # critical problems with more chunks if self.account: self.premium = self.account.getAccountInfo(self.user)["premium"] if self.premium: - self.multiDL = True - self.resumeDownload = True + self.multiDL = self.resumeDownload = True self.fileID = getID(self.pyfile.url) self.pyfile.url = "http://uploaded.net/file/%s" % self.fileID diff --git a/pyload/plugins/hoster/UptoboxCom.py b/pyload/plugins/hoster/UptoboxCom.py index e0d4ce7f4..fe05bf916 100644 --- a/pyload/plugins/hoster/UptoboxCom.py +++ b/pyload/plugins/hoster/UptoboxCom.py @@ -15,9 +15,5 @@ class UptoboxCom(XFileSharingPro): FILE_OFFLINE_PATTERN = r'<center>File Not Found</center>' HOSTER_NAME = "uptobox.com" - def setup(self): - self.resumeDownload = self.multiDL = self.premium - self.chunkLimit = 1 - getInfo = create_getInfo(UptoboxCom) diff --git a/pyload/plugins/hoster/X7To.py b/pyload/plugins/hoster/X7To.py index 24d1643f3..1b8850d9d 100644 --- a/pyload/plugins/hoster/X7To.py +++ b/pyload/plugins/hoster/X7To.py @@ -21,8 +21,7 @@ class X7To(Hoster): def init(self): if self.premium: - self.multiDL = False - self.resumeDownload = False + self.multiDL = self.resumeDownload = False self.chunkLimit = 1 else: self.multiDL = False diff --git a/pyload/plugins/internal/SimpleHoster.py b/pyload/plugins/internal/SimpleHoster.py index 7b1d7323a..5cb019abb 100644 --- a/pyload/plugins/internal/SimpleHoster.py +++ b/pyload/plugins/internal/SimpleHoster.py @@ -173,8 +173,9 @@ class SimpleHoster(Hoster): self.file_info = {} def setup(self): - self.resumeDownload = self.multiDL = True if self.premium else False - if isinstance(self.SH_COOKIES, list): set_cookies(self.req.cj, self.SH_COOKIES) + self.resumeDownload = self.multiDL = self.premium + if isinstance(self.SH_COOKIES, list): + set_cookies(self.req.cj, self.SH_COOKIES) def process(self, pyfile): pyfile.url = replace_patterns(pyfile.url, self.FILE_URL_REPLACEMENTS) |