summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/UploadingCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/UploadingCom.py')
-rw-r--r--module/plugins/hoster/UploadingCom.py37
1 files changed, 15 insertions, 22 deletions
diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py
index b163f2252..c2e0d2873 100644
--- a/module/plugins/hoster/UploadingCom.py
+++ b/module/plugins/hoster/UploadingCom.py
@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
+import pycurl
import re
-from pycurl import HTTPHEADER
-
from module.common.json_layer import json_loads
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp
@@ -11,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, t
class UploadingCom(SimpleHoster):
__name__ = "UploadingCom"
__type__ = "hoster"
- __version__ = "0.39"
+ __version__ = "0.40"
__pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P<ID>\w+)'
@@ -40,35 +39,34 @@ class UploadingCom(SimpleHoster):
self.getFileInfo()
if self.premium:
- self.handlePremium()
+ self.handlePremium(pyfile)
else:
- self.handleFree()
+ self.handleFree(pyfile)
- def handlePremium(self):
+ def handlePremium(self, pyfile):
postData = {'action': 'get_link',
- 'code': self.info['pattern']['ID'],
- 'pass': 'undefined'}
+ 'code' : self.info['pattern']['ID'],
+ 'pass' : 'undefined'}
self.html = self.load('http://uploading.com/files/get/?JsHttpRequest=%d-xml' % timestamp(), post=postData)
url = re.search(r'"link"\s*:\s*"(.*?)"', self.html)
if url:
- url = url.group(1).replace("\\/", "/")
- self.download(url)
+ self.link = url.group(1).replace("\\/", "/")
raise Exception("Plugin defect")
- def handleFree(self):
+ def handleFree(self, pyfile):
m = re.search('<h2>((Daily )?Download Limit)</h2>', self.html)
if m:
- self.pyfile.error = m.group(1)
- self.logWarning(self.pyfile.error)
- self.retry(6, (6 * 60 if m.group(2) else 15) * 60, self.pyfile.error)
+ pyfile.error = m.group(1)
+ self.logWarning(pyfile.error)
+ self.retry(6, (6 * 60 if m.group(2) else 15) * 60, pyfile.error)
ajax_url = "http://uploading.com/files/get/?ajax"
- self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"])
- self.req.http.lastURL = self.pyfile.url
+ self.req.http.c.setopt(pycurl.HTTPHEADER, ["X-Requested-With: XMLHttpRequest"])
+ self.req.http.lastURL = pyfile.url
res = json_loads(self.load(ajax_url, post={'action': 'second_page', 'code': self.info['pattern']['ID']}))
@@ -93,12 +91,7 @@ class UploadingCom(SimpleHoster):
else:
self.error(_("No URL"))
- self.download(url)
-
- check = self.checkDownload({"html": re.compile("\A<!DOCTYPE html PUBLIC")})
- if check == "html":
- self.logWarning(_("Redirected to a HTML page, wait 10 minutes and retry"))
- self.wait(10 * 60, True)
+ self.link = url
getInfo = create_getInfo(UploadingCom)