diff options
Diffstat (limited to 'pyload/plugin/hoster/FlyFilesNet.py')
-rw-r--r-- | pyload/plugin/hoster/FlyFilesNet.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/pyload/plugin/hoster/FlyFilesNet.py b/pyload/plugin/hoster/FlyFilesNet.py new file mode 100644 index 000000000..612de14bd --- /dev/null +++ b/pyload/plugin/hoster/FlyFilesNet.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- + +import re + +from urllib import unquote + +from pyload.network.RequestFactory import getURL +from pyload.plugin.internal.SimpleHoster import SimpleHoster + + +class FlyFilesNet(SimpleHoster): + __name__ = "FlyFilesNet" + __type__ = "hoster" + __version__ = "0.10" + + __pattern__ = r'http://(?:www\.)?flyfiles\.net/.+' + __config__ = [("use_premium", "bool", "Use premium account if available", True)] + + __description__ = """FlyFiles.net hoster plugin""" + __license__ = "GPLv3" + __authors__ = [] + + SESSION_PATTERN = r'flyfiles\.net/(.*)/.*' + NAME_PATTERN = r'flyfiles\.net/.*/(.*)' + + + def process(self, pyfile): + name = re.search(self.NAME_PATTERN, pyfile.url).group(1) + pyfile.name = unquote_plus(name) + + session = re.search(self.SESSION_PATTERN, pyfile.url).group(1) + + url = "http://flyfiles.net" + + # get download URL + parsed_url = getURL(url, post={"getDownLink": session}) + self.logDebug("Parsed URL: %s" % parsed_url) + + if parsed_url == '#downlink|' or parsed_url == "#downlink|#": + self.logWarning(_("Could not get the download URL. Please wait 10 minutes")) + self.wait(10 * 60, True) + self.retry() + + download_url = parsed_url.replace('#downlink|', '') + + self.download(download_url) |