diff options
author | Stefano <l.stickell@yahoo.it> | 2014-07-02 14:56:10 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2014-07-02 14:56:10 +0200 |
commit | 47d3ef52a10e1a0db8b73fde81c9d3a7eaed00c3 (patch) | |
tree | 0eeaa5b60dfb0f6cd4feeb62101593eef1b9669d | |
parent | [UpdateManager] Fix interval changing procedure (diff) | |
download | pyload-47d3ef52a10e1a0db8b73fde81c9d3a7eaed00c3.tar.xz |
[Filefactory] getInfo handle direct links
Partially fixes #648
-rw-r--r-- | module/plugins/hoster/FilefactoryCom.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 21b803649..05edf6b99 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -16,14 +16,26 @@ import re -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo +from module.network.RequestFactory import getURL + + +def getInfo(urls): + for url in urls: + h = getURL(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 + file_info = parseFileInfo(FilefactoryCom, url, getURL(url)) + yield file_info class FilefactoryCom(SimpleHoster): __name__ = "FilefactoryCom" __type__ = "hoster" __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P<id>[a-zA-Z0-9]+)' - __version__ = "0.48" + __version__ = "0.49" __description__ = """Filefactory.com hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" @@ -101,6 +113,3 @@ class FilefactoryCom(SimpleHoster): self.logDebug('DIRECT PREMIUM LINK: ' + url) self.download(url, disposition=True) - - -getInfo = create_getInfo(FilefactoryCom) |