diff options
author | spoob <spoob@gmx.de> | 2009-12-16 22:28:57 +0100 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2009-12-16 22:28:57 +0100 |
commit | 9fd8d0c20d4495319b72bd2faa7275c75a7fcacc (patch) | |
tree | 2d1ac039749143801e8e41a0244874bbf2ffe4ef | |
parent | new images (diff) | |
download | pyload-9fd8d0c20d4495319b72bd2faa7275c75a7fcacc.tar.xz |
Fixed Relink.us, Uploaded.to Name Bug
-rw-r--r-- | module/download_thread.py | 17 | ||||
-rw-r--r-- | module/file_list.py | 5 | ||||
-rw-r--r-- | module/plugins/RelinkUs.py | 9 | ||||
-rw-r--r-- | module/plugins/UploadedTo.py | 12 |
4 files changed, 15 insertions, 28 deletions
diff --git a/module/download_thread.py b/module/download_thread.py index 89a10533a..401d6f943 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -140,22 +140,17 @@ class Download_Thread(threading.Thread): 20 - unknown error """ if code == 0: - self.parent.parent.logger.info("Checksum ok ('%s')" % status.filename) + self.parent.parent.logger.info("Checksum ok ('%s')" % status.filename) elif code == 1: - self.parent.parent.logger.info("Checksum not matched! ('%s')" % status.filename) + self.parent.parent.logger.info("Checksum not matched! ('%s')" % status.filename) elif code == 5: - self.parent.parent.logger.debug("Can't get checksum for %s" % status.filename) + self.parent.parent.logger.debug("Can't get checksum for %s" % status.filename) elif code == 10: - self.parent.parent.logger.debug("Checksum not implemented for %s" % status.filename) + self.parent.parent.logger.debug("Checksum not implemented for %s" % status.filename) if not check: - raise Checksum(code, location) - #print "checksum check returned: %s, %s" % (check, code) - - status.type = "finished" + raise Checksum(code, location) - #startet downloader - #urllib.urlretrieve(status.url, pyfile.download_folder + "/" + status.filename, status) - #self.shutdown = True + status.type = "finished" def wait(self, pyfile): pyfile.status.type = "waiting" diff --git a/module/file_list.py b/module/file_list.py index ae168900b..1cd069de7 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -144,7 +144,7 @@ class File_List(object): info["id"] = pyfile.id info["url"] = pyfile.url info["folder"] = pyfile.folder - info["filename"] = pyfile.filename + info["filename"] = pyfile.status.filename info["status_type"] = pyfile.status.type info["status_url"] = pyfile.status.url info["status_filename"] = pyfile.status.filename @@ -389,8 +389,7 @@ class PyLoadFile(): pluginClass = module.Plugin.Plugin self.plugin = pluginClass(self) self.status = Status(self) - if self.plugin.file_exists(): - self.filename = self.plugin.get_file_name() + self.status.filename = self.url def _get_my_plugin(self): for plugin, plugin_pattern in self.core.plugins_avaible.items(): diff --git a/module/plugins/RelinkUs.py b/module/plugins/RelinkUs.py index 786733558..71b441116 100644 --- a/module/plugins/RelinkUs.py +++ b/module/plugins/RelinkUs.py @@ -4,7 +4,7 @@ import re import time -from Plugin import Plugin +from module.Plugin import Plugin class RelinkUs(Plugin): @@ -14,10 +14,10 @@ class RelinkUs(Plugin): props['name'] = "RelinkUs" props['type'] = "container" props['pattern'] = r"http://(www\.)?relink.us/(f|((view|go).php))" - props['version'] = "0.2" + props['version'] = "1" props['description'] = """Relink.us Container Plugin""" - props['author_name'] = ("Sleeper-") - props['author_mail'] = ("@nonymous") + props['author_name'] = ("Sleeper-", "spoob") + props['author_mail'] = ("@nonymous", "spoob@pyload.org") self.props = props self.parent = parent self.html = None @@ -55,7 +55,6 @@ class RelinkUs(Plugin): # Wait some secs for relink.us server... time.sleep(5) - print new_link temp_links.append(new_link) self.links = temp_links diff --git a/module/plugins/UploadedTo.py b/module/plugins/UploadedTo.py index 4bddbd6f1..bb623b4e6 100644 --- a/module/plugins/UploadedTo.py +++ b/module/plugins/UploadedTo.py @@ -21,7 +21,6 @@ class UploadedTo(Plugin): self.props = props self.parent = parent self.html = None - self.html_old = None #time() where loaded the HTML self.time_plus_wait = None #time() + wait in seconds self.api_data = None self.want_reconnect = False @@ -35,12 +34,11 @@ class UploadedTo(Plugin): def prepare(self, thread): pyfile = self.parent - + self.want_reconnect = False tries = 0 while not pyfile.status.url: - self.req.clear_cookies() self.download_html() @@ -84,7 +82,7 @@ class UploadedTo(Plugin): self.api_data["filename"] = lines[0] self.api_data["size"] = lines[1] # in kbytes self.api_data["checksum"] = lines[2] #sha1 - + def download_html(self): if self.config['premium']: self.config['username'], self.config['password'] @@ -107,7 +105,6 @@ class UploadedTo(Plugin): if self.config['premium']: self.start_dl = True return self.parent.url - try: file_url_pattern = r".*<form name=\"download_form\" method=\"post\" action=\"(.*)\">" return re.search(file_url_pattern, self.html).group(1) @@ -124,12 +121,9 @@ class UploadedTo(Plugin): return file_name return file_name + file_suffix.group(1) except: - self.parent.status.url = None return self.parent.url def file_exists(self): - """ returns True or False - """ if re.search(r"(File doesn't exist .*)", self.html) != None: return False else: @@ -153,4 +147,4 @@ class UploadedTo(Plugin): else: return (False, 1) else: - return (True, 5) + return (True, 5) |