summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-29 00:47:57 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-29 00:47:57 +0100
commitbd8728d8d1f84922940617f214202b7852a91597 (patch)
treee59de9179e156efd63cd3d8f52615376597ac5a3 /module
parent[SimpleDereferer][SimpleHoster] Revert renewHTTPRequest (diff)
parentHost FreeWayMe: Improve error handling, try five times (diff)
downloadpyload-bd8728d8d1f84922940617f214202b7852a91597.tar.xz
Merge pull request #1041 from flubshi/stable
Host FreeWayMe: Improve error handling, try five times
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hoster/FreeWayMe.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/module/plugins/hoster/FreeWayMe.py b/module/plugins/hoster/FreeWayMe.py
index ffc8115d3..6d08e1f8d 100644
--- a/module/plugins/hoster/FreeWayMe.py
+++ b/module/plugins/hoster/FreeWayMe.py
@@ -6,7 +6,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class FreeWayMe(MultiHoster):
__name__ = "FreeWayMe"
__type__ = "hoster"
- __version__ = "0.15"
+ __version__ = "0.16"
__pattern__ = r'https://(?:www\.)?free-way\.me/.+'
@@ -24,13 +24,30 @@ class FreeWayMe(MultiHoster):
def handlePremium(self, pyfile):
user, data = self.account.selectAccount()
- self.download("https://www.free-way.me/load.php",
+ for _i in xrange(5):
+ # try it five times
+ header = self.load("https://www.free-way.me/load.php",
get={'multiget': 7,
'url' : pyfile.url,
'user' : user,
'pw' : self.account.getAccountData(user)['password'],
- 'json' : ""},
- disposition=True)
+ 'json' : ""}, just_header=True)
+ if "location" in header:
+ #download
+ self.logInfo("Download: " + header['location'])
+ headers = self.load(header['location'],just_header=True)
+ if headers['code'] == 500:
+ #error on 2nd stage
+ self.logInfo("Free-Way Error [stage2]")
+ # todo: handle errors
+ else:
+ # seems to work..
+ self.download(header['location'])
+ break
+ else:
+ #error page first stage
+ self.logInfo("Free-Way Error [stage1]")
+ # todo: handle errors
getInfo = create_getInfo(FreeWayMe)