diff options
Diffstat (limited to 'pyload/plugin/internal')
-rw-r--r-- | pyload/plugin/internal/BasePlugin.py | 17 | ||||
-rw-r--r-- | pyload/plugin/internal/SimpleCrypter.py | 7 | ||||
-rw-r--r-- | pyload/plugin/internal/SimpleDereferer.py | 5 | ||||
-rw-r--r-- | pyload/plugin/internal/SimpleHoster.py | 4 | ||||
-rw-r--r-- | pyload/plugin/internal/XFSAccount.py | 5 | ||||
-rw-r--r-- | pyload/plugin/internal/XFSCrypter.py | 4 | ||||
-rw-r--r-- | pyload/plugin/internal/XFSHoster.py | 10 |
7 files changed, 21 insertions, 31 deletions
diff --git a/pyload/plugin/internal/BasePlugin.py b/pyload/plugin/internal/BasePlugin.py index c5fbde8bb..6be9880fc 100644 --- a/pyload/plugin/internal/BasePlugin.py +++ b/pyload/plugin/internal/BasePlugin.py @@ -1,9 +1,8 @@ # -*- coding: utf-8 -*- import re - -from urllib import unquote -from urlparse import urljoin, urlparse +import urllib +import urlparse from pyload.network.HTTPRequest import BadHeader from pyload.plugin.internal.SimpleHoster import getFileURL @@ -13,7 +12,7 @@ from pyload.plugin.Hoster import Hoster class BasePlugin(Hoster): __name = "BasePlugin" __type = "hoster" - __version = "0.42" + __version = "0.43" __pattern = r'^unmatchable$' @@ -25,8 +24,8 @@ class BasePlugin(Hoster): @classmethod def getInfo(cls, url="", html=""): #@TODO: Move to hoster class in 0.4.10 - url = unquote(url) - url_p = urlparse(url) + url = urllib.unquote(url) + url_p = urlparse.urlparse(url) return {'name' : (url_p.path.split('/')[-1] or url_p.query.split('=', 1)[::-1][0].split('&', 1)[0] or url_p.netloc.split('.', 1)[0]), @@ -39,8 +38,6 @@ class BasePlugin(Hoster): self.chunkLimit = -1 self.multiDL = True self.resumeDownload = True - - def process(self, pyfile): """main function""" @@ -51,7 +48,7 @@ class BasePlugin(Hoster): for _i in xrange(5): try: - link = getFileURL(self, unquote(pyfile.url)) + link = getFileURL(self, urllib.unquote(pyfile.url)) if link: self.download(link, ref=False, disposition=True) @@ -67,7 +64,7 @@ class BasePlugin(Hoster): account = self.core.accountManager.getAccountPlugin('Http') servers = [x['login'] for x in account.getAllAccounts()] - server = urlparse(pyfile.url).netloc + server = urlparse.urlparse(pyfile.url).netloc if server in servers: self.logDebug("Logging on to %s" % server) diff --git a/pyload/plugin/internal/SimpleCrypter.py b/pyload/plugin/internal/SimpleCrypter.py index c6582647f..e22a4df29 100644 --- a/pyload/plugin/internal/SimpleCrypter.py +++ b/pyload/plugin/internal/SimpleCrypter.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from urlparse import urljoin, urlparse +import urlparse from pyload.plugin.Crypter import Crypter from pyload.plugin.internal.SimpleHoster import SimpleHoster, replace_patterns, set_cookies @@ -136,10 +135,10 @@ class SimpleCrypter(Crypter, SimpleHoster): Returns the links extracted from self.html You should override this only if it's impossible to extract links using only the LINK_PATTERN. """ - url_p = urlparse(self.pyfile.url) + url_p = urlparse.urlparse(self.pyfile.url) baseurl = "%s://%s" % (url_p.scheme, url_p.netloc) - return [urljoin(baseurl, link) if not urlparse(link).scheme else link \ + return [urlparse.urljoin(baseurl, link) if not urlparse.urlparse(link).scheme else link \ for link in re.findall(self.LINK_PATTERN, self.html)] diff --git a/pyload/plugin/internal/SimpleDereferer.py b/pyload/plugin/internal/SimpleDereferer.py index c82afe0b4..0ec947751 100644 --- a/pyload/plugin/internal/SimpleDereferer.py +++ b/pyload/plugin/internal/SimpleDereferer.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from urllib import unquote +import urllib from pyload.plugin.Crypter import Crypter from pyload.plugin.internal.SimpleHoster import getFileURL, set_cookies @@ -49,7 +48,7 @@ class SimpleDereferer(Crypter): if not link: try: - link = unquote(re.match(self.__pattern, pyfile.url).group('LINK')) + link = urllib.unquote(re.match(self.__pattern, pyfile.url).group('LINK')) except Exception: self.prepare() diff --git a/pyload/plugin/internal/SimpleHoster.py b/pyload/plugin/internal/SimpleHoster.py index 8b53559e7..a87986330 100644 --- a/pyload/plugin/internal/SimpleHoster.py +++ b/pyload/plugin/internal/SimpleHoster.py @@ -244,7 +244,7 @@ def secondsToMidnight(gmt=0): class SimpleHoster(Hoster): __name = "SimpleHoster" __type = "hoster" - __version = "1.39" + __version = "1.40" __pattern = r'^unmatchable$' __config = [("use_premium", "bool", "Use premium account if available", True)] @@ -492,8 +492,6 @@ class SimpleHoster(Hoster): self.retryFree() else: raise Fail(e) - - def downloadLink(self, link, disposition=True): if link and isinstance(link, basestring): self.correctCaptcha() diff --git a/pyload/plugin/internal/XFSAccount.py b/pyload/plugin/internal/XFSAccount.py index d8c5a91f1..105df3cd5 100644 --- a/pyload/plugin/internal/XFSAccount.py +++ b/pyload/plugin/internal/XFSAccount.py @@ -2,8 +2,7 @@ import re import time - -from urlparse import urljoin +import urlparse from pyload.plugin.Account import Account from pyload.plugin.internal.SimpleHoster import parseHtmlForm, set_cookies @@ -155,7 +154,7 @@ class XFSAccount(Account): raise Exception(_("Missing HOSTER_DOMAIN")) if not self.LOGIN_URL: - self.LOGIN_URL = urljoin(self.HOSTER_URL, "login.html") + self.LOGIN_URL = urlparse.urljoin(self.HOSTER_URL, "login.html") html = req.load(self.LOGIN_URL, decode=True) action, inputs = parseHtmlForm('name="FL"', html) diff --git a/pyload/plugin/internal/XFSCrypter.py b/pyload/plugin/internal/XFSCrypter.py index 6c3a97405..4297de842 100644 --- a/pyload/plugin/internal/XFSCrypter.py +++ b/pyload/plugin/internal/XFSCrypter.py @@ -6,7 +6,7 @@ from pyload.plugin.internal.SimpleCrypter import SimpleCrypter class XFSCrypter(SimpleCrypter): __name = "XFSCrypter" __type = "crypter" - __version = "0.06" + __version = "0.07" __pattern = r'^unmatchable$' @@ -19,7 +19,7 @@ class XFSCrypter(SimpleCrypter): URL_REPLACEMENTS = [(r'&?per_page=\d+', ""), (r'[?/&]+$', ""), (r'(.+/[^?]+)$', r'\1?'), (r'$', r'&per_page=10000')] - LINK_PATTERN = r'<(?:td|TD).*?>\s*<a href="(.+?)".*?>.+?(?:</a>)?\s*</(?:td|TD)>' + LINK_PATTERN = r'<a href="(.+?)".*?>.+?(?:</a>)?\s*</(?:td|TD)>' NAME_PATTERN = r'<[tT]itle>.*?\: (?P<N>.+) folder</[tT]itle>' OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' diff --git a/pyload/plugin/internal/XFSHoster.py b/pyload/plugin/internal/XFSHoster.py index ff8077f81..ca0dca045 100644 --- a/pyload/plugin/internal/XFSHoster.py +++ b/pyload/plugin/internal/XFSHoster.py @@ -1,11 +1,9 @@ # -*- coding: utf-8 -*- +import pycurl +import random import re -import time - -from random import random -from urlparse import urljoin, urlparse - +import urlparse from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.captcha.SolveMedia import SolveMedia from pyload.plugin.internal.SimpleHoster import SimpleHoster, secondsToMidnight @@ -129,7 +127,7 @@ class XFSHoster(SimpleHoster): action, inputs = self.parseHtmlForm() - upload_id = "%012d" % int(random() * 10 ** 12) + upload_id = "%012d" % int(random.random() * 10 ** 12) action += upload_id + "&js_on=1&utype=prem&upload_type=url" inputs['tos'] = '1' |