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, 14 insertions, 2 deletions
diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py
index aebf0f38d..fdde1f9d7 100644
--- a/module/plugins/hoster/FilefactoryCom.py
+++ b/module/plugins/hoster/FilefactoryCom.py
@@ -57,12 +57,19 @@ class FilefactoryCom(SimpleHoster):
__name__ = "FilefactoryCom"
__type__ = "hoster"
__pattern__ = r"https?://(?:www\.)?filefactory\.com/file/(?P<id>[a-zA-Z0-9]+)"
- __version__ = "0.39"
+ __version__ = "0.41"
__description__ = """Filefactory.Com File Download Hoster"""
__author_name__ = ("stickell")
__author_mail__ = ("l.stickell@yahoo.it")
+ DIRECT_LINK_PATTERN = r'<section id="downloadLink">\s*<p class="textAlignCenter">\s*<a href="([^"]+)">[^<]+</a>\s*</p>\s*</section>'
+
def process(self, pyfile):
+ if not re.match(self.__pattern__ + r'/n/.+', pyfile.url): # Not in standard format
+ header = self.load(pyfile.url, just_header=True)
+ if 'location' in header:
+ self.pyfile.url = 'http://www.filefactory.com' + header['location']
+
if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()):
self.handlePremium()
else:
@@ -115,7 +122,12 @@ class FilefactoryCom(SimpleHoster):
elif 'content-disposition' in header:
url = self.pyfile.url
else:
- self.parseError('Unable to detect premium direct link')
+ html = self.load(self.pyfile.url)
+ found = re.search(self.DIRECT_LINK_PATTERN, html)
+ if found:
+ url = found.group(1)
+ else:
+ self.parseError('Unable to detect premium direct link')
self.logDebug('DIRECT PREMIUM LINK: ' + url)
self.download(url, disposition=True)