summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/hoster/MyfastfileCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 13:35:34 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 13:35:34 +0200
commit1066d65b9ed19d8e1b061c13fc0156d823fea800 (patch)
tree4c1fcd3b0660d2ccb3ce4d2abc0077f1a7876725 /pyload/plugins/hoster/MyfastfileCom.py
parentDocs cleanup + remove script directory (diff)
parent[FTP] Restore pattern. (diff)
downloadpyload-1066d65b9ed19d8e1b061c13fc0156d823fea800.tar.xz
Merge remote-tracking branch 'pyload/stable' into 0.4.10
Conflicts: module/plugins/accounts/MultiDebridCom.py module/plugins/accounts/MyfastfileCom.py module/plugins/hooks/MultiDebridCom.py module/plugins/hooks/MyfastfileCom.py module/plugins/hooks/Premium4Me.py module/plugins/hooks/PremiumTo.py module/plugins/hoster/MultiDebridCom.py module/plugins/hoster/MyfastfileCom.py module/plugins/hoster/Premium4Me.py module/plugins/hoster/PremiumTo.py pyload/plugins/accounts/MultiDebridCom.py pyload/plugins/accounts/Premium4Me.py pyload/plugins/hooks/MultiDebridCom.py pyload/plugins/hooks/Premium4Me.py pyload/plugins/hoster/MultiDebridCom.py pyload/plugins/hoster/Premium4Me.py
Diffstat (limited to 'pyload/plugins/hoster/MyfastfileCom.py')
-rw-r--r--pyload/plugins/hoster/MyfastfileCom.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/pyload/plugins/hoster/MyfastfileCom.py b/pyload/plugins/hoster/MyfastfileCom.py
new file mode 100644
index 000000000..604e2ab06
--- /dev/null
+++ b/pyload/plugins/hoster/MyfastfileCom.py
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from pyload.plugins.Hoster import Hoster
+from pyload.utils import json_loads
+
+
+class MyfastfileCom(Hoster):
+ __name__ = "MyfastfileCom"
+ __type__ = "hoster"
+ __version__ = "0.04"
+
+ __pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/dl/'
+
+ __description__ = """Myfastfile.com hoster plugin"""
+ __author_name__ = "stickell"
+ __author_mail__ = "l.stickell@yahoo.it"
+
+
+ def setup(self):
+ self.chunkLimit = -1
+ self.resumeDownload = True
+
+ def process(self, pyfile):
+ if re.match(self.__pattern__, pyfile.url):
+ new_url = pyfile.url
+ elif not self.account:
+ self.logError(_("Please enter your %s account or deactivate this plugin") % "Myfastfile.com")
+ self.fail("No Myfastfile.com account provided")
+ else:
+ self.logDebug("Original URL: %s" % pyfile.url)
+ page = self.req.load('http://myfastfile.com/api.php',
+ get={'user': self.user, 'pass': self.account.getAccountData(self.user)['password'],
+ 'link': pyfile.url})
+ self.logDebug("JSON data: " + page)
+ page = json_loads(page)
+ if page['status'] != 'ok':
+ self.fail('Unable to unrestrict link')
+ new_url = page['link']
+
+ if new_url != pyfile.url:
+ self.logDebug("Unrestricted URL: " + new_url)
+
+ self.download(new_url, disposition=True)