summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/hooks/AntiVirus.py2
-rw-r--r--module/plugins/hoster/MegaDebridEu.py6
-rw-r--r--module/plugins/hoster/RPNetBiz.py8
-rw-r--r--module/plugins/hoster/UploadingCom.py5
-rw-r--r--module/plugins/internal/Account.py1
-rw-r--r--module/plugins/internal/Addon.py2
-rw-r--r--module/plugins/internal/Crypter.py6
-rw-r--r--module/plugins/internal/Hoster.py15
-rw-r--r--module/plugins/internal/Plugin.py5
-rw-r--r--module/plugins/internal/SimpleHoster.py2
10 files changed, 27 insertions, 25 deletions
diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py
index b6fd0ca2d..b58d0b61d 100644
--- a/module/plugins/hooks/AntiVirus.py
+++ b/module/plugins/hooks/AntiVirus.py
@@ -63,7 +63,7 @@ class AntiVirus(Addon):
return
if p.returncode:
- pyfile.error = _("infected file")
+ pyfile.error = _("Infected file")
action = self.get_config('action')
try:
if action == "Delete":
diff --git a/module/plugins/hoster/MegaDebridEu.py b/module/plugins/hoster/MegaDebridEu.py
index 9049f0cd9..4afba0a3a 100644
--- a/module/plugins/hoster/MegaDebridEu.py
+++ b/module/plugins/hoster/MegaDebridEu.py
@@ -10,7 +10,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class MegaDebridEu(MultiHoster):
__name__ = "MegaDebridEu"
__type__ = "hoster"
- __version__ = "0.49"
+ __version__ = "0.50"
__status__ = "testing"
__pattern__ = r'http://((?:www\d+\.|s\d+\.)?mega-debrid\.eu|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/download/file/[\w^_]+'
@@ -30,9 +30,9 @@ class MegaDebridEu(MultiHoster):
Connexion to the mega-debrid API
Return True if succeed
"""
- user, data = self.account.select()
+ user, info = self.account.select()
jsonResponse = self.load(self.API_URL,
- get={'action': 'connectUser', 'login': user, 'password': data['password']})
+ get={'action': 'connectUser', 'login': user, 'password': info['login']['password']})
res = json_loads(jsonResponse)
if res['response_code'] == "ok":
diff --git a/module/plugins/hoster/RPNetBiz.py b/module/plugins/hoster/RPNetBiz.py
index 785d2b6c4..62e6bee4e 100644
--- a/module/plugins/hoster/RPNetBiz.py
+++ b/module/plugins/hoster/RPNetBiz.py
@@ -9,7 +9,7 @@ from module.common.json_layer import json_loads
class RPNetBiz(MultiHoster):
__name__ = "RPNetBiz"
__type__ = "hoster"
- __version__ = "0.16"
+ __version__ = "0.17"
__status__ = "testing"
__pattern__ = r'https?://.+rpnet\.biz'
@@ -26,12 +26,12 @@ class RPNetBiz(MultiHoster):
def handle_premium(self, pyfile):
- user, data = self.account.select()
+ user, info = self.account.select()
#: Get the download link
res = self.load("https://premium.rpnet.biz/client_api.php",
get={'username': user,
- 'password': data['password'],
+ 'password': info['login']['password'],
'action' : "generate",
'links' : pyfile.url})
@@ -50,7 +50,7 @@ class RPNetBiz(MultiHoster):
self.log_debug("Try: %d ; Max Tries: %d" % (my_try, max_tries))
res = self.load("https://premium.rpnet.biz/client_api.php",
get={'username': user,
- 'password': data['password'],
+ 'password': info['login']['password'],
'action' : "downloadInformation",
'id' : link_status['id']})
self.log_debug("JSON data hdd query: %s" % res)
diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py
index ad69c1669..36f0c766e 100644
--- a/module/plugins/hoster/UploadingCom.py
+++ b/module/plugins/hoster/UploadingCom.py
@@ -4,13 +4,14 @@ import pycurl
import re
from module.common.json_layer import json_loads
+from module.plugins.internal.Plugin import encode
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp
class UploadingCom(SimpleHoster):
__name__ = "UploadingCom"
__type__ = "hoster"
- __version__ = "0.42"
+ __version__ = "0.43"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P<ID>\w+)'
@@ -61,7 +62,7 @@ class UploadingCom(SimpleHoster):
def handle_free(self, pyfile):
m = re.search('<h2>((Daily )?Download Limit)</h2>', self.html)
if m:
- pyfile.error = m.group(1)
+ pyfile.error = encode(m.group(1))
self.log_warning(pyfile.error)
self.retry(6, (6 * 60 if m.group(2) else 15) * 60, pyfile.error)
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..62eb17aa6 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$'
@@ -347,6 +347,7 @@ class Plugin(object):
with open(framefile, "wb") as f:
del frame #: Delete the frame or it wont be cleaned
f.write(encode(res))
+
except IOError, e:
self.log_error(e)
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):