summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-01 21:32:50 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-01 21:32:50 +0100
commit4ef402e6ded16e81be479cd7df25d0bd52abce66 (patch)
tree5b588635c65cc0eca4d48618729b2843cc548ffa
parentfixed last commit (diff)
downloadpyload-4ef402e6ded16e81be479cd7df25d0bd52abce66.tar.xz
flyfiles.net plugin
-rw-r--r--module/plugins/hoster/FlyFilesNet.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/module/plugins/hoster/FlyFilesNet.py b/module/plugins/hoster/FlyFilesNet.py
new file mode 100644
index 000000000..0ffb76191
--- /dev/null
+++ b/module/plugins/hoster/FlyFilesNet.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+import urllib
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.network.RequestFactory import getURL
+
+class FlyFilesNet(SimpleHoster):
+ __name__ = "FlyFilesNet"
+ __version__ = "0.1"
+ __type__ = "hoster"
+ __pattern__ = r'http://flyfiles\.net/.*'
+
+ SESSION_PATTERN = r'flyfiles\.net/(.*)/.*'
+ FILE_NAME_PATTERN = r'flyfiles\.net/.*/(.*)'
+
+ def process(self, pyfile):
+
+ pyfile.name = re.search(self.FILE_NAME_PATTERN, pyfile.url).group(1)
+ pyfile.name = urllib.unquote_plus(pyfile.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}, cookies=True)
+ 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.setWait(600, True) # wait 10 minutes
+ self.wait()
+ self.retry()
+
+ download_url = parsed_url.replace('#downlink|','')
+
+ self.logDebug("Download URL: %s" % download_url)
+ self.download(download_url)