summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/MegasharesCom.py10
-rw-r--r--module/plugins/hoster/XFileSharingPro.py10
2 files changed, 10 insertions, 10 deletions
diff --git a/module/plugins/hoster/MegasharesCom.py b/module/plugins/hoster/MegasharesCom.py
index 7021e69c0..3a66f356a 100644
--- a/module/plugins/hoster/MegasharesCom.py
+++ b/module/plugins/hoster/MegasharesCom.py
@@ -25,16 +25,16 @@ class MegasharesCom(SimpleHoster):
__name__ = "MegasharesCom"
__type__ = "hoster"
__pattern__ = r"http://(\w+\.)?megashares.com/.*"
- __version__ = "0.21"
+ __version__ = "0.22"
__description__ = """megashares.com plugin - free only"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
FILE_NAME_PATTERN = '<h1 class="black xxl"[^>]*title="(?P<N>[^"]+)">'
FILE_SIZE_PATTERN = '<strong><span class="black">Filesize:</span></strong> (?P<S>[0-9.]+) (?P<U>[kKMG])i?B<br />'
- DOWNLOAD_URL_PATTERN = '<div id="show_download_button_%d"[^>]*>\s*<a href="([^"]+)">'
- PASSPORT_LEFT_PATTERN = 'Your Download Passport is: <[^>]*>(\w+).*\s*You have\s*<[^>]*>\s*([0-9.]+) ([kKMG]i?B)'
- PASSPORT_RENEW_PATTERN = 'Your download passport will renew in\s*<strong>(\d+)</strong>:<strong>(\d+)</strong>:<strong>(\d+)</strong>'
+ DOWNLOAD_URL_PATTERN = r'<div id="show_download_button_%d"[^>]*>\s*<a href="([^"]+)">'
+ PASSPORT_LEFT_PATTERN = r'Your Download Passport is: <[^>]*>(\w+).*\s*You have\s*<[^>]*>\s*([0-9.]+) ([kKMG]i?B)'
+ PASSPORT_RENEW_PATTERN = r'Your download passport will renew in\s*<strong>(\d+)</strong>:<strong>(\d+)</strong>:<strong>(\d+)</strong>'
REACTIVATE_NUM_PATTERN = r'<input[^>]*id="random_num" value="(\d+)" />'
REACTIVATE_PASSPORT_PATTERN = r'<input[^>]*id="passport_num" value="(\w+)" />'
REQUEST_URI_PATTERN = r'var request_uri = "([^"]+)";'
@@ -63,7 +63,7 @@ class MegasharesCom(SimpleHoster):
passport_num = found.group(1)
request_uri = re.search(self.REQUEST_URI_PATTERN, self.html).group(1)
- for i in range(5):
+ for _ in range(5):
random_num = re.search(self.REACTIVATE_NUM_PATTERN, self.html).group(1)
verifyinput = self.decryptCaptcha(
diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py
index 8885ba9ca..9df843678 100644
--- a/module/plugins/hoster/XFileSharingPro.py
+++ b/module/plugins/hoster/XFileSharingPro.py
@@ -112,7 +112,7 @@ class XFileSharingPro(SimpleHoster):
self.req.http.c.setopt(FOLLOWLOCATION, 1)
location = None
- found = re.search("Location\s*:\s*(.*)", self.header, re.I)
+ found = re.search(r"Location\s*:\s*(.*)", self.header, re.I)
if found and re.match(self.DIRECT_LINK_PATTERN, found.group(1)):
location = found.group(1).strip()
@@ -133,7 +133,7 @@ class XFileSharingPro(SimpleHoster):
self.header = self.req.http.header
self.req.http.c.setopt(FOLLOWLOCATION, 1)
- found = re.search("Location\s*:\s*(.*)", self.header, re.I)
+ found = re.search(r"Location\s*:\s*(.*)", self.header, re.I)
if found:
break
@@ -208,7 +208,7 @@ class XFileSharingPro(SimpleHoster):
if 'wait' in self.errmsg:
wait_time = sum([int(v) * {"hour": 3600, "minute": 60, "second": 1}[u] for v, u in
- re.findall('(\d+)\s*(hour|minute|second)?', self.errmsg)])
+ re.findall(r'(\d+)\s*(hour|minute|second)?', self.errmsg)])
self.setWait(wait_time, True)
self.wait()
elif 'captcha' in self.errmsg:
@@ -234,7 +234,7 @@ class XFileSharingPro(SimpleHoster):
return self.errmsg
def getPostParameters(self):
- for i in range(3):
+ for _ in range(3):
if not self.errmsg:
self.checkErrors()
@@ -313,7 +313,7 @@ class XFileSharingPro(SimpleHoster):
if found:
captcha_div = found.group(1)
self.logDebug(captcha_div)
- numerals = re.findall('<span.*?padding-left\s*:\s*(\d+).*?>(\d)</span>', html_unescape(captcha_div))
+ numerals = re.findall(r'<span.*?padding-left\s*:\s*(\d+).*?>(\d)</span>', html_unescape(captcha_div))
inputs['code'] = "".join([a[1] for a in sorted(numerals, key=lambda num: int(num[0]))])
self.logDebug("CAPTCHA", inputs['code'], numerals)
return 3