summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/crypter/FilefactoryComFolder.py2
-rw-r--r--module/plugins/hoster/CzshareCom.py2
-rw-r--r--module/plugins/hoster/DepositfilesCom.py4
-rw-r--r--module/plugins/hoster/EgoFilesCom.py2
-rw-r--r--module/plugins/hoster/FastshareCz.py2
-rw-r--r--module/plugins/hoster/FilefactoryCom.py2
-rw-r--r--module/plugins/hoster/FileomCom.py2
-rw-r--r--module/plugins/hoster/FilerNet.py4
-rw-r--r--module/plugins/hoster/GigapetaCom.py2
-rw-r--r--module/plugins/hoster/ShareRapidCom.py2
-rw-r--r--module/plugins/hoster/TurbobitNet.py2
-rw-r--r--module/plugins/hoster/TusfilesNet.py2
-rw-r--r--module/plugins/hoster/UploadheroCom.py2
-rw-r--r--module/plugins/hoster/VeohCom.py2
-rw-r--r--module/plugins/hoster/VimeoCom.py2
-rw-r--r--module/plugins/hoster/WrzucTo.py2
-rw-r--r--module/plugins/hoster/ZippyshareCom.py2
-rw-r--r--module/plugins/internal/SimpleCrypter.py10
-rw-r--r--module/plugins/internal/SimpleHoster.py28
19 files changed, 38 insertions, 38 deletions
diff --git a/module/plugins/crypter/FilefactoryComFolder.py b/module/plugins/crypter/FilefactoryComFolder.py
index 562c56732..b565b4d0b 100644
--- a/module/plugins/crypter/FilefactoryComFolder.py
+++ b/module/plugins/crypter/FilefactoryComFolder.py
@@ -18,7 +18,7 @@ class FilefactoryComFolder(SimpleCrypter):
TITLE_PATTERN = r'<h1>Files in <span>(?P<title>.+)</span></h1>'
PAGES_PATTERN = r'data-paginator-totalPages="(?P<pages>\d+)"'
- SH_COOKIES = [('.filefactory.com', 'locale', 'en_US.utf8')]
+ COOKIES = [('.filefactory.com', 'locale', 'en_US.utf8')]
def loadPage(self, page_n):
diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py
index 4f581651b..51627dc33 100644
--- a/module/plugins/hoster/CzshareCom.py
+++ b/module/plugins/hoster/CzshareCom.py
@@ -27,7 +27,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
+ FORCE_CHECK_TRAFFIC = True
FREE_URL_PATTERN = r'<a href="([^"]+)" class="page-download">[^>]*alt="([^"]+)" /></a>'
FREE_FORM_PATTERN = r'<form action="download.php" method="post">\s*<img src="captcha.php" id="captcha" />(.*?)</form>'
diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py
index e2b2d46fd..9ff8c22a1 100644
--- a/module/plugins/hoster/DepositfilesCom.py
+++ b/module/plugins/hoster/DepositfilesCom.py
@@ -27,7 +27,7 @@ class DepositfilesCom(SimpleHoster):
(r'.*<b title="(?P<N>[^"]+).*', "\g<N>")]
FILE_URL_REPLACEMENTS = [(__pattern__, "https://dfiles.eu/files/\g<ID>")]
- SH_COOKIES = [(".dfiles.eu", "lang_current", "en")]
+ COOKIES = [(".dfiles.eu", "lang_current", "en")]
RECAPTCHA_PATTERN = r"Recaptcha.create\('([^']+)'"
@@ -106,7 +106,7 @@ class DepositfilesCom(SimpleHoster):
self.retry(wait_time=60)
def handlePremium(self):
- self.html = self.load(self.pyfile.url, cookies=self.SH_COOKIES)
+ self.html = self.load(self.pyfile.url, cookies=self.COOKIES)
if '<span class="html_download_api-gold_traffic_limit">' in self.html:
self.logWarning("Download limit reached")
diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py
index 547f042e4..7f7104da1 100644
--- a/module/plugins/hoster/EgoFilesCom.py
+++ b/module/plugins/hoster/EgoFilesCom.py
@@ -32,7 +32,7 @@ class EgoFilesCom(SimpleHoster):
self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True)
def process(self, pyfile):
- if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()):
+ if self.premium and (not self.FORCE_CHECK_TRAFFIC or self.checkTrafficLeft()):
self.handlePremium()
else:
self.handleFree()
diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py
index 7a847fdc4..5a6773af6 100644
--- a/module/plugins/hoster/FastshareCz.py
+++ b/module/plugins/hoster/FastshareCz.py
@@ -26,7 +26,7 @@ class FastshareCz(SimpleHoster):
FILE_URL_REPLACEMENTS = [("#.*", "")]
- SH_COOKIES = [(".fastshare.cz", "lang", "en")]
+ 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+&)'
diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py
index 1ac7550fc..627e4dee9 100644
--- a/module/plugins/hoster/FilefactoryCom.py
+++ b/module/plugins/hoster/FilefactoryCom.py
@@ -33,7 +33,7 @@ class FilefactoryCom(SimpleHoster):
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")]
+ COOKIES = [(".filefactory.com", "locale", "en_US.utf8")]
def handleFree(self):
diff --git a/module/plugins/hoster/FileomCom.py b/module/plugins/hoster/FileomCom.py
index 2f876466b..3735daab3 100644
--- a/module/plugins/hoster/FileomCom.py
+++ b/module/plugins/hoster/FileomCom.py
@@ -20,7 +20,7 @@ class FileomCom(XFileSharingPro):
HOSTER_NAME = "fileom.com"
FILE_URL_REPLACEMENTS = [(r'/$', "")]
- SH_COOKIES = [(".fileom.com", "lang", "english")]
+ COOKIES = [(".fileom.com", "lang", "english")]
FILE_NAME_PATTERN = r'Filename: <span>(?P<N>.+?)<'
FILE_SIZE_PATTERN = r'File Size: <span class="size">(?P<S>[\d\.]+) (?P<U>\w+)'
diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py
index a36607f8a..b4cb314b6 100644
--- a/module/plugins/hoster/FilerNet.py
+++ b/module/plugins/hoster/FilerNet.py
@@ -31,14 +31,14 @@ class FilerNet(SimpleHoster):
def process(self, pyfile):
- if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()):
+ if self.premium and (not self.FORCE_CHECK_TRAFFIC or self.checkTrafficLeft()):
self.handlePremium()
else:
self.handleFree()
def handleFree(self):
self.req.setOption("timeout", 120)
- self.html = self.load(self.pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES)
+ self.html = self.load(self.pyfile.url, decode=not self.TEXT_ENCODING, cookies=self.COOKIES)
# Wait between downloads
m = re.search(r'musst du <span id="time">(\d+)</span> Sekunden warten', self.html)
diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py
index 966ac8094..5bbbeb80e 100644
--- a/module/plugins/hoster/GigapetaCom.py
+++ b/module/plugins/hoster/GigapetaCom.py
@@ -23,7 +23,7 @@ class GigapetaCom(SimpleHoster):
FILE_SIZE_PATTERN = r'<th>\s*Size\s*</th>\s*<td>\s*(?P<S>.*?)\s*</td>'
OFFLINE_PATTERN = r'<div id="page_error">'
- SH_COOKIES = [(".gigapeta.com", "lang", "us")]
+ COOKIES = [(".gigapeta.com", "lang", "us")]
def handleFree(self):
diff --git a/module/plugins/hoster/ShareRapidCom.py b/module/plugins/hoster/ShareRapidCom.py
index 414e92feb..9d77ba714 100644
--- a/module/plugins/hoster/ShareRapidCom.py
+++ b/module/plugins/hoster/ShareRapidCom.py
@@ -34,7 +34,7 @@ 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'
- SH_CHECK_TRAFFIC = True
+ FORCE_CHECK_TRAFFIC = True
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'
diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py
index a9cc46614..6b60d5bc8 100644
--- a/module/plugins/hoster/TurbobitNet.py
+++ b/module/plugins/hoster/TurbobitNet.py
@@ -31,7 +31,7 @@ class TurbobitNet(SimpleHoster):
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")]
+ COOKIES = [(".turbobit.net", "user_lang", "en")]
LINK_PATTERN = r'(?P<url>/download/redirect/[^"\']+)'
LIMIT_WAIT_PATTERN = r'<div id="time-limit-text">\s*.*?<span id=\'timeout\'>(\d+)</span>'
diff --git a/module/plugins/hoster/TusfilesNet.py b/module/plugins/hoster/TusfilesNet.py
index 350241ea9..1ea455399 100644
--- a/module/plugins/hoster/TusfilesNet.py
+++ b/module/plugins/hoster/TusfilesNet.py
@@ -19,7 +19,7 @@ class TusfilesNet(XFileSharingPro):
FILE_INFO_PATTERN = r'\](?P<N>.+) - (?P<S>[\d.]+) (?P<U>\w+)\['
OFFLINE_PATTERN = r'>File Not Found|<Title>TusFiles - Fast Sharing Files!'
- SH_COOKIES = [(".tusfiles.net", "lang", "english")]
+ COOKIES = [(".tusfiles.net", "lang", "english")]
def setup(self):
diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py
index e34701ed7..2fad623c1 100644
--- a/module/plugins/hoster/UploadheroCom.py
+++ b/module/plugins/hoster/UploadheroCom.py
@@ -23,7 +23,7 @@ class UploadheroCom(SimpleHoster):
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.'
- SH_COOKIES = [(".uploadhero.co", "lang", "en")]
+ COOKIES = [(".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>'
diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py
index fcd5e90a4..a965e5e77 100644
--- a/module/plugins/hoster/VeohCom.py
+++ b/module/plugins/hoster/VeohCom.py
@@ -22,7 +22,7 @@ class VeohCom(SimpleHoster):
FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.veoh.com/watch/\g<ID>')]
- SH_COOKIES = [(".veoh.com", "lassieLocale", "en")]
+ COOKIES = [(".veoh.com", "lassieLocale", "en")]
def setup(self):
diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py
index 145d9053f..923be59f7 100644
--- a/module/plugins/hoster/VimeoCom.py
+++ b/module/plugins/hoster/VimeoCom.py
@@ -24,7 +24,7 @@ class VimeoCom(SimpleHoster):
FILE_URL_REPLACEMENTS = [(__pattern__, r'https://www.vimeo.com/\g<ID>')]
- SH_COOKIES = [(".vimeo.com", "language", "en")]
+ COOKIES = [(".vimeo.com", "language", "en")]
def setup(self):
diff --git a/module/plugins/hoster/WrzucTo.py b/module/plugins/hoster/WrzucTo.py
index 3b26b1a02..4b63e0964 100644
--- a/module/plugins/hoster/WrzucTo.py
+++ b/module/plugins/hoster/WrzucTo.py
@@ -21,7 +21,7 @@ class WrzucTo(SimpleHoster):
FILE_NAME_PATTERN = r'id="file_info">\s*<strong>(?P<N>.*?)</strong>'
FILE_SIZE_PATTERN = r'class="info">\s*<tr>\s*<td>(?P<S>.*?)</td>'
- SH_COOKIES = [(".wrzuc.to", "language", "en")]
+ COOKIES = [(".wrzuc.to", "language", "en")]
def setup(self):
diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py
index 1bee788d5..4724a2980 100644
--- a/module/plugins/hoster/ZippyshareCom.py
+++ b/module/plugins/hoster/ZippyshareCom.py
@@ -25,7 +25,7 @@ class ZippyshareCom(SimpleHoster):
FILE_INFO_PATTERN = r'document\.getElementById\(\'dlbutton\'\)\.href = "[^;]*/(?P<N>[^"]+)";'
OFFLINE_PATTERN = r'>File does not exist on this server<'
- SH_COOKIES = [(".zippyshare.com", "ziplocale", "en")]
+ COOKIES = [(".zippyshare.com", "ziplocale", "en")]
def setup(self):
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py
index bacfce1dd..184ba66c9 100644
--- a/module/plugins/internal/SimpleCrypter.py
+++ b/module/plugins/internal/SimpleCrypter.py
@@ -51,16 +51,16 @@ class SimpleCrypter(Crypter):
URL_REPLACEMENTS = []
- SH_BROKEN_ENCODING = False #: Set to True or encoding name if encoding in http header is not correct
- SH_COOKIES = True #: or False or list of tuples [(domain, name, value)]
+ TEXT_ENCODING = False #: Set to True or encoding name if encoding in http header is not correct
+ COOKIES = True #: or False or list of tuples [(domain, name, value)]
LOGIN_ACCOUNT = False
LOGIN_PREMIUM = False
def setup(self):
- if isinstance(self.SH_COOKIES, list):
- set_cookies(self.req.cj, self.SH_COOKIES)
+ if isinstance(self.COOKIES, list):
+ set_cookies(self.req.cj, self.COOKIES)
def decrypt(self, pyfile):
@@ -72,7 +72,7 @@ class SimpleCrypter(Crypter):
pyfile.url = replace_patterns(pyfile.url, self.URL_REPLACEMENTS)
- self.html = self.load(pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES)
+ self.html = self.load(pyfile.url, decode=not self.TEXT_ENCODING, cookies=self.COOKIES)
self.checkOnline()
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index b2db56f3f..6ecb2d9f2 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -78,8 +78,8 @@ def parseFileInfo(self, url='', html=''):
else:
if not html and hasattr(self, "html"):
html = self.html
- if isinstance(self.SH_BROKEN_ENCODING, (str, unicode)):
- html = unicode(html, self.SH_BROKEN_ENCODING)
+ if isinstance(self.TEXT_ENCODING, basestring):
+ html = unicode(html, self.TEXT_ENCODING)
if hasattr(self, "html"):
self.html = html
@@ -112,7 +112,7 @@ def parseFileInfo(self, url='', html=''):
size = replace_patterns(info['S'] + info['U'] if 'U' in info else info['S'],
self.FILE_SIZE_REPLACEMENTS)
info['size'] = parseFileSize(size)
- elif isinstance(info['size'], (str, unicode)):
+ elif isinstance(info['size'], basestring):
if 'units' in info:
info['size'] += info['units']
info['size'] = parseFileSize(info['size'])
@@ -128,10 +128,10 @@ def create_getInfo(plugin):
def getInfo(urls):
for url in urls:
cj = CookieJar(plugin.__name__)
- if isinstance(plugin.SH_COOKIES, list):
- set_cookies(cj, plugin.SH_COOKIES)
+ if isinstance(plugin.COOKIES, list):
+ set_cookies(cj, plugin.COOKIES)
file_info = parseFileInfo(plugin, url, getURL(replace_patterns(url, plugin.FILE_URL_REPLACEMENTS),
- decode=not plugin.SH_BROKEN_ENCODING, cookies=cj))
+ decode=not plugin.TEXT_ENCODING, cookies=cj))
yield file_info
return getInfo
@@ -187,9 +187,9 @@ class SimpleHoster(Hoster):
FILE_SIZE_REPLACEMENTS = []
FILE_URL_REPLACEMENTS = []
- SH_BROKEN_ENCODING = False #: Set to True or encoding name if encoding in http header is not correct
- SH_COOKIES = True #: or False or list of tuples [(domain, name, value)]
- SH_CHECK_TRAFFIC = False #: True = force check traffic left for a premium account
+ TEXT_ENCODING = False #: Set to True or encoding name if encoding in http header is not correct
+ COOKIES = True #: or False or list of tuples [(domain, name, value)]
+ FORCE_CHECK_TRAFFIC = False #: Set to True to force checking traffic left for premium account
def init(self):
@@ -198,8 +198,8 @@ class SimpleHoster(Hoster):
def setup(self):
self.resumeDownload = self.multiDL = self.premium
- if isinstance(self.SH_COOKIES, list):
- set_cookies(self.req.cj, self.SH_COOKIES)
+ if isinstance(self.COOKIES, list):
+ set_cookies(self.req.cj, self.COOKIES)
def process(self, pyfile):
@@ -207,18 +207,18 @@ class SimpleHoster(Hoster):
self.req.setOption("timeout", 120)
# Due to a 0.4.9 core bug self.load would keep previous cookies even if overridden by cookies parameter.
# Workaround using getURL. Can be reverted in 0.4.10 as the cookies bug has been fixed.
- self.html = getURL(pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES)
+ self.html = getURL(pyfile.url, decode=not self.TEXT_ENCODING, cookies=self.COOKIES)
premium_only = hasattr(self, 'PREMIUM_ONLY_PATTERN') and re.search(self.PREMIUM_ONLY_PATTERN, self.html)
if not premium_only: # Usually premium only pages doesn't show the file information
self.getFileInfo()
- if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()):
+ if self.premium and (not self.FORCE_CHECK_TRAFFIC or self.checkTrafficLeft()):
self.handlePremium()
elif premium_only:
self.fail("This link require a premium account")
else:
# This line is required due to the getURL workaround. Can be removed in 0.4.10
- self.html = self.load(pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES)
+ self.html = self.load(pyfile.url, decode=not self.TEXT_ENCODING, cookies=self.COOKIES)
self.handleFree()