diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-04 14:42:56 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-04 14:42:56 +0200 |
commit | d8f424dd6fcfd68a5e758a95347668d5a2939984 (patch) | |
tree | 7e7b79bfcd576b871be4110cae82583721728734 | |
parent | megaupload fix 2 (diff) | |
download | pyload-d8f424dd6fcfd68a5e758a95347668d5a2939984.tar.xz |
hoster fixes, new tray icon
-rw-r--r-- | module/PluginThread.py | 11 | ||||
-rw-r--r-- | module/gui/ConnectionManager.py | 7 | ||||
-rw-r--r-- | module/plugins/hoster/MegauploadCom.py | 8 | ||||
-rw-r--r-- | module/plugins/hoster/NetloadIn.py | 18 | ||||
-rwxr-xr-x | pyLoadCli.py | 1 | ||||
-rwxr-xr-x | pyLoadGui.py | 2 |
6 files changed, 30 insertions, 17 deletions
diff --git a/module/PluginThread.py b/module/PluginThread.py index c3d6c9ec7..e6e0c50c7 100644 --- a/module/PluginThread.py +++ b/module/PluginThread.py @@ -186,16 +186,17 @@ class DownloadThread(PluginThread): except error, e: code, msg = e - if self.m.core.debug: - print "pycurl error", code, msg - print_exc() - self.writeDebugReport(pyfile) - if code in (7,52): + if code in (7,52,56): self.m.log.warning(_("Couldn't connect to host waiting 1 minute and retry.")) sleep(60) self.queue.put(pyfile) continue + else: + print "pycurl error", code, msg + if self.m.core.debug: + print_exc() + self.writeDebugReport(pyfile) pyfile.plugin.req.clean() self.active = False diff --git a/module/gui/ConnectionManager.py b/module/gui/ConnectionManager.py index 0bdeae282..d0050e69d 100644 --- a/module/gui/ConnectionManager.py +++ b/module/gui/ConnectionManager.py @@ -19,6 +19,8 @@ from PyQt4.QtCore import * from PyQt4.QtGui import * +from os.path import join + from uuid import uuid4 as uuid class ConnectionManager(QWidget): @@ -27,7 +29,10 @@ class ConnectionManager(QWidget): mainLayout = QHBoxLayout() buttonLayout = QVBoxLayout() - + + self.setWindowTitle(_("pyLoad ConnectionManager")) + self.setWindowIcon(QIcon(join(pypath, "icons","logo.png"))) + connList = QListWidget() new = QPushButton(_("New")) diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index a4a577c04..8f22f4a66 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -72,15 +72,17 @@ class MegauploadCom(Hoster): for i in range(5): self.html[0] = self.load(self.pyfile.url) count = 0 - while re.search("document.location='http://www.megaupload.com/?c=msg", self.html[0]) != None: + while "document.location='http://www.megaupload.com/?c=msg" in self.html[0]: # megaupload.com/?c=msg usually says: Please check back in 2 minutes, # so we can spare that http request self.setWait(120) - self.wantReconnect = True + if count > 1: + self.wantReconnect = True + self.wait() self.html[0] = self.load(self.pyfile.url) - count ++ + count += 1 if count > 5: self.fail(_("%s: Megaupload is currently blocking your IP. Try again later, manually."% self.__name__)) diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 07b072a4d..61f0e3c12 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -89,19 +89,25 @@ class NetloadIn(Hoster): self.fail("Failed") return False - def download_api_data(self): + def download_api_data(self, n=0): url = self.url id_regex = re.compile("http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)") match = id_regex.search(url) if match: apiurl = "http://netload.in/share/fileinfos2.php" - src = self.load(apiurl, cookies=False, get={"file_id": match.group(1)}) + src = self.load(apiurl, cookies=False, get={"file_id": match.group(1)}).strip() + if not src and n < 3: + sleep(0.2) + self.download_api_data(n+1) + return + else: + self.fail(_("No API Data was send")) + self.log.debug("Netload: APIDATA: "+src.strip()) self.api_data = {} if src == "unknown_server_data": self.api_data = False - elif not src == "unknown file_data": - + elif src != "unknown file_data": lines = src.split(";") self.api_data["exists"] = True self.api_data["fileid"] = lines[0] @@ -167,19 +173,19 @@ class NetloadIn(Hoster): captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', page).group(1) except: open("dump.html", "w").write(page) - self.log.debug("Netload: Could not find captcha, try again from begining") + self.log.debug("Netload: Could not find captcha, try again from beginning") continue file_id = re.search('<input name="file_id" type="hidden" value="(.*)" />', page).group(1) if not captchawaited: wait = self.get_wait_time(page) + if i == 1: wait = 1 self.log.info(_("Netload: waiting for captcha %d s." % wait)) self.setWait(wait) self.wait() captchawaited = True captcha = self.decryptCaptcha(captcha_url) - sleep(4) page = self.load("http://netload.in/index.php?id=10", post={"file_id": file_id, "captcha_check": captcha}, cookies=True) return False diff --git a/pyLoadCli.py b/pyLoadCli.py index da261a070..14934ff50 100755 --- a/pyLoadCli.py +++ b/pyLoadCli.py @@ -27,7 +27,6 @@ from os.path import join import sys from sys import exit import threading -import time from time import sleep import xmlrpclib from traceback import print_exc diff --git a/pyLoadGui.py b/pyLoadGui.py index 3d4f59b62..b516ba9b4 100755 --- a/pyLoadGui.py +++ b/pyLoadGui.py @@ -653,7 +653,7 @@ class main(QObject): class TrayIcon(QSystemTrayIcon): def __init__(self): - QSystemTrayIcon.__init__(self, QIcon(join(pypath, "icons", "logo.png"))) + QSystemTrayIcon.__init__(self, QIcon(join(pypath, "icons", "logo-gui.png"))) self.contextMenu = QMenu() self.showAction = QAction(_("Show"), self.contextMenu) self.showAction.setCheckable(True) |