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.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py
index 2c8ec58f4..3aa9dc2a9 100644
--- a/module/plugins/hoster/FilefactoryCom.py
+++ b/module/plugins/hoster/FilefactoryCom.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import re
-
-from urlparse import urljoin
+import urlparse
from module.network.RequestFactory import getURL
from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
@@ -21,9 +20,10 @@ def getInfo(urls):
class FilefactoryCom(SimpleHoster):
__name__ = "FilefactoryCom"
__type__ = "hoster"
- __version__ = "0.53"
+ __version__ = "0.56"
__pattern__ = r'https?://(?:www\.)?filefactory\.com/(file|trafficshare/\w+)/\w+'
+ __config__ = [("use_premium", "bool", "Use premium account if available", True)]
__description__ = """Filefactory.com hoster plugin"""
__license__ = "GPLv3"
@@ -32,7 +32,7 @@ class FilefactoryCom(SimpleHoster):
INFO_PATTERN = r'<div id="file_name"[^>]*>\s*<h2>(?P<N>[^<]+)</h2>\s*<div id="file_info">\s*(?P<S>[\d.,]+) (?P<U>[\w^_]+) uploaded'
- OFFLINE_PATTERN = r'<h2>File Removed</h2>|This file is no longer available'
+ OFFLINE_PATTERN = r'<h2>File Removed</h2>|This file is no longer available|Invalid Download Link'
LINK_FREE_PATTERN = LINK_PREMIUM_PATTERN = r'"([^"]+filefactory\.com/get.+?)"'
@@ -52,14 +52,14 @@ class FilefactoryCom(SimpleHoster):
if m is None:
self.error(_("Free download link not found"))
- dl_link = m.group(1)
+ self.link = m.group(1)
m = re.search(self.WAIT_PATTERN, self.html)
if m:
- self.wait(int(m.group(1)))
+ self.wait(m.group(1))
- self.download(dl_link, disposition=True)
+ def checkFile(self):
check = self.checkDownload({'multiple': "You are currently downloading too many files at once.",
'error' : '<div id="errorMessage">'})
@@ -70,6 +70,8 @@ class FilefactoryCom(SimpleHoster):
elif check == "error":
self.error(_("Unknown error"))
+ return super(FilefactoryCom, self).checkFile()
+
def handlePremium(self, pyfile):
self.link = self.directLink(self.load(pyfile.url, just_header=True))