diff options
Diffstat (limited to 'module/plugins/hoster/FileserveCom.py')
-rw-r--r-- | module/plugins/hoster/FileserveCom.py | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index ff09d9a0a..753baa800 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -2,26 +2,26 @@ import re
from module.plugins.Hoster import Hoster
-from module.plugins.ReCaptcha import ReCaptcha - +from module.plugins.ReCaptcha import ReCaptcha
+
from module.network.Request import getURL
- -def getInfo(urls): - result = [] - - for url in urls: +
+def getInfo(urls):
+ result = []
+
+ for url in urls:
html = getURL(url)
if re.search(r'<h1>File not available</h1>', html):
- result.append((url, 0, 1, url)) - continue - + result.append((url, 0, 1, url))
+ continue
+
size = re.search(r"<span><strong>(.*?) MB</strong>", html).group(1)
- size = int(float(size)*1024*1024) + size = int(float(size)*1024*1024)
- name = re.search('<h1>(.*?)<br/></h1>', html).group(1) - result.append((name, size, 2, url)) - - yield result + name = re.search('<h1>(.*?)<br/></h1>', html).group(1)
+ result.append((name, size, 2, url))
+
+ yield result
class FileserveCom(Hoster):
__name__ = "FileserveCom"
@@ -38,20 +38,20 @@ class FileserveCom(Hoster): def process(self, pyfile):
self.html = self.load(self.pyfile.url, cookies=False if self.account else True)
- if re.search(r'<h1>File not available</h1>', self.html) != None:
- self.offline
+ if re.search(r'<h1>File not available</h1>', self.html) is not None:
+ self.offline()
self.pyfile.name = re.search('<h1>(.*?)<br/></h1>', self.html).group(1)
- - if self.account: - self.handlePremium() - else: - self.handleFree() - - def handlePremium(self): - self.download(self.pyfile.url, post={"download":"premium"}, cookies=True) - - def handleFree(self): +
+ if self.account:
+ self.handlePremium()
+ else:
+ self.handleFree()
+
+ def handlePremium(self):
+ self.download(self.pyfile.url, post={"download":"premium"}, cookies=True)
+
+ def handleFree(self):
if r'<div id="captchaArea" style="display:none;">' in self.html or \
r'/showCaptcha\(\);' in self.html:
@@ -72,11 +72,11 @@ class FileserveCom(Hoster): wait_time = 30
m = re.search(r'<span>(.*?)\sSekunden</span>', html)
- if m != None:
+ if m is not None:
wait_time = int( m.group(1).split('.')[0] ) + 1
m = re.search(r'You need to wait (.*?) seconds to start another download.', html)
- if m != None:
+ if m is not None:
wait_time = int( m.group(1) )
self.wantReconnect = True
|