summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/MegauploadCom.py8
-rw-r--r--module/plugins/hoster/NetloadIn.py7
2 files changed, 13 insertions, 2 deletions
diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py
index 4d3a2a566..4c851a5b2 100644
--- a/module/plugins/hoster/MegauploadCom.py
+++ b/module/plugins/hoster/MegauploadCom.py
@@ -63,7 +63,6 @@ class MegauploadCom(Hoster):
def process(self, pyfile):
- self.pyfile = pyfile
if not self.account:
self.download_html()
self.download_api()
@@ -82,6 +81,12 @@ class MegauploadCom(Hoster):
pyfile.name = self.get_file_name()
self.download(pyfile.url)
+ check = self.checkDownload({"limit": "Download limit exceeded"}) #@TODO catch it earlier in html pages if possible
+ if check == "limit":
+ self.setWait(3600, True)
+ self.wait()
+ self.process(pyfile)
+
def download_html(self):
for i in range(5):
self.html[0] = self.load(self.pyfile.url)
@@ -112,6 +117,7 @@ class MegauploadCom(Hoster):
if re.search(r"Waiting time before each download begins", self.html[1]) is not None:
break
+
def download_api(self):
url = "http://megaupload.com/mgr_linkcheck.php"
diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py
index d03b86d5e..2c9a02964 100644
--- a/module/plugins/hoster/NetloadIn.py
+++ b/module/plugins/hoster/NetloadIn.py
@@ -133,7 +133,7 @@ class NetloadIn(Hoster):
def download_html(self):
self.log.debug("Netload: Entering download_html")
- page = self.load(self.url, cookies=True)
+ page = self.load(self.url)
if not self.api_data:
self.log.debug("API Data may be useless, get details from html page")
@@ -146,6 +146,10 @@ class NetloadIn(Hoster):
captchawaited = False
for i in range(10):
+
+ if not page:
+ page = self.load(self.url)
+
self.log.debug("Netload: try number %d " % i)
if self.getConf('dumpgen'):
print page
@@ -177,6 +181,7 @@ class NetloadIn(Hoster):
open("dump.html", "w").write(page)
self.log.debug("Netload: Could not find captcha, try again from beginning")
captchawaited = False
+ page = False
continue
file_id = re.search('<input name="file_id" type="hidden" value="(.*)" />', page).group(1)