diff options
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/MegaNz.py | 5 | ||||
-rw-r--r-- | module/plugins/hoster/PutlockerCom.py | 5 | ||||
-rw-r--r-- | module/plugins/hoster/SpeedLoadOrg.py | 38 | ||||
-rw-r--r-- | module/plugins/hoster/YoutubeCom.py | 12 |
4 files changed, 42 insertions, 18 deletions
diff --git a/module/plugins/hoster/MegaNz.py b/module/plugins/hoster/MegaNz.py index 1c48906ca..a28ddca9d 100644 --- a/module/plugins/hoster/MegaNz.py +++ b/module/plugins/hoster/MegaNz.py @@ -19,7 +19,7 @@ class MegaNz(Hoster): __name__ = "MegaNz" __type__ = "hoster" __pattern__ = r"https?://([a-z0-9]+\.)?mega\.co\.nz/#!([a-zA-Z0-9!_\-]+)" - __version__ = "0.1" + __version__ = "0.11" __description__ = """mega.co.nz hoster plugin""" __author_name__ = ("RaNaN", ) __author_mail__ = ("ranan@pyload.org", ) @@ -28,7 +28,8 @@ class MegaNz(Hoster): FILE_SUFFIX = ".crypted" def b64_decode(self, data): - return standard_b64decode(data.replace("-", "+").replace("_", "/")+ "=") + data = data.replace("-", "+").replace("_", "/") + return standard_b64decode(data + '=' * (-len(data) % 4)) def getCipherKey(self, key): """ Construct the cipher key from the given data """ diff --git a/module/plugins/hoster/PutlockerCom.py b/module/plugins/hoster/PutlockerCom.py index 8cfcd4d9e..ca5336231 100644 --- a/module/plugins/hoster/PutlockerCom.py +++ b/module/plugins/hoster/PutlockerCom.py @@ -52,7 +52,7 @@ class PutlockerCom(Hoster): __name__ = "PutlockerCom" __type__ = "hoster" __pattern__ = r'http://(www\.)?putlocker\.com/(file|embed)/[A-Z0-9]+' - __version__ = "0.2" + __version__ = "0.21" __description__ = """Putlocker.Com""" __author_name__ = ("jeix") @@ -111,6 +111,9 @@ class PutlockerCom(Hoster): self.link = re.search("\"(/get_file\\.php\\?download=[A-Z0-9]+\\&key=[a-z0-9]+&original=1)\"", self.html2) if self.link is None: + self.link = re.search("\"(/get_file\\.php\\?id=[A-Z0-9]+\\&key=[A-Za-z0-9=]+\\&original=1)\"", self.html2) + + if self.link is None: self.link = re.search("playlist: \\'(/get_file\\.php\\?stream=[A-Za-z0-9=]+)\\'", self.html2) if not self.link is None: self.html3 = self.load("http://www.putlocker.com" + self.link.group(1)) diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py index d5e89b93f..a725d9ae0 100644 --- a/module/plugins/hoster/SpeedLoadOrg.py +++ b/module/plugins/hoster/SpeedLoadOrg.py @@ -2,40 +2,60 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo from module.network.RequestFactory import getURL from module.plugins.ReCaptcha import ReCaptcha +from module.common.json_layer import json_loads import re def getInfo(urls): for url in urls: - header = getURL(url, just_header=True) - if 'Location: http://speedload.org/index.php' in header: - file_info = (url, 0, 1, url) + api_data = getAPIData(url) + online = False if 'File Not Found' in api_data else True + if online: + file_info = (api_data['originalFilename'], api_data['size'], 2 , url) else: - file_info = parseFileInfo(SpeedLoadOrg, url, getURL(url, decode=True)) + file_info = (url, 0, 1 , url) yield file_info +def getAPIData(url): + API_URL = 'http://speedload.org/api/single_link.php?shortUrl=' + + file_id = re.search(SpeedLoadOrg.__pattern__, url).group('ID') + api_data = json_loads(getURL(API_URL + file_id, decode = True)) + if isinstance(api_data, dict): + api_data['size'] = api_data['fileSize'] + + return api_data + class SpeedLoadOrg(SimpleHoster): __name__ = "SpeedLoadOrg" __type__ = "hoster" __pattern__ = r"http://(www\.)?speedload\.org/(?P<ID>\w+).*" - __version__ = "0.01" + __version__ = "0.06" __description__ = """Speedload.org hoster plugin""" - __author_name__ = ("z00nx") - __author_mail__ = ("z00nx0@gmail.com") + __author_name__ = ("z00nx", "stickell") + __author_mail__ = ("z00nx0@gmail.com", "l.stickell@yahoo.it") FILE_NAME_PATTERN = '<div class="d_file[^>]+>\s+<div>\s+<div[^>]+>(?P<N>[^<]+)</div>' FILE_SIZE_PATTERN = 'File Size: </span>(?P<S>[^<]+)</span>' + FILE_OFFLINE_PATTERN = '<div class="promo" style="[^"]+">' RECAPTCHA_KEY = '6LenSdkSAAAAAJyoP5jFZl4NNell2r4rzfXRZXGW' def handleFree(self): + self.api_data = getAPIData(self.pyfile.url) recaptcha = ReCaptcha(self) - self.load challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response, 'submit': 'continue', 'submitted': '1', 'd': '1'} self.download(self.pyfile.url, post=post_data) - check = self.checkDownload({"html": re.compile("\A<!DOCTYPE html PUBLIC")}) + check = self.checkDownload({ + "html": re.compile("\A<!DOCTYPE html PUBLIC"), + "busy": "You are already downloading a file. Please upgrade to premium.", + "socket": "Could not open socket"}) if check == "html": self.logDebug("Wrong captcha entered") self.invalidCaptcha() self.retry() + elif check == "busy": + self.retry(10, 300, "Already downloading") + elif check == "socket": + self.fail("Server error: Could not open socket") diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 29cb3f60a..a9fed5638 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -11,7 +11,7 @@ class YoutubeCom(Hoster): __name__ = "YoutubeCom" __type__ = "hoster" __pattern__ = r"(http|https)://(www\.)?(de\.)?\youtube\.com/watch\?v=.*" - __version__ = "0.28" + __version__ = "0.29" __config__ = [("quality", "sd;hd;fullhd;240p;360p;480p;720p;1080p;3072p", "Quality Setting", "hd"), ("fmt", "int", "FMT/ITAG Number (5-102, 0 for auto)", 0), (".mp4", "bool", "Allow .mp4", True), @@ -66,17 +66,17 @@ class YoutubeCom(Hoster): else: quality = {"sd":18,"hd":22,"fullhd":37,"240p":5,"360p":18,"480p":35,"720p":22,"1080p":37,"3072p":38} desired_fmt = self.getConf("fmt") - if desired_fmt and desired_fmt not in formats: + if desired_fmt and desired_fmt not in self.formats: self.logWarning("FMT %d unknown - using default." % desired_fmt) desired_fmt = 0 if not desired_fmt: desired_fmt = quality.get(self.getConf("quality"), 18) #parse available streams - streams = unquote(re.search(r'url_encoded_fmt_stream_map=(.*?);', html).group(1)) - streams = [x.split('&') for x in streams.split(',')] - streams = [dict((y.split('=')) for y in x) for x in streams] - streams = [(int(x['itag']), "%s&signature=%s" % (unquote(x['url']), x['sig'])) for x in streams] + streams = re.search(r'"url_encoded_fmt_stream_map": "(.*?)",', html).group(1) + streams = [x.split('\u0026') for x in streams.split(',')] + streams = [dict((y.split('=',1)) for y in x) for x in streams] + streams = [(int(x['itag']), "%s&signature=%s" % (unquote(x['url']), x['sig'])) for x in streams] #self.logDebug("Found links: %s" % streams) self.logDebug("AVAILABLE STREAMS: %s" % [x[0] for x in streams]) |