diff options
Diffstat (limited to 'pyload/plugin')
79 files changed, 141 insertions, 141 deletions
diff --git a/pyload/plugin/Account.py b/pyload/plugin/Account.py index 73554cc39..bb8f7d59a 100644 --- a/pyload/plugin/Account.py +++ b/pyload/plugin/Account.py @@ -96,7 +96,7 @@ class Account(Base): req.cj.clear() req.close() if user in self.infos: - del self.infos[user] # delete old information + del self.infos[user] #: delete old information return self._login(user, self.accounts[user]) @@ -112,7 +112,7 @@ class Account(Base): """ updates account and return true if anything changed """ if user in self.accounts: - self.accounts[user]['valid'] = True # do not remove or accounts will not login + self.accounts[user]['valid'] = True #: do not remove or accounts will not login if password: self.accounts[user]['password'] = password self.relogin(user) @@ -260,7 +260,7 @@ class Account(Base): def canUse(self): - return False if self.selectAccount() == (None, None) else True + return self.selectAccount() != (None, None) def parseTraffic(self, value, unit=None): #: return bytes diff --git a/pyload/plugin/Addon.py b/pyload/plugin/Addon.py index a43f2fd70..21a86ab05 100644 --- a/pyload/plugin/Addon.py +++ b/pyload/plugin/Addon.py @@ -56,7 +56,7 @@ class Addon(Base): #: `AddonManager` self.manager = manager - #register events + # register events if self.event_map: for event, funcs in self.event_map.iteritems(): if type(funcs) in (list, tuple): @@ -65,7 +65,7 @@ class Addon(Base): else: self.manager.addEvent(event, getattr(self, funcs)) - #delete for various reasons + # delete for various reasons self.event_map = None if self.event_list: @@ -115,7 +115,7 @@ class Addon(Base): self.unload() - def unload(self): # Deprecated, use method deactivate() instead + def unload(self): #: Deprecated, use method deactivate() instead pass @@ -134,7 +134,7 @@ class Addon(Base): self.coreReady() - def coreReady(self): # Deprecated, use method activate() instead + def coreReady(self): #: Deprecated, use method activate() instead pass @@ -144,7 +144,7 @@ class Addon(Base): self.coreExiting() - def coreExiting(self): # Deprecated, use method exit() instead + def coreExiting(self): #: Deprecated, use method exit() instead pass diff --git a/pyload/plugin/Hoster.py b/pyload/plugin/Hoster.py index df778c72f..64c635c45 100644 --- a/pyload/plugin/Hoster.py +++ b/pyload/plugin/Hoster.py @@ -4,7 +4,7 @@ from pyload.plugin.Plugin import Plugin def getInfo(self): - #result = [ .. (name, size, status, url) .. ] + # result = [ .. (name, size, status, url) .. ] return diff --git a/pyload/plugin/Plugin.py b/pyload/plugin/Plugin.py index 369d040fb..a14bb1e9c 100644 --- a/pyload/plugin/Plugin.py +++ b/pyload/plugin/Plugin.py @@ -220,10 +220,10 @@ class Plugin(Base): self.user, data = self.account.selectAccount() #: Browser instance, see `network.Browser` self.req = self.account.getAccountRequest(self.user) - self.chunkLimit = -1 # chunk limit, -1 for unlimited + self.chunkLimit = -1 #: chunk limit, -1 for unlimited #: enables resume (will be ignored if server dont accept chunks) self.resumeDownload = True - self.multiDL = True # every hoster with account should provide multiple downloads + self.multiDL = True #: every hoster with account should provide multiple downloads #: premium status self.premium = self.account.isPremium(self.user) else: @@ -232,7 +232,7 @@ class Plugin(Base): #: associated pyfile instance, see `PyFile` self.pyfile = pyfile - self.thread = None # holds thread in future + self.thread = None #: holds thread in future #: location where the last call to download was saved self.lastDownload = "" @@ -500,7 +500,7 @@ class Plugin(Base): captchaManager.removeTask(task) - if task.error and has_plugin: # ignore default error message since the user could use OCR + if task.error and has_plugin: #: ignore default error message since the user could use OCR self.fail(_("Pil and tesseract not installed and no Client connected for captcha decrypting")) elif task.error: self.fail(task.error) @@ -705,7 +705,7 @@ class Plugin(Base): content = f.read(read_size if read_size else -1) # produces encoding errors, better log to other file in the future? - #self.logDebug("Content: %s" % content) + # self.logDebug("Content: %s" % content) for name, rule in rules.iteritems(): if isinstance(rule, basestring): if rule in content: @@ -740,9 +740,9 @@ class Plugin(Base): for pyfile in self.core.files.cache.values(): if pyfile != self.pyfile and pyfile.name == self.pyfile.name and pyfile.package().folder == pack.folder: - if pyfile.status in (0, 12): # finished or downloading + if pyfile.status in (0, 12): #: finished or downloading raise SkipDownload(pyfile.pluginname) - elif pyfile.status in (5, 7) and starting: # a download is waiting/starting and was appenrently started before + elif pyfile.status in (5, 7) and starting: #: a download is waiting/starting and was appenrently started before raise SkipDownload(pyfile.pluginname) download_folder = self.core.config.get("general", "download_folder") diff --git a/pyload/plugin/account/AlldebridCom.py b/pyload/plugin/account/AlldebridCom.py index e3eb01ac2..efc5753f8 100644 --- a/pyload/plugin/account/AlldebridCom.py +++ b/pyload/plugin/account/AlldebridCom.py @@ -24,7 +24,7 @@ class AlldebridCom(Account): html = req.load("http://www.alldebrid.com/account/") soup = BeautifulSoup(html) - #Try to parse expiration date directly from the control panel page (better accuracy) + # Try to parse expiration date directly from the control panel page (better accuracy) try: time_text = soup.find('div', attrs={'class': 'remaining_time_text'}).strong.string @@ -35,7 +35,7 @@ class AlldebridCom(Account): exp_time = time.time() + int(exp_data[0]) * 24 * 60 * 60 + int( exp_data[1]) * 60 * 60 + (int(exp_data[2]) - 1) * 60 - #Get expiration date from API + # Get expiration date from API except Exception: data = self.getAccountData(user) html = req.load("http://www.alldebrid.com/api.php", diff --git a/pyload/plugin/account/CloudzillaTo.py b/pyload/plugin/account/CloudzillaTo.py index af3544da9..bee7c5a17 100644 --- a/pyload/plugin/account/CloudzillaTo.py +++ b/pyload/plugin/account/CloudzillaTo.py @@ -21,7 +21,7 @@ class CloudzillaTo(Account): def loadAccountInfo(self, user, req): html = req.load("http://www.cloudzilla.to/") - premium = True if re.search(self.PREMIUM_PATTERN, html) else False + premium = re.search(self.PREMIUM_PATTERN, html) is not None return {'validuntil': -1, 'trafficleft': -1, 'premium': premium} diff --git a/pyload/plugin/account/FastshareCz.py b/pyload/plugin/account/FastshareCz.py index 518746710..f1ed9d634 100644 --- a/pyload/plugin/account/FastshareCz.py +++ b/pyload/plugin/account/FastshareCz.py @@ -41,7 +41,7 @@ class FastshareCz(Account): def login(self, user, data, req): req.cj.setCookie("fastshare.cz", "lang", "en") - req.load('http://www.fastshare.cz/login') # Do not remove or it will not login + req.load('http://www.fastshare.cz/login') #: Do not remove or it will not login html = req.load("http://www.fastshare.cz/sql.php", post={'login': user, 'heslo': data['password']}, diff --git a/pyload/plugin/account/FilecloudIo.py b/pyload/plugin/account/FilecloudIo.py index 12e2d44f5..b07fe981a 100644 --- a/pyload/plugin/account/FilecloudIo.py +++ b/pyload/plugin/account/FilecloudIo.py @@ -30,7 +30,7 @@ class FilecloudIo(Account): return {"premium": False} akey = rep['akey'] - self.accounts[user]['akey'] = akey # Saved for hoster plugin + self.accounts[user]['akey'] = akey #: Saved for hoster plugin rep = req.load("http://api.filecloud.io/api-fetch_account_details.api", post={"akey": akey}) rep = json_loads(rep) diff --git a/pyload/plugin/account/FileserveCom.py b/pyload/plugin/account/FileserveCom.py index 46cb3cbad..d68285a33 100644 --- a/pyload/plugin/account/FileserveCom.py +++ b/pyload/plugin/account/FileserveCom.py @@ -38,7 +38,7 @@ class FileserveCom(Account): if not res['type']: self.wrongPassword() - #login at fileserv html + # login at fileserv html req.load("http://www.fileserve.com/login.php", post={"loginUserName": user, "loginUserPassword": data['password'], "autoLogin": "checked", "loginFormSubmit": "Login"}) diff --git a/pyload/plugin/account/HellshareCz.py b/pyload/plugin/account/HellshareCz.py index 444677c88..68843ee80 100644 --- a/pyload/plugin/account/HellshareCz.py +++ b/pyload/plugin/account/HellshareCz.py @@ -33,14 +33,14 @@ class HellshareCz(Account): premium = True try: if "." in credit: - #Time-based account + # Time-based account vt = [int(x) for x in credit.split('.')[:2]] lt = time.localtime() year = lt.tm_year + int(vt[1] < lt.tm_mon or (vt[1] == lt.tm_mon and vt[0] < lt.tm_mday)) validuntil = time.mktime(time.strptime("%s%d 23:59:59" % (credit, year), "%d.%m.%Y %H:%M:%S")) trafficleft = -1 else: - #Traffic-based account + # Traffic-based account trafficleft = self.parseTraffic(credit + "MB") validuntil = -1 except Exception, e: @@ -54,7 +54,7 @@ class HellshareCz(Account): def login(self, user, data, req): html = req.load('http://www.hellshare.com/', decode=True) if req.lastEffectiveURL != 'http://www.hellshare.com/': - #Switch to English + # Switch to English self.logDebug("Switch lang - URL: %s" % req.lastEffectiveURL) json = req.load("%s?do=locRouter-show" % req.lastEffectiveURL) diff --git a/pyload/plugin/account/Keep2ShareCc.py b/pyload/plugin/account/Keep2ShareCc.py index 6ee45c256..56ac5e9ab 100644 --- a/pyload/plugin/account/Keep2ShareCc.py +++ b/pyload/plugin/account/Keep2ShareCc.py @@ -46,7 +46,7 @@ class Keep2ShareCc(Account): self.logError(e) else: - premium = True if validuntil > time.mktime(time.gmtime()) else False + premium = validuntil > time.mktime(time.gmtime()) m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: diff --git a/pyload/plugin/account/MegaRapidoNet.py b/pyload/plugin/account/MegaRapidoNet.py index 2bffff288..c4ee559da 100644 --- a/pyload/plugin/account/MegaRapidoNet.py +++ b/pyload/plugin/account/MegaRapidoNet.py @@ -29,7 +29,7 @@ class MegaRapidoNet(Account): validuntil = re.search(self.VALID_UNTIL_PATTERN, html) if validuntil: - #hier weitermachen!!! (müssen umbedingt die zeit richtig machen damit! (sollte aber möglich)) + # hier weitermachen!!! (müssen umbedingt die zeit richtig machen damit! (sollte aber möglich)) validuntil = time.time() + int(validuntil.group(1)) * 24 * 3600 + int(validuntil.group(2)) * 3600 + int(validuntil.group(3)) * 60 + int(validuntil.group(4)) trafficleft = -1 premium = True diff --git a/pyload/plugin/account/MegasharesCom.py b/pyload/plugin/account/MegasharesCom.py index 42ecfc17d..8920bb2db 100644 --- a/pyload/plugin/account/MegasharesCom.py +++ b/pyload/plugin/account/MegasharesCom.py @@ -20,10 +20,10 @@ class MegasharesCom(Account): def loadAccountInfo(self, user, req): - #self.relogin(user) + # self.relogin(user) html = req.load("http://d01.megashares.com/myms.php", decode=True) - premium = False if '>Premium Upgrade<' in html else True + premium = '>Premium Upgrade<' not in html validuntil = trafficleft = -1 try: diff --git a/pyload/plugin/account/MultishareCz.py b/pyload/plugin/account/MultishareCz.py index b743fd28a..66ab3dd47 100644 --- a/pyload/plugin/account/MultishareCz.py +++ b/pyload/plugin/account/MultishareCz.py @@ -20,12 +20,12 @@ class MultishareCz(Account): def loadAccountInfo(self, user, req): - #self.relogin(user) + # self.relogin(user) html = req.load("http://www.multishare.cz/profil/", decode=True) m = re.search(self.TRAFFIC_LEFT_PATTERN, html) trafficleft = self.parseTraffic(m.group('S') + m.group('U')) if m else 0 - self.premium = True if trafficleft else False + self.premium = bool(trafficleft) html = req.load("http://www.multishare.cz/", decode=True) mms_info = dict(re.findall(self.ACCOUNT_INFO_PATTERN, html)) diff --git a/pyload/plugin/account/QuickshareCz.py b/pyload/plugin/account/QuickshareCz.py index 67dd11ac3..2f71d9ae8 100644 --- a/pyload/plugin/account/QuickshareCz.py +++ b/pyload/plugin/account/QuickshareCz.py @@ -24,7 +24,7 @@ class QuickshareCz(Account): m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: trafficleft = self.parseTraffic(m.group(1)) - premium = True if trafficleft else False + premium = bool(trafficleft) else: trafficleft = None premium = False diff --git a/pyload/plugin/account/RPNetBiz.py b/pyload/plugin/account/RPNetBiz.py index 2dfce536b..562436e85 100644 --- a/pyload/plugin/account/RPNetBiz.py +++ b/pyload/plugin/account/RPNetBiz.py @@ -26,7 +26,7 @@ class RPNetBiz(Account): account_info = {"validuntil": None, "trafficleft": None, "premium": False} except KeyError: - #handle wrong password exception + # handle wrong password exception account_info = {"validuntil": None, "trafficleft": None, "premium": False} return account_info diff --git a/pyload/plugin/account/UlozTo.py b/pyload/plugin/account/UlozTo.py index 34e56d325..c43246e7d 100644 --- a/pyload/plugin/account/UlozTo.py +++ b/pyload/plugin/account/UlozTo.py @@ -27,7 +27,7 @@ class UlozTo(Account): m = re.search(self.TRAFFIC_LEFT_PATTERN, html) trafficleft = float(m.group(1).replace(' ', '').replace(',', '.')) * 1000 * 1.048 if m else 0 - premium = True if trafficleft else False + premium = bool(trafficleft) return {'validuntil': -1, 'trafficleft': trafficleft, 'premium': premium} diff --git a/pyload/plugin/account/UploadedTo.py b/pyload/plugin/account/UploadedTo.py index 61765faf8..1b8ae5b27 100644 --- a/pyload/plugin/account/UploadedTo.py +++ b/pyload/plugin/account/UploadedTo.py @@ -28,7 +28,7 @@ class UploadedTo(Account): html = req.load("http://uploaded.net/me") - premium = True if re.search(self.PREMIUM_PATTERN, html) else False + premium = re.search(self.PREMIUM_PATTERN, html) is not None m = re.search(self.VALID_UNTIL_PATTERN, html, re.M) if m: diff --git a/pyload/plugin/account/UploadingCom.py b/pyload/plugin/account/UploadingCom.py index f5333dd4c..992e63615 100644 --- a/pyload/plugin/account/UploadingCom.py +++ b/pyload/plugin/account/UploadingCom.py @@ -28,7 +28,7 @@ class UploadingCom(Account): html = req.load("http://uploading.com/") - premium = False if re.search(self.PREMIUM_PATTERN, html) else True + premium = re.search(self.PREMIUM_PATTERN, html) is None m = re.search(self.VALID_UNTIL_PATTERN, html) if m: diff --git a/pyload/plugin/account/YibaishiwuCom.py b/pyload/plugin/account/YibaishiwuCom.py index ad9b089a9..e12e3f3f2 100644 --- a/pyload/plugin/account/YibaishiwuCom.py +++ b/pyload/plugin/account/YibaishiwuCom.py @@ -19,11 +19,11 @@ class YibaishiwuCom(Account): def loadAccountInfo(self, user, req): - #self.relogin(user) + # self.relogin(user) html = req.load("http://115.com/", decode=True) m = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S) - premium = True if m and 'is_vip: 1' in m.group(1) else False + premium = m and 'is_vip: 1' in m.group(1) validuntil = trafficleft = (-1 if m else 0) return dict({"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium}) diff --git a/pyload/plugin/addon/Checksum.py b/pyload/plugin/addon/Checksum.py index ed50b0f5e..750dd665e 100644 --- a/pyload/plugin/addon/Checksum.py +++ b/pyload/plugin/addon/Checksum.py @@ -105,8 +105,8 @@ class Checksum(Addon): self.checkFailed(pyfile, None, "No file downloaded") local_file = fs_encode(pyfile.plugin.lastDownload) - #download_folder = self.config.get("general", "download_folder") - #local_file = fs_encode(fs_join(download_folder, pyfile.package().folder, pyfile.name)) + # download_folder = self.config.get("general", "download_folder") + # local_file = fs_encode(fs_join(download_folder, pyfile.package().folder, pyfile.name)) if not isfile(local_file): self.checkFailed(pyfile, None, "File does not exist") diff --git a/pyload/plugin/addon/ExtractArchive.py b/pyload/plugin/addon/ExtractArchive.py index 7002e94f3..b0a24446a 100644 --- a/pyload/plugin/addon/ExtractArchive.py +++ b/pyload/plugin/addon/ExtractArchive.py @@ -9,7 +9,7 @@ import traceback from copy import copy # monkey patch bug in python 2.6 and lower -# http://bugs.python.org/issue6122 , http://bugs.python.org/issue1236 , http://bugs.python.org/issue1731717 +# http://bugs.python.org/issue6122, http://bugs.python.org/issue1236, http://bugs.python.org/issue1731717 if sys.version_info < (2, 7) and os.name != "nt": import errno import subprocess diff --git a/pyload/plugin/addon/IRCInterface.py b/pyload/plugin/addon/IRCInterface.py index 73998b674..07a07e381 100644 --- a/pyload/plugin/addon/IRCInterface.py +++ b/pyload/plugin/addon/IRCInterface.py @@ -338,7 +338,7 @@ class IRCInterface(Thread, Addon): if not pack: return ["ERROR: Package doesn't exists."] - #TODO add links + # TODO add links return ["INFO: Added %d links to Package %s [#%d]" % (len(links), pack['name'], id)] diff --git a/pyload/plugin/addon/UpdateManager.py b/pyload/plugin/addon/UpdateManager.py index cf8349e79..84d282bde 100644 --- a/pyload/plugin/addon/UpdateManager.py +++ b/pyload/plugin/addon/UpdateManager.py @@ -120,7 +120,7 @@ class UpdateManager(Addon): reloads.append(id) self.mtimes[id] = mtime - return True if self.core.pluginManager.reloadPlugins(reloads) else False + return bool(self.core.pluginManager.reloadPlugins(reloads)) def server_response(self): diff --git a/pyload/plugin/addon/XMPPInterface.py b/pyload/plugin/addon/XMPPInterface.py index c977042e6..5ce5b5e8b 100644 --- a/pyload/plugin/addon/XMPPInterface.py +++ b/pyload/plugin/addon/XMPPInterface.py @@ -135,7 +135,7 @@ class XMPPInterface(IRCInterface, JabberClient): to_jid = stanza.get_from() from_jid = stanza.get_to() - #j = JID() + # j = JID() to_name = to_jid.as_utf8() from_name = from_jid.as_utf8() diff --git a/pyload/plugin/crypter/DataHu.py b/pyload/plugin/crypter/DataHu.py index dd817b5ce..ce480dacb 100644 --- a/pyload/plugin/crypter/DataHu.py +++ b/pyload/plugin/crypter/DataHu.py @@ -28,7 +28,7 @@ class DataHu(SimpleCrypter): def prepare(self): super(DataHu, self).prepare() - if u'K\xe9rlek add meg a jelsz\xf3t' in self.html: # Password protected + if u'K\xe9rlek add meg a jelsz\xf3t' in self.html: #: Password protected password = self.getPassword() if not password: self.fail(_("Password required")) @@ -37,5 +37,5 @@ class DataHu(SimpleCrypter): self.html = self.load(self.pyfile.url, post={'mappa_pass': password}, decode=True) - if u'Hib\xe1s jelsz\xf3' in self.html: # Wrong password + if u'Hib\xe1s jelsz\xf3' in self.html: #: Wrong password self.fail(_("Wrong password")) diff --git a/pyload/plugin/crypter/DevhostSt.py b/pyload/plugin/crypter/DevhostSt.py index 4fb82e0ad..46d33885f 100644 --- a/pyload/plugin/crypter/DevhostSt.py +++ b/pyload/plugin/crypter/DevhostSt.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Test links: -# http://d-h.st/users/shine/?fld_id=37263#files +# http://d-h.st/users/shine/?fld_id=37263#files import re diff --git a/pyload/plugin/crypter/LinkCryptWs.py b/pyload/plugin/crypter/LinkCryptWs.py index 79a59889a..c997cbf9f 100644 --- a/pyload/plugin/crypter/LinkCryptWs.py +++ b/pyload/plugin/crypter/LinkCryptWs.py @@ -74,7 +74,7 @@ class LinkCryptWs(Crypter): # Get package name and folder package_name, folder_name = self.getPackageInfo() - #get the container definitions from script section + # get the container definitions from script section self.get_container_html() # Extract package links @@ -238,7 +238,7 @@ class LinkCryptWs(Crypter): self.logDebug('Search for %s Container links' % type.upper()) - if not type.isalnum(): # check to prevent broken re-pattern (cnl2,rsdf,ccf,dlc,web are all alpha-numeric) + if not type.isalnum(): #: check to prevent broken re-pattern (cnl2,rsdf,ccf,dlc,web are all alpha-numeric) self.fail(_("Unknown container type: %s") % type) #@TODO: Replace with self.error in 0.4.10 for line in self.container_html: diff --git a/pyload/plugin/crypter/MediafireCom.py b/pyload/plugin/crypter/MediafireCom.py index 479d1a70a..aae727a90 100644 --- a/pyload/plugin/crypter/MediafireCom.py +++ b/pyload/plugin/crypter/MediafireCom.py @@ -46,7 +46,7 @@ class MediafireCom(Crypter): get={'folder_key' : folder_key, 'response_format': "json", 'version' : 1})) - #self.logInfo(json_resp) + # self.logInfo(json_resp) if json_resp['response']['result'] == "Success": for link in json_resp['response']['folder_info']['files']: self.urls.append("http://www.mediafire.com/file/%s" % link['quickkey']) diff --git a/pyload/plugin/crypter/NCryptIn.py b/pyload/plugin/crypter/NCryptIn.py index d59fbd6a9..bc9702f21 100644 --- a/pyload/plugin/crypter/NCryptIn.py +++ b/pyload/plugin/crypter/NCryptIn.py @@ -69,7 +69,7 @@ class NCryptIn(Crypter): # Extract package links for link_source_type in self.links_source_order: package_links.extend(self.handleLinkSource(link_source_type)) - if package_links: # use only first source which provides links + if package_links: #: use only first source which provides links break package_links = set(package_links) diff --git a/pyload/plugin/crypter/RelinkUs.py b/pyload/plugin/crypter/RelinkUs.py index 6296e9f40..2b9a85401 100644 --- a/pyload/plugin/crypter/RelinkUs.py +++ b/pyload/plugin/crypter/RelinkUs.py @@ -89,7 +89,7 @@ class RelinkUs(Crypter): package_links = [] for sources in self.PREFERRED_LINK_SOURCES: package_links.extend(self.handleLinkSource(sources)) - if package_links: # use only first source which provides links + if package_links: #: use only first source which provides links break package_links = set(package_links) diff --git a/pyload/plugin/crypter/YoutubeComFolder.py b/pyload/plugin/crypter/YoutubeComFolder.py index 84277207a..220c1dfbb 100644 --- a/pyload/plugin/crypter/YoutubeComFolder.py +++ b/pyload/plugin/crypter/YoutubeComFolder.py @@ -43,7 +43,7 @@ class YoutubeComFolder(Crypter): return {"id": channel['id'], "title": channel['snippet']['title'], "relatedPlaylists": channel['contentDetails']['relatedPlaylists'], - "user": user} # One lone channel for user? + "user": user} #: One lone channel for user? def getPlaylist(self, p_id): diff --git a/pyload/plugin/extractor/SevenZip.py b/pyload/plugin/extractor/SevenZip.py index 9d01965e0..3c5e86602 100644 --- a/pyload/plugin/extractor/SevenZip.py +++ b/pyload/plugin/extractor/SevenZip.py @@ -134,11 +134,11 @@ class SevenZip(UnRar): def call_cmd(self, command, *xargs, **kwargs): args = [] - #overwrite flag + # overwrite flag if self.overwrite: args.append("-y") - #set a password + # set a password if "password" in kwargs and kwargs['password']: args.append("-p%s" % kwargs['password']) else: diff --git a/pyload/plugin/extractor/UnRar.py b/pyload/plugin/extractor/UnRar.py index cad58ff4f..38ae4e8f2 100644 --- a/pyload/plugin/extractor/UnRar.py +++ b/pyload/plugin/extractor/UnRar.py @@ -81,7 +81,7 @@ class UnRar(Extractor): @classmethod def isMultipart(cls, filename): - return True if cls.re_multipart.search(filename) else False + return cls.re_multipart.search(filename) is not None def verify(self, password): diff --git a/pyload/plugin/hook/BypassCaptcha.py b/pyload/plugin/hook/BypassCaptcha.py index 545ec5e31..95be5f3a6 100644 --- a/pyload/plugin/hook/BypassCaptcha.py +++ b/pyload/plugin/hook/BypassCaptcha.py @@ -57,7 +57,7 @@ class BypassCaptcha(Hook): def submit(self, captcha, captchaType="file", match=None): req = getRequest() - #raise timeout threshold + # raise timeout threshold req.c.setopt(LOW_SPEED_TIME, 80) try: diff --git a/pyload/plugin/hook/ExpertDecoders.py b/pyload/plugin/hook/ExpertDecoders.py index 2e2982d2d..843c786bc 100644 --- a/pyload/plugin/hook/ExpertDecoders.py +++ b/pyload/plugin/hook/ExpertDecoders.py @@ -54,7 +54,7 @@ class ExpertDecoders(Hook): data = f.read() req = getRequest() - #raise timeout threshold + # raise timeout threshold req.c.setopt(LOW_SPEED_TIME, 80) try: diff --git a/pyload/plugin/hook/ImageTyperz.py b/pyload/plugin/hook/ImageTyperz.py index 641016546..c134cdaeb 100644 --- a/pyload/plugin/hook/ImageTyperz.py +++ b/pyload/plugin/hook/ImageTyperz.py @@ -69,7 +69,7 @@ class ImageTyperz(Hook): def submit(self, captcha, captchaType="file", match=None): req = getRequest() - #raise timeout threshold + # raise timeout threshold req.c.setopt(LOW_SPEED_TIME, 80) try: diff --git a/pyload/plugin/hook/MegaDebridEu.py b/pyload/plugin/hook/MegaDebridEu.py index a069cbcdd..41abce37b 100644 --- a/pyload/plugin/hook/MegaDebridEu.py +++ b/pyload/plugin/hook/MegaDebridEu.py @@ -28,6 +28,6 @@ class MegaDebridEu(MultiHook): host_list = [element[0] for element in json_data['hosters']] else: self.logError(_("Unable to retrieve hoster list")) - host_list = list() + host_list = [] return host_list diff --git a/pyload/plugin/hook/XFileSharingPro.py b/pyload/plugin/hook/XFileSharingPro.py index 3c16c618a..7fee029da 100644 --- a/pyload/plugin/hook/XFileSharingPro.py +++ b/pyload/plugin/hook/XFileSharingPro.py @@ -32,11 +32,11 @@ class XFileSharingPro(Hook): "backin.net", "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "fileparadox.in", "filevice.com", "hostingbulk.com", "junkyvideo.com", "linestorage.com", "ravishare.com", "ryushare.com", "salefiles.com", "sendmyway.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", - #NOT TESTED: + # NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", "vidbull.com", "zalaa.com", "zomgupload.com", - #NOT WORKING: + # NOT WORKING: "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] CRYPTER_BUILTIN = ["junocloud.me", "rapidfileshare.net"] diff --git a/pyload/plugin/hoster/BezvadataCz.py b/pyload/plugin/hoster/BezvadataCz.py index 3eab28ae6..fa29c83d5 100644 --- a/pyload/plugin/hoster/BezvadataCz.py +++ b/pyload/plugin/hoster/BezvadataCz.py @@ -29,13 +29,13 @@ class BezvadataCz(SimpleHoster): def handleFree(self, pyfile): - #download button + # download button m = re.search(r'<a class="stahnoutSoubor".*?href="(.*?)"', self.html) if m is None: self.error(_("Page 1 URL not found")) url = "http://bezvadata.cz%s" % m.group(1) - #captcha form + # captcha form self.html = self.load(url) self.checkErrors() for _i in xrange(5): @@ -47,7 +47,7 @@ class BezvadataCz(SimpleHoster): if m is None: self.error(_("Wrong captcha image")) - #captcha image is contained in html page as base64encoded data but decryptCaptcha() expects image url + # captcha image is contained in html page as base64encoded data but decryptCaptcha() expects image url self.load, proper_load = self.loadcaptcha, self.load try: inputs['captcha'] = self.decryptCaptcha(m.group(1), imgtype='png') @@ -62,7 +62,7 @@ class BezvadataCz(SimpleHoster): else: self.fail(_("No valid captcha code entered")) - #download url + # download url self.html = self.load("http://bezvadata.cz%s" % action, post=inputs) self.checkErrors() m = re.search(r'<a class="stahnoutSoubor2" href="(.*?)">', self.html) @@ -71,7 +71,7 @@ class BezvadataCz(SimpleHoster): url = "http://bezvadata.cz%s" % m.group(1) self.logDebug("DL URL %s" % url) - #countdown + # countdown m = re.search(r'id="countdown">(\d\d):(\d\d)<', self.html) wait_time = (int(m.group(1)) * 60 + int(m.group(2))) if m else 120 self.wait(wait_time, False) diff --git a/pyload/plugin/hoster/CzshareCom.py b/pyload/plugin/hoster/CzshareCom.py index da9aa68d5..9926c8d74 100644 --- a/pyload/plugin/hoster/CzshareCom.py +++ b/pyload/plugin/hoster/CzshareCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Test links: -# http://czshare.com/5278880/random.bin +# http://czshare.com/5278880/random.bin import re diff --git a/pyload/plugin/hoster/DataHu.py b/pyload/plugin/hoster/DataHu.py index 1f44e62e5..ba3576d10 100644 --- a/pyload/plugin/hoster/DataHu.py +++ b/pyload/plugin/hoster/DataHu.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Test links: -# http://data.hu/get/6381232/random.bin +# http://data.hu/get/6381232/random.bin import re diff --git a/pyload/plugin/hoster/DlFreeFr.py b/pyload/plugin/hoster/DlFreeFr.py index 151d0ca9f..684da2b6d 100644 --- a/pyload/plugin/hoster/DlFreeFr.py +++ b/pyload/plugin/hoster/DlFreeFr.py @@ -117,7 +117,7 @@ class DlFreeFr(SimpleHoster): def getLastHeaders(self): - #parse header + # parse header header = {"code": self.req.code} for line in self.req.http.header.splitlines(): line = line.strip() diff --git a/pyload/plugin/hoster/FileomCom.py b/pyload/plugin/hoster/FileomCom.py index bac912c56..b01b34db0 100644 --- a/pyload/plugin/hoster/FileomCom.py +++ b/pyload/plugin/hoster/FileomCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Test links: -# http://fileom.com/gycaytyzdw3g/random.bin.html +# http://fileom.com/gycaytyzdw3g/random.bin.html from pyload.plugin.internal.XFSHoster import XFSHoster diff --git a/pyload/plugin/hoster/FilepupNet.py b/pyload/plugin/hoster/FilepupNet.py index 72237285c..91d640e00 100644 --- a/pyload/plugin/hoster/FilepupNet.py +++ b/pyload/plugin/hoster/FilepupNet.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # # Test links: -# http://www.filepup.net/files/k5w4ZVoF1410184283.html -# http://www.filepup.net/files/R4GBq9XH1410186553.html +# http://www.filepup.net/files/k5w4ZVoF1410184283.html +# http://www.filepup.net/files/R4GBq9XH1410186553.html import re diff --git a/pyload/plugin/hoster/FilerNet.py b/pyload/plugin/hoster/FilerNet.py index 86a5809da..fbefba8db 100644 --- a/pyload/plugin/hoster/FilerNet.py +++ b/pyload/plugin/hoster/FilerNet.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # # Test links: -# http://filer.net/get/ivgf5ztw53et3ogd -# http://filer.net/get/hgo14gzcng3scbvv +# http://filer.net/get/ivgf5ztw53et3ogd +# http://filer.net/get/hgo14gzcng3scbvv import pycurl import re diff --git a/pyload/plugin/hoster/FilesMailRu.py b/pyload/plugin/hoster/FilesMailRu.py index 024da64cd..0d7f47536 100644 --- a/pyload/plugin/hoster/FilesMailRu.py +++ b/pyload/plugin/hoster/FilesMailRu.py @@ -49,17 +49,17 @@ class FilesMailRu(Hoster): self.html = self.load(pyfile.url) self.url_pattern = '<a href="(.+?)" onclick="return Act\(this\, \'dlink\'\, event\)">(.+?)</a>' - #marks the file as "offline" when the pattern was found on the html-page''' + # marks the file as "offline" when the pattern was found on the html-page''' if r'<div class="errorMessage mb10">' in self.html: self.offline() elif r'Page cannot be displayed' in self.html: self.offline() - #the filename that will be showed in the list (e.g. test.part1.rar)''' + # the filename that will be showed in the list (e.g. test.part1.rar)''' pyfile.name = self.getFileName() - #prepare and download''' + # prepare and download''' if not self.account: self.prepare() self.download(self.getFileUrl()) diff --git a/pyload/plugin/hoster/FileserveCom.py b/pyload/plugin/hoster/FileserveCom.py index 5f93cbd10..1d4179e5c 100644 --- a/pyload/plugin/hoster/FileserveCom.py +++ b/pyload/plugin/hoster/FileserveCom.py @@ -134,7 +134,7 @@ class FileserveCom(Hoster): self.wait() self.retry() - self.thread.m.reconnecting.wait(3) # Ease issue with later downloads appearing to be in parallel + self.thread.m.reconnecting.wait(3) #: Ease issue with later downloads appearing to be in parallel def doTimmer(self): @@ -185,7 +185,7 @@ class FileserveCom(Hoster): def handlePremium(self, pyfile): premium_url = None if self.getClassName() == "FileserveCom": - #try api download + # try api download res = self.load("http://app.fileserve.com/api/download/premium/", post={"username": self.user, "password": self.account.getAccountData(self.user)['password'], diff --git a/pyload/plugin/hoster/FreakshareCom.py b/pyload/plugin/hoster/FreakshareCom.py index 64d8f8308..6cf447128 100644 --- a/pyload/plugin/hoster/FreakshareCom.py +++ b/pyload/plugin/hoster/FreakshareCom.py @@ -87,7 +87,7 @@ class FreakshareCom(Hoster): def download_html(self): - self.load("http://freakshare.com/index.php", {"language": "EN"}) # Set english language in server session + self.load("http://freakshare.com/index.php", {"language": "EN"}) #: Set english language in server session self.html = self.load(self.pyfile.url) @@ -97,9 +97,9 @@ class FreakshareCom(Hoster): if not self.html: self.download_html() if not self.wantReconnect: - self.req_opts = self.get_download_options() # get the Post options for the Request - #file_url = self.pyfile.url - #return file_url + self.req_opts = self.get_download_options() #: get the Post options for the Request + # file_url = self.pyfile.url + # return file_url else: self.offline() @@ -163,11 +163,11 @@ class FreakshareCom(Hoster): def get_download_options(self): re_envelope = re.search(r".*?value=\"Free\sDownload\".*?\n*?(.*?<.*?>\n*)*?\n*\s*?</form>", - self.html).group(0) # get the whole request + self.html).group(0) #: get the whole request to_sort = re.findall(r"<input\stype=\"hidden\"\svalue=\"(.*?)\"\sname=\"(.*?)\"\s\/>", re_envelope) request_options = dict((n, v) for (v, n) in to_sort) - herewego = self.load(self.pyfile.url, None, request_options) # the actual download-Page + herewego = self.load(self.pyfile.url, None, request_options) #: the actual download-Page to_sort = re.findall(r"<input\stype=\".*?\"\svalue=\"(\S*?)\".*?name=\"(\S*?)\"\s.*?\/>", herewego) request_options = dict((n, v) for (v, n) in to_sort) diff --git a/pyload/plugin/hoster/Ftp.py b/pyload/plugin/hoster/Ftp.py index 42ef3c357..86049df04 100644 --- a/pyload/plugin/hoster/Ftp.py +++ b/pyload/plugin/hoster/Ftp.py @@ -64,12 +64,12 @@ class Ftp(Hoster): pyfile.size = int(m.group(1)) self.download(pyfile.url) else: - #Naive ftp directory listing + # Naive ftp directory listing if re.search(r'^25\d.*?"', self.req.http.header, re.M): pyfile.url = pyfile.url.rstrip('/') pkgname = "/".join(pyfile.package().name, urlparse(pyfile.url).path.rpartition('/')[2]) pyfile.url += '/' - self.req.http.c.setopt(48, 1) # CURLOPT_DIRLISTONLY + self.req.http.c.setopt(48, 1) #: CURLOPT_DIRLISTONLY res = self.load(pyfile.url, decode=False) links = [pyfile.url + quote(x) for x in res.splitlines()] self.logDebug("LINKS", links) diff --git a/pyload/plugin/hoster/GooIm.py b/pyload/plugin/hoster/GooIm.py index 8fd958660..322dd6101 100644 --- a/pyload/plugin/hoster/GooIm.py +++ b/pyload/plugin/hoster/GooIm.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Test links: -# https://goo.im/devs/liquidsmooth/3.x/codina/Nightly/LS-KK-v3.2-2014-08-01-codina.zip +# https://goo.im/devs/liquidsmooth/3.x/codina/Nightly/LS-KK-v3.2-2014-08-01-codina.zip import re diff --git a/pyload/plugin/hoster/LetitbitNet.py b/pyload/plugin/hoster/LetitbitNet.py index 0cfc225e4..35f5f9cf4 100644 --- a/pyload/plugin/hoster/LetitbitNet.py +++ b/pyload/plugin/hoster/LetitbitNet.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # # API Documentation: -# http://api.letitbit.net/reg/static/api.pdf +# http://api.letitbit.net/reg/static/api.pdf # # Test links: -# http://letitbit.net/download/07874.0b5709a7d3beee2408bb1f2eefce/random.bin.html +# http://letitbit.net/download/07874.0b5709a7d3beee2408bb1f2eefce/random.bin.html import re diff --git a/pyload/plugin/hoster/LoadTo.py b/pyload/plugin/hoster/LoadTo.py index 0b4d40fe9..3a625dbe3 100644 --- a/pyload/plugin/hoster/LoadTo.py +++ b/pyload/plugin/hoster/LoadTo.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # # Test links: -# http://www.load.to/JWydcofUY6/random.bin -# http://www.load.to/oeSmrfkXE/random100.bin +# http://www.load.to/JWydcofUY6/random.bin +# http://www.load.to/oeSmrfkXE/random100.bin import re diff --git a/pyload/plugin/hoster/MegaCoNz.py b/pyload/plugin/hoster/MegaCoNz.py index 496d4503f..9dea99b23 100644 --- a/pyload/plugin/hoster/MegaCoNz.py +++ b/pyload/plugin/hoster/MegaCoNz.py @@ -126,8 +126,8 @@ class MegaCoNz(Hoster): except IOError, e: self.fail(e) - chunk_size = 2 ** 15 # buffer size, 32k - # file_mac = [0, 0, 0, 0] # calculate CBC-MAC for checksum + chunk_size = 2 ** 15 #: buffer size, 32k + # file_mac = [0, 0, 0, 0] #: calculate CBC-MAC for checksum chunks = os.path.getsize(file_crypted) / chunk_size + 1 for i in xrange(chunks): diff --git a/pyload/plugin/hoster/MegaRapidoNet.py b/pyload/plugin/hoster/MegaRapidoNet.py index 311189d1c..54a167b65 100644 --- a/pyload/plugin/hoster/MegaRapidoNet.py +++ b/pyload/plugin/hoster/MegaRapidoNet.py @@ -8,7 +8,7 @@ from pyload.plugin.internal.MultiHoster import MultiHoster def random_with_N_digits(n): rand = "0." not_zero = 0 - for _i in range(1, n + 1): + for _i in xrange(1, n + 1): r = randint(0, 9) if(r > 0): not_zero += 1 diff --git a/pyload/plugin/hoster/NetloadIn.py b/pyload/plugin/hoster/NetloadIn.py index 51bc2a600..f4421615f 100644 --- a/pyload/plugin/hoster/NetloadIn.py +++ b/pyload/plugin/hoster/NetloadIn.py @@ -120,7 +120,7 @@ class NetloadIn(Hoster): match = id_regex.search(url) if match: - #normalize url + # normalize url self.url = 'http://www.netload.in/datei%s.htm' % match.group('ID') self.logDebug("URL: %s" % self.url) else: @@ -152,9 +152,9 @@ class NetloadIn(Hoster): if self.api_data['status'] == "online": self.api_data['checksum'] = lines[4].strip() else: - self.api_data = False # check manually since api data is useless sometimes + self.api_data = False #: check manually since api data is useless sometimes - if lines[0] == lines[1] and lines[2] == "0": # useless api data + if lines[0] == lines[1] and lines[2] == "0": #: useless api data self.api_data = False else: self.api_data = False diff --git a/pyload/plugin/hoster/NovafileCom.py b/pyload/plugin/hoster/NovafileCom.py index 82f92959b..f76d77269 100644 --- a/pyload/plugin/hoster/NovafileCom.py +++ b/pyload/plugin/hoster/NovafileCom.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # # Test links: -# http://novafile.com/vfun4z6o2cit -# http://novafile.com/s6zrr5wemuz4 +# http://novafile.com/vfun4z6o2cit +# http://novafile.com/s6zrr5wemuz4 from pyload.plugin.internal.XFSHoster import XFSHoster diff --git a/pyload/plugin/hoster/OboomCom.py b/pyload/plugin/hoster/OboomCom.py index 07c40a397..5b9b11485 100644 --- a/pyload/plugin/hoster/OboomCom.py +++ b/pyload/plugin/hoster/OboomCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Test links: -# https://www.oboom.com/B7CYZIEB/10Mio.dat +# https://www.oboom.com/B7CYZIEB/10Mio.dat import re @@ -99,7 +99,7 @@ class OboomCom(Hoster): self.retry(5, 15 * 60, _("Service unavailable")) elif result[0] == 403: - if result[1] == -1: # another download is running + if result[1] == -1: #: another download is running self.setWait(15 * 60) else: self.setWait(result[1], True) diff --git a/pyload/plugin/hoster/PornhostCom.py b/pyload/plugin/hoster/PornhostCom.py index f6a63117c..103882166 100644 --- a/pyload/plugin/hoster/PornhostCom.py +++ b/pyload/plugin/hoster/PornhostCom.py @@ -47,7 +47,7 @@ class PornhostCom(Hoster): url = re.search(r'width: 894px; height: 675px">.*?<img src="(.*?)"', self.html) if url is None: url = re.search(r'"http://file\d+\.pornhost\.com/\d+/.*?"', - self.html) # TODO: fix this one since it doesn't match + self.html) #: TODO: fix this one since it doesn't match return url.group(1).strip() diff --git a/pyload/plugin/hoster/PremiumTo.py b/pyload/plugin/hoster/PremiumTo.py index c7ee09565..750e965d2 100644 --- a/pyload/plugin/hoster/PremiumTo.py +++ b/pyload/plugin/hoster/PremiumTo.py @@ -27,7 +27,7 @@ class PremiumTo(MultiHoster): def handlePremium(self, pyfile): - #raise timeout to 2min + # raise timeout to 2min self.download("http://premium.to/api/getfile.php", get={'username': self.account.username, 'password': self.account.password, diff --git a/pyload/plugin/hoster/PremiumizeMe.py b/pyload/plugin/hoster/PremiumizeMe.py index 809d27624..f577da90e 100644 --- a/pyload/plugin/hoster/PremiumizeMe.py +++ b/pyload/plugin/hoster/PremiumizeMe.py @@ -20,7 +20,7 @@ class PremiumizeMe(MultiHoster): def handlePremium(self, pyfile): # In some cases hostsers do not supply us with a filename at download, so we # are going to set a fall back filename (e.g. for freakshare or xfileshare) - pyfile.name = pyfile.name.split('/').pop() # Remove everthing before last slash + pyfile.name = pyfile.name.split('/').pop() #: Remove everthing before last slash # Correction for automatic assigned filename: Removing html at end if needed suffix_to_remove = ["html", "htm", "php", "php3", "asp", "shtm", "shtml", "cfml", "cfm"] diff --git a/pyload/plugin/hoster/RPNetBiz.py b/pyload/plugin/hoster/RPNetBiz.py index 6788eebce..dc11eefb2 100644 --- a/pyload/plugin/hoster/RPNetBiz.py +++ b/pyload/plugin/hoster/RPNetBiz.py @@ -34,12 +34,12 @@ class RPNetBiz(MultiHoster): "links" : pyfile.url}) self.logDebug("JSON data: %s" % res) - link_status = json_loads(res)['links'][0] # get the first link... since we only queried one + link_status = json_loads(res)['links'][0] #: get the first link... since we only queried one # Check if we only have an id as a HDD link if 'id' in link_status: self.logDebug("Need to wait at least 30 seconds before requery") - self.setWait(30) # wait for 30 seconds + self.setWait(30) #: wait for 30 seconds self.wait() # Lets query the server again asking for the status on the link, # we need to keep doing this until we reach 100 @@ -66,7 +66,7 @@ class RPNetBiz(MultiHoster): self.wait() my_try += 1 - if my_try > max_tries: # We went over the limit! + if my_try > max_tries: #: We went over the limit! self.fail(_("Waited for about 15 minutes for download to finish but failed")) if 'generated' in link_status: diff --git a/pyload/plugin/hoster/RemixshareCom.py b/pyload/plugin/hoster/RemixshareCom.py index 6e376fd6d..ba61887cd 100644 --- a/pyload/plugin/hoster/RemixshareCom.py +++ b/pyload/plugin/hoster/RemixshareCom.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- # # Test links: -# http://remixshare.com/download/z8uli +# http://remixshare.com/download/z8uli # # 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/pyload/network/HTTPRequest.py +# The remixshare.com website is very very slow, so +# if your download not starts because of pycurl timeouts: +# Adjust timeouts in /usr/share/pyload/pyload/network/HTTPRequest.py import re diff --git a/pyload/plugin/hoster/ShareplaceCom.py b/pyload/plugin/hoster/ShareplaceCom.py index 7d9630d20..08fb966b8 100644 --- a/pyload/plugin/hoster/ShareplaceCom.py +++ b/pyload/plugin/hoster/ShareplaceCom.py @@ -40,7 +40,7 @@ class ShareplaceCom(Hoster): if not self.html: self.download_html() - #var zzipitime = 15; + # var zzipitime = 15; m = re.search(r'var zzipitime = (\d+);', self.html) if m: sec = int(m.group(1)) diff --git a/pyload/plugin/hoster/SimplydebridCom.py b/pyload/plugin/hoster/SimplydebridCom.py index 2fa68b508..d703c3e52 100644 --- a/pyload/plugin/hoster/SimplydebridCom.py +++ b/pyload/plugin/hoster/SimplydebridCom.py @@ -19,7 +19,7 @@ class SimplydebridCom(MultiHoster): def handlePremium(self, pyfile): - #fix the links for simply-debrid.com! + # fix the links for simply-debrid.com! self.link = replace_patterns(pyfile.url, [("clz.to", "cloudzer.net/file") ("http://share-online", "http://www.share-online") ("ul.to", "uploaded.net/file") diff --git a/pyload/plugin/hoster/SmoozedCom.py b/pyload/plugin/hoster/SmoozedCom.py index 1ed3a539d..f216a95bc 100644 --- a/pyload/plugin/hoster/SmoozedCom.py +++ b/pyload/plugin/hoster/SmoozedCom.py @@ -20,7 +20,7 @@ class SmoozedCom(MultiHoster): def handlePremium(self, pyfile): # In some cases hostsers do not supply us with a filename at download, so we # are going to set a fall back filename (e.g. for freakshare or xfileshare) - pyfile.name = pyfile.name.split('/').pop() # Remove everthing before last slash + pyfile.name = pyfile.name.split('/').pop() #: Remove everthing before last slash # Correction for automatic assigned filename: Removing html at end if needed suffix_to_remove = ["html", "htm", "php", "php3", "asp", "shtm", "shtml", "cfml", "cfm"] diff --git a/pyload/plugin/hoster/SolidfilesCom.py b/pyload/plugin/hoster/SolidfilesCom.py index 39e5dd010..9998f26ad 100644 --- a/pyload/plugin/hoster/SolidfilesCom.py +++ b/pyload/plugin/hoster/SolidfilesCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Test links: -# http://www.solidfiles.com/d/609cdb4b1b +# http://www.solidfiles.com/d/609cdb4b1b from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/hoster/SpeedyshareCom.py b/pyload/plugin/hoster/SpeedyshareCom.py index 99626c765..b6d0a5898 100644 --- a/pyload/plugin/hoster/SpeedyshareCom.py +++ b/pyload/plugin/hoster/SpeedyshareCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Test links: -# http://speedy.sh/ep2qY/Zapp-Brannigan.jpg +# http://speedy.sh/ep2qY/Zapp-Brannigan.jpg import re diff --git a/pyload/plugin/hoster/UlozTo.py b/pyload/plugin/hoster/UlozTo.py index b2e31dccf..49d5d2ac1 100644 --- a/pyload/plugin/hoster/UlozTo.py +++ b/pyload/plugin/hoster/UlozTo.py @@ -123,7 +123,7 @@ class UlozTo(SimpleHoster): "wrong_captcha": re.compile(r'<ul class="error">\s*<li>Error rewriting the text.</li>'), "offline" : re.compile(self.OFFLINE_PATTERN), "passwd" : self.PASSWD_PATTERN, - "server_error" : 'src="http://img.ulozto.cz/error403/vykricnik.jpg"', # paralell dl, server overload etc. + "server_error" : 'src="http://img.ulozto.cz/error403/vykricnik.jpg"', #: paralell dl, server overload etc. "not_found" : "<title>Ulož.to</title>" }) diff --git a/pyload/plugin/hoster/UploadedTo.py b/pyload/plugin/hoster/UploadedTo.py index 487c01576..c8b201ec6 100644 --- a/pyload/plugin/hoster/UploadedTo.py +++ b/pyload/plugin/hoster/UploadedTo.py @@ -57,7 +57,7 @@ class UploadedTo(SimpleHoster): def setup(self): self.multiDL = self.resumeDownload = self.premium - self.chunkLimit = 1 # critical problems with more chunks + self.chunkLimit = 1 #: critical problems with more chunks def checkErrors(self): @@ -68,14 +68,14 @@ class UploadedTo(SimpleHoster): elif "limit-size" in self.html: self.fail(_("File too big for free download")) - elif "limit-slot" in self.html: # Temporary restriction so just wait a bit + elif "limit-slot" in self.html: #: Temporary restriction so just wait a bit self.wait(30 * 60, True) self.retry() elif "limit-parallel" in self.html: self.fail(_("Cannot download in parallel")) - elif "limit-dl" in self.html or self.DL_LIMIT_ERROR in self.html: # limit-dl + elif "limit-dl" in self.html or self.DL_LIMIT_ERROR in self.html: #: limit-dl self.wait(3 * 60 * 60, True) self.retry() diff --git a/pyload/plugin/hoster/UploadheroCom.py b/pyload/plugin/hoster/UploadheroCom.py index 912f4c505..d1c9fd2c7 100644 --- a/pyload/plugin/hoster/UploadheroCom.py +++ b/pyload/plugin/hoster/UploadheroCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Test links: -# http://uploadhero.co/dl/wQBRAVSM +# http://uploadhero.co/dl/wQBRAVSM import re diff --git a/pyload/plugin/hoster/VidPlayNet.py b/pyload/plugin/hoster/VidPlayNet.py index ab571f9ea..5d98d2fb3 100644 --- a/pyload/plugin/hoster/VidPlayNet.py +++ b/pyload/plugin/hoster/VidPlayNet.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Test links: -# BigBuckBunny_320x180.mp4 - 61.7 Mb - http://vidplay.net/38lkev0h3jv0 +# http://vidplay.net/38lkev0h3jv0 from pyload.plugin.internal.XFSHoster import XFSHoster diff --git a/pyload/plugin/hoster/Xdcc.py b/pyload/plugin/hoster/Xdcc.py index 30c7b7c22..6943f495e 100644 --- a/pyload/plugin/hoster/Xdcc.py +++ b/pyload/plugin/hoster/Xdcc.py @@ -29,7 +29,7 @@ class Xdcc(Hoster): def setup(self): - self.debug = 0 # 0,1,2 + self.debug = 0 #: 0,1,2 self.timeout = 30 self.multiDL = False @@ -62,7 +62,7 @@ class Xdcc(Hoster): def doDownload(self, url): - self.pyfile.setStatus("waiting") # real link + self.pyfile.setStatus("waiting") #: real link m = re.match(r'xdcc://(.*?)/#?(.*?)/(.*?)/#?(\d+)/?', url) server = m.group(1) @@ -89,7 +89,7 @@ class Xdcc(Hoster): sock = socket.socket() sock.connect((host, int(port))) if nick == "pyload": - nick = "pyload-%d" % (time.time() % 1000) # last 3 digits + nick = "pyload-%d" % (time.time() % 1000) #: last 3 digits sock.send("NICK %s\r\n" % nick) sock.send("USER %s %s bla :%s\r\n" % (ident, host, real)) @@ -161,7 +161,7 @@ class Xdcc(Hoster): self.logDebug("Sending CTCP TIME") sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time.time())) elif msg['text'] == "\x01LAG\x01": - pass # don't know how to answer + pass #: don't know how to answer if not (bot == msg['origin'][0:len(bot)] and nick == msg['target'][0:len(nick)] diff --git a/pyload/plugin/hoster/YourfilesTo.py b/pyload/plugin/hoster/YourfilesTo.py index a3d5e310c..f5e778741 100644 --- a/pyload/plugin/hoster/YourfilesTo.py +++ b/pyload/plugin/hoster/YourfilesTo.py @@ -41,7 +41,7 @@ class YourfilesTo(Hoster): if not self.html: self.download_html() - #var zzipitime = 15; + # var zzipitime = 15; m = re.search(r'var zzipitime = (\d+);', self.html) if m: sec = int(m.group(1)) diff --git a/pyload/plugin/hoster/YoutubeCom.py b/pyload/plugin/hoster/YoutubeCom.py index 14503be03..5db9957f8 100644 --- a/pyload/plugin/hoster/YoutubeCom.py +++ b/pyload/plugin/hoster/YoutubeCom.py @@ -94,7 +94,7 @@ class YoutubeCom(Hoster): if "We have been receiving a large volume of requests from your network." in html: self.tempOffline() - #get config + # get config use3d = self.getConfig('3d') if use3d: @@ -113,7 +113,7 @@ class YoutubeCom(Hoster): self.logWarning(_("FMT %d unknown, using default") % desired_fmt) desired_fmt = 0 - #parse available streams + # parse available streams streams = re.search(r'"url_encoded_fmt_stream_map":"(.+?)",', html).group(1) streams = [x.split('\u0026') for x in streams.split(',')] streams = [dict((y.split('=', 1)) for y in x) for x in streams] @@ -123,7 +123,7 @@ class YoutubeCom(Hoster): self.logDebug("AVAILABLE STREAMS: %s" % [x[0] for x in streams]) - #build dictionary of supported itags (3D/2D) + # build dictionary of supported itags (3D/2D) allowed = lambda x: self.getConfig(self.formats[x][0]) streams = [x for x in streams if x[0] in self.formats and allowed(x[0])] @@ -136,11 +136,11 @@ class YoutubeCom(Hoster): (desired_fmt, "%s %dx%d Q:%d 3D:%s" % self.formats[desired_fmt], "" if desired_fmt in fmt_dict else "NOT ", "" if allowed(desired_fmt) else "NOT ")) - #return fmt nearest to quality index + # return fmt nearest to quality index if desired_fmt in fmt_dict and allowed(desired_fmt): fmt = desired_fmt else: - sel = lambda x: self.formats[x][3] # select quality index + sel = lambda x: self.formats[x][3] #: select quality index comp = lambda x, y: abs(sel(x) - sel(y)) self.logDebug("Choosing nearest fmt: %s" % [(x, allowed(x), comp(x, desired_fmt)) for x in fmt_dict.keys()]) @@ -154,7 +154,7 @@ class YoutubeCom(Hoster): self.logDebug("URL: %s" % url) - #set file name + # set file name file_suffix = self.formats[fmt][0] if fmt in self.formats else ".flv" file_name_pattern = '<meta name="title" content="(.+?)">' name = re.search(file_name_pattern, html).group(1).replace("/", "") diff --git a/pyload/plugin/hoster/ZippyshareCom.py b/pyload/plugin/hoster/ZippyshareCom.py index dd78071c9..7f91c04e5 100644 --- a/pyload/plugin/hoster/ZippyshareCom.py +++ b/pyload/plugin/hoster/ZippyshareCom.py @@ -68,7 +68,7 @@ class ZippyshareCom(SimpleHoster): def replElementById(element): id = element.group(1) #: id might be either 'x' (a real id) or x (a variable) - attr = element.group(4) # attr might be None + attr = element.group(4) #: attr might be None varName = re.sub(r'-', '', 'GVAR[%s+"_%s"]' %(id, attr)) diff --git a/pyload/plugin/internal/SimpleHoster.py b/pyload/plugin/internal/SimpleHoster.py index df98c1e67..75970d814 100644 --- a/pyload/plugin/internal/SimpleHoster.py +++ b/pyload/plugin/internal/SimpleHoster.py @@ -332,7 +332,7 @@ class SimpleHoster(Hoster): @classmethod def getInfo(cls, url="", html=""): info = cls.apiInfo(url) - online = False if info['status'] != 2 else True + online = info['status'] == 2 try: info['pattern'] = re.match(cls.__pattern, url).groupdict() #: pattern groups will be saved here diff --git a/pyload/plugin/internal/XFSAccount.py b/pyload/plugin/internal/XFSAccount.py index 13c2351ce..d8c5a91f1 100644 --- a/pyload/plugin/internal/XFSAccount.py +++ b/pyload/plugin/internal/XFSAccount.py @@ -67,7 +67,7 @@ class XFSAccount(Account): html = req.load(self.HOSTER_URL, get={'op': "my_account"}, decode=True) - premium = True if re.search(self.PREMIUM_PATTERN, html) else False + premium = re.search(self.PREMIUM_PATTERN, html) is not None m = re.search(self.VALID_UNTIL_PATTERN, html) if m: diff --git a/pyload/plugin/ocr/ShareonlineBiz.py b/pyload/plugin/ocr/ShareonlineBiz.py index b07653279..8efbdee35 100644 --- a/pyload/plugin/ocr/ShareonlineBiz.py +++ b/pyload/plugin/ocr/ShareonlineBiz.py @@ -23,8 +23,8 @@ class ShareonlineBiz(OCR): self.image = self.image.resize((160, 50)) self.pixels = self.image.load() self.threshold(1.85) - #self.eval_black_white(240) - #self.derotate_by_average() + # self.eval_black_white(240) + # self.derotate_by_average() letters = self.split_captcha_letters() @@ -36,4 +36,4 @@ class ShareonlineBiz(OCR): return final - #tesseract at 60% + # tesseract at 60% |