summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/FilefactoryCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/FilefactoryCom.py')
-rw-r--r--module/plugins/hoster/FilefactoryCom.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py
index ea1a38b7a..325b4bb27 100644
--- a/module/plugins/hoster/FilefactoryCom.py
+++ b/module/plugins/hoster/FilefactoryCom.py
@@ -3,24 +3,25 @@
import re
import urlparse
-from module.network.RequestFactory import getURL
-from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
+from module.network.RequestFactory import getURL as get_url
+from module.plugins.internal.SimpleHoster import SimpleHoster, parse_fileInfo
-def getInfo(urls):
+def get_info(urls):
for url in urls:
- h = getURL(url, just_header=True)
+ h = get_url(url, just_header=True)
m = re.search(r'Location: (.+)\r\n', h)
if m and not re.match(m.group(1), FilefactoryCom.__pattern__): #: It's a direct link! Skipping
yield (url, 0, 3, url)
else: #: It's a standard html page
- yield parseFileInfo(FilefactoryCom, url, getURL(url))
+ yield parse_fileInfo(FilefactoryCom, url, get_url(url))
class FilefactoryCom(SimpleHoster):
__name__ = "FilefactoryCom"
__type__ = "hoster"
- __version__ = "0.55"
+ __version__ = "0.57"
+ __status__ = "testing"
__pattern__ = r'https?://(?:www\.)?filefactory\.com/(file|trafficshare/\w+)/\w+'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
@@ -42,7 +43,7 @@ class FilefactoryCom(SimpleHoster):
COOKIES = [("filefactory.com", "locale", "en_US.utf8")]
- def handleFree(self, pyfile):
+ def handle_free(self, pyfile):
if "Currently only Premium Members can download files larger than" in self.html:
self.fail(_("File too large for free download"))
elif "All free download slots on this server are currently in use" in self.html:
@@ -59,22 +60,22 @@ class FilefactoryCom(SimpleHoster):
self.wait(m.group(1))
- def checkFile(self, rules={}):
- check = self.checkDownload({'multiple': "You are currently downloading too many files at once.",
+ def check_file(self):
+ check = self.check_download({'multiple': "You are currently downloading too many files at once.",
'error' : '<div id="errorMessage">'})
if check == "multiple":
- self.logDebug("Parallel downloads detected; waiting 15 minutes")
+ self.log_debug("Parallel downloads detected; waiting 15 minutes")
self.retry(wait_time=15 * 60, reason=_("Parallel downloads"))
elif check == "error":
self.error(_("Unknown error"))
- return super(FilefactoryCom, self).checkFile(rules)
+ return super(FilefactoryCom, self).check_file()
- def handlePremium(self, pyfile):
- self.link = self.directLink(self.load(pyfile.url, just_header=True))
+ def handle_premium(self, pyfile):
+ self.link = self.direct_link(self.load(pyfile.url, just_header=True))
if not self.link:
html = self.load(pyfile.url)