diff options
-rw-r--r-- | module/plugins/internal/Account.py | 1 | ||||
-rw-r--r-- | module/plugins/internal/Addon.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/Crypter.py | 6 | ||||
-rw-r--r-- | module/plugins/internal/Hoster.py | 15 | ||||
-rw-r--r-- | module/plugins/internal/Plugin.py | 4 | ||||
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 2 |
6 files changed, 15 insertions, 15 deletions
diff --git a/module/plugins/internal/Account.py b/module/plugins/internal/Account.py index 1da31eede..e9ba5e533 100644 --- a/module/plugins/internal/Account.py +++ b/module/plugins/internal/Account.py @@ -73,7 +73,6 @@ class Account(Plugin): finally: self.clean() - return res diff --git a/module/plugins/internal/Addon.py b/module/plugins/internal/Addon.py index a2d51aa50..45ca98eac 100644 --- a/module/plugins/internal/Addon.py +++ b/module/plugins/internal/Addon.py @@ -96,7 +96,7 @@ class Addon(Plugin): self.periodical() except Exception, e: - self.log_error(_("Error executing addon: %s") % e) + self.log_error(_("Error executing periodical task: %s") % e) if self.pyload.debug: traceback.print_exc() diff --git a/module/plugins/internal/Crypter.py b/module/plugins/internal/Crypter.py index 0fdec559d..d0e8eb1b4 100644 --- a/module/plugins/internal/Crypter.py +++ b/module/plugins/internal/Crypter.py @@ -2,14 +2,14 @@ import urlparse -from module.plugins.internal.Hoster import Hoster +from module.plugins.internal.Hoster import Hoster, _fixurl from module.utils import save_path as safe_filename class Crypter(Hoster): __name__ = "Crypter" __type__ = "crypter" - __version__ = "0.06" + __version__ = "0.07" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -93,7 +93,7 @@ class Crypter(Hoster): elif not folder_per_package or name is not folder: if not folder: - folder = urlparse.urlparse(name).path.split("/")[-1] + folder = urlparse.urlparse(_fixurl(name)).path.split("/")[-1] set_folder(safe_filename(folder)) self.log_debug("Set package %(name)s folder to: %(folder)s" % {'name': name, 'folder': folder}) diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py index edc6f5d30..67feec38c 100644 --- a/module/plugins/internal/Hoster.py +++ b/module/plugins/internal/Hoster.py @@ -43,7 +43,7 @@ def create_getInfo(klass): class Hoster(Plugin): __name__ = "Hoster" __type__ = "hoster" - __version__ = "0.17" + __version__ = "0.18" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -373,6 +373,9 @@ class Hoster(Plugin): self.log_debug("DOWNLOAD URL " + url, *["%s=%s" % (key, val) for key, val in locals().items() if key not in ("self", "url")]) + name = _fixurl(self.pyfile.name) + self.pyfile.name = urlparse.urlparse(name).path.split('/')[-1] or name + self.captcha.correct() self.check_for_same_files() @@ -384,15 +387,13 @@ class Hoster(Plugin): if not exists(download_location): try: os.makedirs(download_location) - except Exception, e: self.fail(e) self.set_permissions(download_location) location = fs_decode(download_location) - name = safe_filename(urlparse.urlparse(self.pyfile.name).path.split('/')[-1] or self.pyfile.name) - filename = os.path.join(location, name) + filename = os.path.join(location, safe_filename(self.pyfile.name)) #@TODO: Move `safe_filename` check to HTTPDownload in 0.4.10 self.pyload.hookManager.dispatchEvent("download_start", self.pyfile, url, filename) @@ -407,10 +408,10 @@ class Hoster(Plugin): self.pyfile.size = self.req.size #@TODO: Recheck in 0.4.10 - if disposition: + if disposition and newname: finalname = urlparse.urlparse(newname).path.split('/')[-1].split(' filename*=')[0] - if finalname != newname != name: + if finalname != newname != self.pyfile.name: try: os.rename(fs_join(location, newname), fs_join(location, finalname)) @@ -418,7 +419,7 @@ class Hoster(Plugin): self.log_warning(_("Error renaming `%s` to `%s`") % (newname, finalname), e) finalname = newname - self.log_info(_("`%s` saved as `%s`") % (name, finalname)) + self.log_info(_("`%s` saved as `%s`") % (self.pyfile.name, finalname)) self.pyfile.name = finalname filename = os.path.join(location, finalname) diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index 570c984ac..ac6b4a57e 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -48,7 +48,7 @@ def exists(path): #@TODO: Move to utils in 0.4.10 def fixurl(url): - return html_unescape(urllib.unquote(url.decode('unicode-escape'))).strip() + return html_unescape(urllib.unquote(url.decode('unicode-escape'))).strip().rstrip('/') #@TODO: Move to utils in 0.4.10 @@ -142,7 +142,7 @@ def chunks(iterable, size): class Plugin(object): __name__ = "Plugin" __type__ = "hoster" - __version__ = "0.26" + __version__ = "0.27" __status__ = "testing" __pattern__ = r'^unmatchable$' diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 8588fc5c5..1d456a3ee 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -424,7 +424,7 @@ class SimpleHoster(Hoster): elif re.search('filename', errmsg, re.I): url_p = urlparse.urlparse(self.pyfile.url) - self.pyfile.url = "%s://%s/%s" % (url_p.scheme, url_p.netloc, url_p.path.strip('/').split('/')[0]) + self.pyfile.url = "%s://%s/%s" % (url_p.scheme, url_p.netloc, url_p.path.split('/')[0]) self.retry(1, reason=_("Wrong url")) elif re.search('premium', errmsg, re.I): |