summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-22 16:45:04 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-22 16:45:04 +0100
commit854efeb463bd98cb8e22f1f78f5ce97e6c0ab49f (patch)
tree3128578d89f36fed0aa5ab7b3ede6311751dd7f8
parent[UlozTo] Fix TRAFFIC_LEFT_PATTERN (diff)
downloadpyload-854efeb463bd98cb8e22f1f78f5ce97e6c0ab49f.tar.xz
Spare code cosmetics
-rw-r--r--module/plugins/accounts/FilefactoryCom.py4
-rw-r--r--module/plugins/crypter/DailymotionBatch.py4
-rw-r--r--module/plugins/crypter/Dereferer.py4
-rw-r--r--module/plugins/crypter/DlProtectCom.py2
-rw-r--r--module/plugins/crypter/LinkSaveIn.py4
-rw-r--r--module/plugins/crypter/LixIn.py10
-rw-r--r--module/plugins/crypter/MultiUpOrg.py2
-rw-r--r--module/plugins/crypter/NCryptIn.py4
-rw-r--r--module/plugins/crypter/RelinkUs.py10
-rw-r--r--module/plugins/crypter/TurbobitNetFolder.py2
-rw-r--r--module/plugins/crypter/UploadedToFolder.py6
-rw-r--r--module/plugins/crypter/YoutubeBatch.py4
-rw-r--r--module/plugins/hooks/Checksum.py16
-rw-r--r--module/plugins/hoster/BitshareCom.py6
-rw-r--r--module/plugins/hoster/DailymotionCom.py8
-rw-r--r--module/plugins/hoster/FilejungleCom.py2
-rw-r--r--module/plugins/hoster/FileserveCom.py8
-rw-r--r--module/plugins/hoster/LetitbitNet.py2
-rw-r--r--module/plugins/hoster/MediafireCom.py33
-rw-r--r--module/plugins/hoster/RarefileNet.py2
-rw-r--r--module/plugins/hoster/RyushareCom.py4
-rw-r--r--module/plugins/hoster/SoundcloudCom.py10
-rw-r--r--module/plugins/hoster/TurbobitNet.py4
-rw-r--r--module/plugins/hoster/UlozTo.py4
-rw-r--r--module/plugins/hoster/UploadStationCom.py2
-rw-r--r--module/plugins/hoster/VimeoCom.py2
-rw-r--r--module/plugins/hoster/WebshareCz.py2
27 files changed, 81 insertions, 80 deletions
diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py
index a61db30c8..8394c549e 100644
--- a/module/plugins/accounts/FilefactoryCom.py
+++ b/module/plugins/accounts/FilefactoryCom.py
@@ -19,7 +19,7 @@ class FilefactoryCom(Account):
("stickell", "l.stickell@yahoo.it")]
- VALID_UNTIL_PATTERN = r'Premium valid until: <strong>(?P<d>\d{1,2})\w{1,2} (?P<m>\w{3}), (?P<y>\d{4})</strong>'
+ VALID_UNTIL_PATTERN = r'Premium valid until: <strong>(?P<D>\d{1,2})\w{1,2} (?P<M>\w{3}), (?P<Y>\d{4})</strong>'
def loadAccountInfo(self, user, req):
@@ -28,7 +28,7 @@ class FilefactoryCom(Account):
m = re.search(self.VALID_UNTIL_PATTERN, html)
if m:
premium = True
- validuntil = re.sub(self.VALID_UNTIL_PATTERN, '\g<d> \g<m> \g<y>', m.group(0))
+ validuntil = re.sub(self.VALID_UNTIL_PATTERN, '\g<D> \g<M> \g<Y>', m.group(0))
validuntil = mktime(strptime(validuntil, "%d %b %Y"))
else:
premium = False
diff --git a/module/plugins/crypter/DailymotionBatch.py b/module/plugins/crypter/DailymotionBatch.py
index 28e01c084..8d4cb64df 100644
--- a/module/plugins/crypter/DailymotionBatch.py
+++ b/module/plugins/crypter/DailymotionBatch.py
@@ -84,8 +84,8 @@ class DailymotionBatch(Crypter):
def decrypt(self, pyfile):
m = re.match(self.__pattern__, pyfile.url)
- m_id = m.group("ID")
- m_type = m.group("TYPE")
+ m_id = m.group('ID')
+ m_type = m.group('TYPE')
if m_type == "playlist":
self.logDebug("Url recognized as Playlist")
diff --git a/module/plugins/crypter/Dereferer.py b/module/plugins/crypter/Dereferer.py
index dadc3c8b3..398cadce7 100644
--- a/module/plugins/crypter/Dereferer.py
+++ b/module/plugins/crypter/Dereferer.py
@@ -12,7 +12,7 @@ class Dereferer(Crypter):
__type__ = "crypter"
__version__ = "0.10"
- __pattern__ = r'https?://([^/]+)/.*?(?P<url>(ht|f)tps?(://|%3A%2F%2F).*)'
+ __pattern__ = r'https?://([^/]+)/.*?(?P<URL>(ht|f)tps?(://|%3A%2F%2F).*)'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
@@ -22,5 +22,5 @@ class Dereferer(Crypter):
def decrypt(self, pyfile):
- link = re.match(self.__pattern__, pyfile.url).group('url')
+ link = re.match(self.__pattern__, pyfile.url).group('URL')
self.urls = [unquote(link).rstrip('+')]
diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py
index 0f59e925e..a99ed0be9 100644
--- a/module/plugins/crypter/DlProtectCom.py
+++ b/module/plugins/crypter/DlProtectCom.py
@@ -30,7 +30,7 @@ class DlProtectCom(SimpleCrypter):
if not re.match(r"http://(?:www\.)?dl-protect\.com", self.req.http.lastEffectiveURL):
return [self.req.http.lastEffectiveURL]
- #id = re.match(self.__pattern__, self.pyfile.url).group("ID")
+ #id = re.match(self.__pattern__, self.pyfile.url).group('ID')
key = re.search(r'name="id_key" value="(.+?)"', self.html).group(1)
post_req = {"id_key": key, "submitform": ""}
diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py
index 22aba8afc..842310853 100644
--- a/module/plugins/crypter/LinkSaveIn.py
+++ b/module/plugins/crypter/LinkSaveIn.py
@@ -18,7 +18,7 @@ class LinkSaveIn(SimpleCrypter):
__type__ = "crypter"
__version__ = "2.02"
- __pattern__ = r'http://(?:www\.)?linksave\.in/(?P<id>\w+)$'
+ __pattern__ = r'http://(?:www\.)?linksave\.in/(?P<ID>\w+)$'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
@@ -44,7 +44,7 @@ class LinkSaveIn(SimpleCrypter):
def decrypt(self, pyfile):
# Init
self.package = pyfile.package()
- self.fileid = re.match(self.__pattern__, pyfile.url).group('id')
+ self.fileid = re.match(self.__pattern__, pyfile.url).group('ID')
# Request package
self.html = self.load(pyfile.url)
diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py
index 50ad217d4..d899d58c7 100644
--- a/module/plugins/crypter/LixIn.py
+++ b/module/plugins/crypter/LixIn.py
@@ -19,9 +19,9 @@ class LixIn(Crypter):
__authors__ = [("spoob", "spoob@pyload.org")]
- CAPTCHA_PATTERN = r'<img src="(?P<image>captcha_img\.php\?.*?)"'
+ CAPTCHA_PATTERN = r'<img src="(captcha_img\.php\?.*?)"'
SUBMIT_PATTERN = r'value=\'continue.*?\''
- LINK_PATTERN = r'name="ifram" src="(?P<link>.*?)"'
+ LINK_PATTERN = r'name="ifram" src="(.*?)"'
def decrypt(self, pyfile):
@@ -31,7 +31,7 @@ class LixIn(Crypter):
if m is None:
self.error(_("Unable to identify file ID"))
- id = m.group("ID")
+ id = m.group('ID')
self.logDebug("File id is %s" % id)
self.html = self.load(url, decode=True)
@@ -46,7 +46,7 @@ class LixIn(Crypter):
m = re.search(self.CAPTCHA_PATTERN, self.html)
if m:
self.logDebug("Trying captcha")
- captcharesult = self.decryptCaptcha("http://lix.in/" + m.group("image"))
+ captcharesult = self.decryptCaptcha("http://lix.in/" + m.group(1))
self.html = self.load(url, decode=True,
post={"capt": captcharesult, "submit": "submit", "tiny": id})
else:
@@ -58,5 +58,5 @@ class LixIn(Crypter):
if m is None:
self.error(_("Unable to find destination url"))
else:
- self.urls = [m.group("link")]
+ self.urls = [m.group(1)]
self.logDebug("Found link %s, adding to package" % self.urls[0])
diff --git a/module/plugins/crypter/MultiUpOrg.py b/module/plugins/crypter/MultiUpOrg.py
index ada8d0728..5209ebf09 100644
--- a/module/plugins/crypter/MultiUpOrg.py
+++ b/module/plugins/crypter/MultiUpOrg.py
@@ -24,7 +24,7 @@ class MultiUpOrg(SimpleCrypter):
def getLinks(self):
- m_type = re.match(self.__pattern__, self.pyfile.url).group("TYPE")
+ m_type = re.match(self.__pattern__, self.pyfile.url).group('TYPE')
if m_type == "project":
pattern = r'\n(http://www\.multiup\.org/(?:en|fr)/download/.*)'
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py
index 1d572e538..8b7214157 100644
--- a/module/plugins/crypter/NCryptIn.py
+++ b/module/plugins/crypter/NCryptIn.py
@@ -15,7 +15,7 @@ class NCryptIn(Crypter):
__type__ = "crypter"
__version__ = "1.33"
- __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?P<type>folder|link|frame)-([^/\?]+)'
+ __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?P<TYPE>folder|link|frame)-([^/\?]+)'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
@@ -80,7 +80,7 @@ class NCryptIn(Crypter):
def isSingleLink(self):
- link_type = re.match(self.__pattern__, self.pyfile.url).group('type')
+ link_type = re.match(self.__pattern__, self.pyfile.url).group('TYPE')
return link_type in ("link", "frame")
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py
index 94a73cded..5933839ec 100644
--- a/module/plugins/crypter/RelinkUs.py
+++ b/module/plugins/crypter/RelinkUs.py
@@ -16,7 +16,7 @@ class RelinkUs(Crypter):
__type__ = "crypter"
__version__ = "3.11"
- __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<id>.+)'
+ __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<ID>.+)'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
@@ -50,9 +50,9 @@ class RelinkUs(Crypter):
DLC_LINK_REGEX = r'<a href=".*?" class="dlc_button" target="_blank">'
DLC_DOWNLOAD_URL = r'http://www.relink.us/download.php'
- WEB_FORWARD_REGEX = r'getFile\(\'(?P<link>.+)\'\)'
+ WEB_FORWARD_REGEX = r'getFile\(\'(.+)\'\)'
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>'
+ WEB_LINK_REGEX = r'<iframe name="Container" height="100%" frameborder="no" width="100%" src="(.+)"></iframe>'
def setup(self):
@@ -100,7 +100,7 @@ class RelinkUs(Crypter):
def initPackage(self, pyfile):
- self.fileid = re.match(self.__pattern__, pyfile.url).group('id')
+ self.fileid = re.match(self.__pattern__, pyfile.url).group('ID')
self.package = pyfile.package()
self.password = self.getPassword()
@@ -241,7 +241,7 @@ class RelinkUs(Crypter):
self.logDebug("Decrypting Web link %d, %s" % (index + 1, url))
res = self.load(url, decode=True)
- link = re.search(self.WEB_LINK_REGEX, res).group('link')
+ link = re.search(self.WEB_LINK_REGEX, res).group(1)
package_links.append(link)
diff --git a/module/plugins/crypter/TurbobitNetFolder.py b/module/plugins/crypter/TurbobitNetFolder.py
index 64fcefac6..c6734c997 100644
--- a/module/plugins/crypter/TurbobitNetFolder.py
+++ b/module/plugins/crypter/TurbobitNetFolder.py
@@ -39,7 +39,7 @@ class TurbobitNetFolder(SimpleCrypter):
def getLinks(self):
- id = re.match(self.__pattern__, self.pyfile.url).group("ID")
+ id = re.match(self.__pattern__, self.pyfile.url).group('ID')
fixurl = lambda id: "http://turbobit.net/%s.html" % id
return map(fixurl, self._getLinks(id))
diff --git a/module/plugins/crypter/UploadedToFolder.py b/module/plugins/crypter/UploadedToFolder.py
index 3e77d73a9..0a71add70 100644
--- a/module/plugins/crypter/UploadedToFolder.py
+++ b/module/plugins/crypter/UploadedToFolder.py
@@ -12,7 +12,7 @@ class UploadedToFolder(SimpleCrypter):
__type__ = "crypter"
__version__ = "0.42"
- __pattern__ = r'http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|folder|list)/(?P<id>\w+)'
+ __pattern__ = r'http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|folder|list)/(?P<ID>\w+)'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
@@ -21,7 +21,7 @@ class UploadedToFolder(SimpleCrypter):
__authors__ = [("stickell", "l.stickell@yahoo.it")]
- PLAIN_PATTERN = r'<small class="date"><a href="(?P<plain>[\w/]+)" onclick='
+ PLAIN_PATTERN = r'<small class="date"><a href="([\w/]+)" onclick='
NAME_PATTERN = r'<title>(?P<N>.+?)<'
@@ -30,7 +30,7 @@ class UploadedToFolder(SimpleCrypter):
if m is None:
self.error(_("PLAIN_PATTERN not found"))
- plain_link = urljoin("http://uploaded.net/", m.group('plain'))
+ plain_link = urljoin("http://uploaded.net/", m.group(1))
return self.load(plain_link).split('\n')[:-1]
diff --git a/module/plugins/crypter/YoutubeBatch.py b/module/plugins/crypter/YoutubeBatch.py
index c66f94753..73ebf5fb3 100644
--- a/module/plugins/crypter/YoutubeBatch.py
+++ b/module/plugins/crypter/YoutubeBatch.py
@@ -96,8 +96,8 @@ class YoutubeBatch(Crypter):
def decrypt(self, pyfile):
m = re.match(self.__pattern__, pyfile.url)
- m_id = m.group("ID")
- m_type = m.group("TYPE")
+ m_id = m.group('ID')
+ m_type = m.group('TYPE')
if m_type == "user":
self.logDebug("Url recognized as Channel")
diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py
index 18036e020..8d9f8f981 100644
--- a/module/plugins/hooks/Checksum.py
+++ b/module/plugins/hooks/Checksum.py
@@ -56,10 +56,10 @@ class Checksum(Hook):
methods = {'sfv': 'crc32', 'crc': 'crc32', 'hash': 'md5'}
- regexps = {'sfv': r'^(?P<name>[^;].+)\s+(?P<hash>[0-9A-Fa-f]{8})$',
- 'md5': r'^(?P<name>[0-9A-Fa-f]{32}) (?P<file>.+)$',
- 'crc': r'filename=(?P<name>.+)\nsize=(?P<size>\d+)\ncrc32=(?P<hash>[0-9A-Fa-f]{8})$',
- 'default': r'^(?P<hash>[0-9A-Fa-f]+)\s+\*?(?P<name>.+)$'}
+ regexps = {'sfv': r'^(?P<NAME>[^;].+)\s+(?P<HASH>[0-9A-Fa-f]{8})$',
+ 'md5': r'^(?P<NAME>[0-9A-Fa-f]{32}) (?P<FILE>.+)$',
+ 'crc': r'filename=(?P<NAME>.+)\nsize=(?P<SIZE>\d+)\ncrc32=(?P<HASH>[0-9A-Fa-f]{8})$',
+ 'default': r'^(?P<HASH>[0-9A-Fa-f]+)\s+\*?(?P<NAME>.+)$'}
#@TODO: Remove in 0.4.10
@@ -179,12 +179,12 @@ class Checksum(Hook):
data = m.groupdict()
self.logDebug(link['name'], data)
- local_file = fs_encode(save_join(download_folder, data['name']))
+ local_file = fs_encode(save_join(download_folder, data['NAME']))
algorithm = self.methods.get(file_type, file_type)
checksum = computeChecksum(local_file, algorithm)
- if checksum == data['hash']:
+ if checksum == data['HASH']:
self.logInfo(_('File integrity of "%s" verified by %s checksum (%s)') %
- (data['name'], algorithm, checksum))
+ (data['NAME'], algorithm, checksum))
else:
self.logWarning(_("%s checksum for file %s does not match (%s != %s)") %
- (algorithm, data['name'], checksum, data['hash']))
+ (algorithm, data['NAME'], checksum, data['HASH']))
diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py
index 17d29680e..6a497f4bc 100644
--- a/module/plugins/hoster/BitshareCom.py
+++ b/module/plugins/hoster/BitshareCom.py
@@ -13,7 +13,7 @@ class BitshareCom(SimpleHoster):
__type__ = "hoster"
__version__ = "0.51"
- __pattern__ = r'http://(?:www\.)?bitshare\.com/(files/(?P<id1>\w+)(/(?P<name>.*?)\.html)?|\?f=(?P<id2>\w+))'
+ __pattern__ = r'http://(?:www\.)?bitshare\.com/(files/(?P<id1>\w+)(/(?P<NAME>.*?)\.html)?|\?f=(?P<id2>\w+))'
__description__ = """Bitshare.com hoster plugin"""
__license__ = "GPLv3"
@@ -43,7 +43,7 @@ class BitshareCom(SimpleHoster):
# File id
m = re.match(self.__pattern__, pyfile.url)
- self.file_id = max(m.group('id1'), m.group('id2'))
+ self.file_id = max(m.group('ID1'), m.group('ID2'))
self.logDebug("File id is [%s]" % self.file_id)
# Load main page
@@ -61,7 +61,7 @@ class BitshareCom(SimpleHoster):
# File name
m = re.match(self.__pattern__, pyfile.url)
- name1 = m.group('name') if m else None
+ name1 = m.group('NAME') if m else None
m = re.search(self.INFO_PATTERN, self.html)
name2 = m.group('N') if m else None
pyfile.name = max(name1, name2)
diff --git a/module/plugins/hoster/DailymotionCom.py b/module/plugins/hoster/DailymotionCom.py
index f07a34f8a..dc42d1f60 100644
--- a/module/plugins/hoster/DailymotionCom.py
+++ b/module/plugins/hoster/DailymotionCom.py
@@ -15,7 +15,7 @@ def getInfo(urls):
request = {"fields": "access_error,status,title"}
for url in urls:
- id = regex.match(url).group("ID")
+ id = regex.match(url).group('ID')
page = getURL(apiurl % id, get=request)
info = json_loads(page)
@@ -60,8 +60,8 @@ class DailymotionCom(Hoster):
for result in re.finditer(r"\"(?P<URL>http:\\/\\/www.dailymotion.com\\/cdn\\/H264-(?P<QF>.*?)\\.*?)\"",
self.html):
- url = result.group("URL")
- qf = result.group("QF")
+ url = result.group('URL')
+ qf = result.group('QF')
link = url.replace("\\", "")
quality = tuple(int(x) for x in qf.split("x"))
@@ -116,7 +116,7 @@ class DailymotionCom(Hoster):
def process(self, pyfile):
self.checkInfo(pyfile)
- id = re.match(self.__pattern__, pyfile.url).group("ID")
+ id = re.match(self.__pattern__, pyfile.url).group('ID')
self.html = self.load("http://www.dailymotion.com/embed/video/" + id, decode=True)
streams = self.getStreams()
diff --git a/module/plugins/hoster/FilejungleCom.py b/module/plugins/hoster/FilejungleCom.py
index 8431da7fa..d5367e0be 100644
--- a/module/plugins/hoster/FilejungleCom.py
+++ b/module/plugins/hoster/FilejungleCom.py
@@ -9,7 +9,7 @@ class FilejungleCom(FileserveCom):
__type__ = "hoster"
__version__ = "0.51"
- __pattern__ = r'http://(?:www\.)?filejungle\.com/f/(?P<id>[^/]+).*'
+ __pattern__ = r'http://(?:www\.)?filejungle\.com/f/(?P<ID>[^/]+).*'
__description__ = """Filejungle.com hoster plugin"""
__license__ = "GPLv3"
diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py
index 871a3dd26..2d4478e63 100644
--- a/module/plugins/hoster/FileserveCom.py
+++ b/module/plugins/hoster/FileserveCom.py
@@ -35,7 +35,7 @@ class FileserveCom(Hoster):
__type__ = "hoster"
__version__ = "0.52"
- __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P<id>[^/]+).*'
+ __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P<ID>[^/]+).*'
__description__ = """Fileserve.com hoster plugin"""
__license__ = "GPLv3"
@@ -50,7 +50,7 @@ class FileserveCom(Hoster):
LINKCHECK_TR = r'<tr>\s*(<td>http://www\.fileserve\.com/file/.*?)</tr>'
LINKCHECK_TD = r'<td>(?:<[^>]*>|&nbsp;)*([^<]*)'
- CAPTCHA_KEY_PATTERN = r'var reCAPTCHA_publickey=\'(?P<key>.+?)\''
+ CAPTCHA_KEY_PATTERN = r'var reCAPTCHA_publickey=\'(.+?)\''
LONG_WAIT_PATTERN = r'<li class="title">You need to wait (\d+) (\w+) to start another download\.</li>'
LINK_EXPIRED_PATTERN = r'Your download link has expired'
DAILY_LIMIT_PATTERN = r'Your daily download limit has been reached'
@@ -59,7 +59,7 @@ class FileserveCom(Hoster):
def setup(self):
self.resumeDownload = self.multiDL = self.premium
- self.file_id = re.match(self.__pattern__, self.pyfile.url).group('id')
+ self.file_id = re.match(self.__pattern__, self.pyfile.url).group('ID')
self.url = "%s%s" % (self.URLS[0], self.file_id)
self.logDebug("File ID: %s URL: %s" % (self.file_id, self.url))
@@ -155,7 +155,7 @@ class FileserveCom(Hoster):
def doCaptcha(self):
- captcha_key = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group("key")
+ captcha_key = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group(1)
recaptcha = ReCaptcha(self)
for _i in xrange(5):
diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py
index ed8d4a39d..5fcb5e08b 100644
--- a/module/plugins/hoster/LetitbitNet.py
+++ b/module/plugins/hoster/LetitbitNet.py
@@ -50,7 +50,7 @@ class LetitbitNet(SimpleHoster):
URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "letitbit.net")]
SECONDS_PATTERN = r'seconds\s*=\s*(\d+);'
- CAPTCHA_CONTROL_FIELD = r'recaptcha_control_field\s=\s\'(?P<value>.+?)\''
+ CAPTCHA_CONTROL_FIELD = r'recaptcha_control_field\s=\s\'(.+?)\''
def setup(self):
diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py
index 4b420242d..5f88051a6 100644
--- a/module/plugins/hoster/MediafireCom.py
+++ b/module/plugins/hoster/MediafireCom.py
@@ -15,23 +15,28 @@ def checkHTMLHeader(url):
try:
for _i in xrange(3):
header = getURL(url, just_header=True)
+
for line in header.splitlines():
line = line.lower()
+
if 'location' in line:
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
+
break
+
elif 'content-disposition' in line:
return url, 2
else:
break
except:
return url, 3
-
- return url, 0
+ else:
+ return url, 0
def getInfo(urls):
@@ -59,16 +64,12 @@ class MediafireCom(SimpleHoster):
("stickell", "l.stickell@yahoo.it")]
- LINK_PATTERN = r'<div class="download_link"[^>]*(?:z-index:(?P<zindex>\d+))?[^>]*>\s*<a href="(?P<href>http://[^"]+)"'
- JS_KEY_PATTERN = r'DoShow\(\'mfpromo1\'\);[^{]*{((\w+)=\'\';.*?)eval\(\2\);'
- JS_ZMODULO_PATTERN = r'\(\'z-index\'\)\) \% (\d+)\)\);'
- PAGE1_ACTION_PATTERN = r'<link rel="canonical" href="([^"]+)"/>'
- PASSWORD_PATTERN = r'<form name="form_password"'
-
- NAME_PATTERN = r'<META NAME="description" CONTENT="(?P<N>[^"]+)"/>'
- INFO_PATTERN = r'oFileSharePopup\.ald\(\'(?P<ID>[^\']*)\',\'(?P<N>[^\']*)\',\'(?P<S>[^\']*)\',\'\',\'(?P<sha256>[^\']*)\'\)'
+ NAME_PATTERN = r'<META NAME="description" CONTENT="(?P<N>[^"]+)"/>'
+ INFO_PATTERN = r'oFileSharePopup\.ald\(\'(?P<ID>[^\']*)\',\'(?P<N>[^\']*)\',\'(?P<S>[^\']*)\',\'\',\'(?P<sha256>[^\']*)\'\)'
OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>'
+ PASSWORD_PATTERN = r'<form name="form_password"'
+
def setup(self):
self.multiDL = False
@@ -77,11 +78,11 @@ class MediafireCom(SimpleHoster):
def process(self, pyfile):
pyfile.url = re.sub(r'/view/?\?', '/?', pyfile.url)
- self.url, result = checkHTMLHeader(pyfile.url)
- self.logDebug("Location (%d): %s" % (result, self.url))
+ self.link, result = checkHTMLHeader(pyfile.url)
+ self.logDebug("Location (%d): %s" % (result, self.link))
if result == 0:
- self.html = self.load(self.url, decode=True)
+ self.html = self.load(self.link, decode=True)
self.checkCaptcha()
self.multiDL = True
self.check_data = self.getFileInfo()
@@ -94,7 +95,7 @@ class MediafireCom(SimpleHoster):
self.offline()
else:
self.multiDL = True
- self.download(self.url, disposition=True)
+ self.download(self.link, disposition=True)
def handleFree(self):
@@ -103,7 +104,7 @@ class MediafireCom(SimpleHoster):
if password:
self.logInfo(_("Password protected link, trying ") + password)
- self.html = self.load(self.url, post={"downloadp": password})
+ self.html = self.load(self.link, post={"downloadp": password})
if self.PASSWORD_PATTERN in self.html:
self.fail(_("Incorrect password"))
@@ -121,7 +122,7 @@ class MediafireCom(SimpleHoster):
def checkCaptcha(self):
solvemedia = SolveMedia(self)
challenge, response = solvemedia.challenge()
- self.html = self.load(self.url,
+ self.html = self.load(self.link,
post={'adcopy_challenge': challenge,
'adcopy_response' : response},
decode=True)
diff --git a/module/plugins/hoster/RarefileNet.py b/module/plugins/hoster/RarefileNet.py
index e847c7cf3..bc2382dc1 100644
--- a/module/plugins/hoster/RarefileNet.py
+++ b/module/plugins/hoster/RarefileNet.py
@@ -19,7 +19,7 @@ class RarefileNet(XFSHoster):
HOSTER_DOMAIN = "rarefile.net"
- LINK_PATTERN = r'<a href="(?P<link>[^"]+)">(?P=link)</a>'
+ LINK_PATTERN = r'<a href="(.+?)">(?P=\1)</a>'
getInfo = create_getInfo(RarefileNet)
diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py
index b01613abb..0964c51fc 100644
--- a/module/plugins/hoster/RyushareCom.py
+++ b/module/plugins/hoster/RyushareCom.py
@@ -25,7 +25,7 @@ class RyushareCom(XFSHoster):
HOSTER_DOMAIN = "ryushare.com"
- WAIT_PATTERN = r'You have to wait ((?P<hour>\d+) hour[s]?, )?((?P<min>\d+) minute[s], )?(?P<sec>\d+) second[s]'
+ WAIT_PATTERN = r'You have to wait ((?P<H>\d+) hour[s]?, )?((?P<M>\d+) minute[s], )?(?P<S>\d+) second[s]'
LINK_PATTERN = r'<a href="([^"]+)">Click here to download<'
@@ -49,7 +49,7 @@ class RyushareCom(XFSHoster):
m = re.search(self.WAIT_PATTERN, self.html)
if m:
wait = m.groupdict(0)
- waittime = int(wait['hour']) * 60 * 60 + int(wait['min']) * 60 + int(wait['sec'])
+ waittime = int(wait['H']) * 60 * 60 + int(wait['M']) * 60 + int(wait['S'])
self.setWait(waittime, True)
retry = True
diff --git a/module/plugins/hoster/SoundcloudCom.py b/module/plugins/hoster/SoundcloudCom.py
index 79c8a2f1e..4665dff05 100644
--- a/module/plugins/hoster/SoundcloudCom.py
+++ b/module/plugins/hoster/SoundcloudCom.py
@@ -25,23 +25,23 @@ class SoundcloudCom(Hoster):
m = re.search(r'<div class="haudio.*?large.*?" data-sc-track="(?P<ID>\d*)"', page)
songId = clientId = ""
if m:
- songId = m.group("ID")
+ songId = m.group('ID')
if len(songId) <= 0:
self.logError(_("Could not find song id"))
self.offline()
else:
m = re.search(r'"clientID":"(?P<CID>.*?)"', page)
if m:
- clientId = m.group("CID")
+ clientId = m.group('CID')
if len(clientId) <= 0:
clientId = "b45b1aa10f1ac2941910a7f0d10f8e28"
m = re.search(r'<em itemprop="name">\s(?P<TITLE>.*?)\s</em>', page)
if m:
- pyfile.name = m.group("TITLE") + ".mp3"
+ pyfile.name = m.group('TITLE') + ".mp3"
else:
- pyfile.name = re.match(self.__pattern__, pyfile.url).group("SID") + ".mp3"
+ pyfile.name = re.match(self.__pattern__, pyfile.url).group('SID') + ".mp3"
# url to retrieve the actual song url
page = self.load("https://api.sndcdn.com/i1/tracks/%s/streams" % songId, get={"client_id": clientId})
@@ -49,7 +49,7 @@ class SoundcloudCom(Hoster):
# for now we choose the first stream found in all cases
# it could be improved if relevant for this hoster
streams = [
- (result.group("QUALITY"), result.group("URL"))
+ (result.group('QUALITY'), result.group('URL'))
for result in re.finditer(r'"(?P<QUALITY>.*?)":"(?P<URL>.*?)"', page)
]
self.logDebug("Found Streams", streams)
diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py
index 9d7dcc67b..258ec7d3e 100644
--- a/module/plugins/hoster/TurbobitNet.py
+++ b/module/plugins/hoster/TurbobitNet.py
@@ -35,7 +35,7 @@ class TurbobitNet(SimpleHoster):
SIZE_PATTERN = r'class="file-size">(?P<S>[\d.,]+) (?P<U>[\w^_]+)'
OFFLINE_PATTERN = r'<h2>File Not Found</h2>|html\(\'File (?:was )?not found'
- LINK_PATTERN = r'(?P<url>/download/redirect/[^"\']+)'
+ LINK_PATTERN = r'(/download/redirect/[^"\']+)'
LIMIT_WAIT_PATTERN = r'<div id=\'timeout\'>(\d+)<'
CAPTCHA_PATTERN = r'<img alt="Captcha" src="(.+?)"'
@@ -166,7 +166,7 @@ class TurbobitNet(SimpleHoster):
m = re.search(self.LINK_PATTERN, self.html)
if m is None:
self.error(_("Download link not found"))
- self.url = "http://turbobit.net" + m.group('url')
+ self.url = "http://turbobit.net" + m.group(1)
self.download(self.url)
diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py
index 0574734c5..6b84a5e1b 100644
--- a/module/plugins/hoster/UlozTo.py
+++ b/module/plugins/hoster/UlozTo.py
@@ -32,10 +32,10 @@ class UlozTo(SimpleHoster):
URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "www.ulozto.net")]
SIZE_REPLACEMENTS = [('([\d.]+)\s([kMG])B', convertDecimalPrefix)]
- ADULT_PATTERN = r'<form action="(?P<link>[^\"]*)" method="post" id="frm-askAgeForm">'
+ ADULT_PATTERN = r'<form action="([^\"]*)" method="post" id="frm-askAgeForm">'
PASSWD_PATTERN = r'<div class="passwordProtectedFile">'
VIPLINK_PATTERN = r'<a href="[^"]*\?disclaimer=1" class="linkVip">'
- TOKEN_PATTERN = r'<input type="hidden" name="_token_" .*?value="(?P<token>.+?)"'
+ TOKEN_PATTERN = r'<input type="hidden" name="_token_" .*?value="(.+?)"'
FREE_URL_PATTERN = r'<div class="freeDownloadForm"><form action="([^"]+)"'
PREMIUM_URL_PATTERN = r'<div class="downloadForm"><form action="([^"]+)"'
diff --git a/module/plugins/hoster/UploadStationCom.py b/module/plugins/hoster/UploadStationCom.py
index fa6e3f693..d987770fe 100644
--- a/module/plugins/hoster/UploadStationCom.py
+++ b/module/plugins/hoster/UploadStationCom.py
@@ -8,7 +8,7 @@ class UploadStationCom(DeadHoster):
__type__ = "hoster"
__version__ = "0.52"
- __pattern__ = r'http://(?:www\.)?uploadstation\.com/file/(?P<id>\w+)'
+ __pattern__ = r'http://(?:www\.)?uploadstation\.com/file/(?P<ID>\w+)'
__description__ = """UploadStation.com hoster plugin"""
__license__ = "GPLv3"
diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py
index 9e4abf702..0e42c1674 100644
--- a/module/plugins/hoster/VimeoCom.py
+++ b/module/plugins/hoster/VimeoCom.py
@@ -41,7 +41,7 @@ class VimeoCom(SimpleHoster):
html = self.js.eval(self.load(self.pyfile.url, get={'action': "download", 'password': password}, decode=True))
pattern = r'href="(?P<URL>http://vimeo\.com.+?)".*?\>(?P<QL>.+?) '
else:
- id = re.match(self.__pattern__, self.pyfile.url).group("ID")
+ id = re.match(self.__pattern__, self.pyfile.url).group('ID')
html = self.load("https://player.vimeo.com/video/" + id, get={'password': password})
pattern = r'"(?P<QL>\w+)":{"profile".*?"(?P<URL>http://pdl\.vimeocdn\.com.+?)"'
diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py
index 7b9c097c5..a08341ff3 100644
--- a/module/plugins/hoster/WebshareCz.py
+++ b/module/plugins/hoster/WebshareCz.py
@@ -41,7 +41,7 @@ class WebshareCz(SimpleHoster):
def handleFree(self):
- fid = re.match(self.__pattern__, self.pyfile.url).group("ID")
+ fid = re.match(self.__pattern__, self.pyfile.url).group('ID')
wst = self.account.infos['wst'] if self.account and 'wst' in self.account.infos else ""
api_data = getURL('https://webshare.cz/api/file_link/',