diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-03-24 17:16:34 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-03-24 17:16:34 +0100 |
commit | 3ae2fbb170ad0f2bfe1ebf7f59e76d3645861f0a (patch) | |
tree | b01e2c881aaf744aaab0af613a7a26e7129f2028 /module/plugins/crypter | |
parent | enter captchas on webui (diff) | |
parent | Rapidgator: fixed bug #47 (diff) | |
download | pyload-3ae2fbb170ad0f2bfe1ebf7f59e76d3645861f0a.tar.xz |
Merge remote-tracking branch 'origin/stable'
Conflicts:
module/plugins/accounts/FilesonicCom.py
module/plugins/accounts/OronCom.py
module/plugins/accounts/ShareonlineBiz.py
module/plugins/addons/UpdateManager.py
module/plugins/crypter/FilesonicComFolder.py
module/plugins/hoster/BezvadataCz.py
module/plugins/hoster/EuroshareEu.py
module/plugins/hoster/FilesonicCom.py
module/plugins/hoster/MegauploadCom.py
module/plugins/hoster/Premium4Me.py
module/plugins/hoster/YoutubeCom.py
module/plugins/internal/MultiHoster.py
module/utils.py
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r-- | module/plugins/crypter/Dereferer.py | 34 | ||||
-rw-r--r-- | module/plugins/crypter/DuckCryptInfo.py | 7 | ||||
-rw-r--r-- | module/plugins/crypter/FilebeerInfoFolder.py | 35 | ||||
-rw-r--r-- | module/plugins/crypter/FilesonicComFolder.py | 29 | ||||
-rw-r--r-- | module/plugins/crypter/LetitbitNetFolder.py | 33 | ||||
-rw-r--r-- | module/plugins/crypter/LinkSaveIn.py | 14 | ||||
-rw-r--r-- | module/plugins/crypter/LinkdecrypterCom.py | 62 | ||||
-rw-r--r-- | module/plugins/crypter/LixIn.py | 23 | ||||
-rw-r--r-- | module/plugins/crypter/MegauploadComFolder.py | 22 | ||||
-rw-r--r-- | module/plugins/crypter/Movie2kTo.py | 141 | ||||
-rw-r--r-- | module/plugins/crypter/NetfolderIn.py | 4 | ||||
-rw-r--r-- | module/plugins/crypter/RelinkUs.py | 270 | ||||
-rw-r--r-- | module/plugins/crypter/ShareLinksBiz.py | 22 | ||||
-rw-r--r-- | module/plugins/crypter/SpeedLoadOrgFolder.py | 15 | ||||
-rw-r--r-- | module/plugins/crypter/TrailerzoneInfo.py | 4 | ||||
-rw-r--r-- | module/plugins/crypter/UploadedToFolder.py | 45 | ||||
-rw-r--r-- | module/plugins/crypter/YoutubeBatch.py | 27 |
17 files changed, 574 insertions, 213 deletions
diff --git a/module/plugins/crypter/Dereferer.py b/module/plugins/crypter/Dereferer.py new file mode 100644 index 000000000..584835e18 --- /dev/null +++ b/module/plugins/crypter/Dereferer.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. +""" + +import re +import urllib + +from module.plugins.Crypter import Crypter + +class Dereferer(Crypter): + __name__ = "Dereferer" + __type__ = "crypter" + __pattern__ = r'https?://([^/]+)/.*?(?P<url>(ht|f)tps?(://|%3A%2F%2F).*)' + __version__ = "0.1" + __description__ = """Crypter for dereferers""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + def decrypt(self, pyfile): + link = re.match(self.__pattern__, self.pyfile.url).group('url') + self.core.files.addLinks([ urllib.unquote(link).rstrip('+') ], self.pyfile.package().id) diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index 6e7166ff8..4886d24db 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -8,7 +8,7 @@ class DuckCryptInfo(Crypter): __name__ = "DuckCryptInfo" __type__ = "container" __pattern__ = r"http://(?:www\.)?duckcrypt.info/(folder|wait|link)/(\w+)/?(\w*)" - __version__ = "0.01" + __version__ = "0.02" __description__ = """DuckCrypt.Info Container Plugin""" __author_name__ = ("godofdream") __author_mail__ = ("soilfiction@gmail.com") @@ -39,12 +39,13 @@ class DuckCryptInfo(Crypter): self.logDebug("Redirectet to " + str(found.group(0))) src = self.load(str(found.group(0))) soup = BeautifulSoup(src) - cryptlinks = soup.find("div", attrs={"class": "folderbox"}).findAll("a") + cryptlinks = soup.findAll("div", attrs={"class": "folderbox"}) self.logDebug("Redirectet to " + str(cryptlinks)) if not cryptlinks: self.fail('no links found - (Plugin out of date?)') for clink in cryptlinks: - self.handleLink(clink['href']) + if clink.find("a"): + self.handleLink(clink.find("a")['href']) def handleLink(self, url): src = self.load(url) diff --git a/module/plugins/crypter/FilebeerInfoFolder.py b/module/plugins/crypter/FilebeerInfoFolder.py new file mode 100644 index 000000000..f45144f14 --- /dev/null +++ b/module/plugins/crypter/FilebeerInfoFolder.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +import re +from module.plugins.Crypter import Crypter + +class FilebeerInfoFolder(Crypter): + __name__ = "FilebeerInfoFolder" + __type__ = "crypter" + __pattern__ = r"http://(?:www\.)?filebeer\.info/(\d+~f).*" + __version__ = "0.01" + __description__ = """Filebeer.info Folder Plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + LINK_PATTERN = r'<td title="[^"]*"><a href="([^"]+)" target="_blank">' + PAGE_COUNT_PATTERN = r'<p class="introText">\s*Total Pages (\d+)' + + def decrypt(self, pyfile): + pyfile.url = re.sub(self.__pattern__, r'http://filebeer.info/\1?page=1', pyfile.url) + html = self.load(pyfile.url) + + page_count = int(re.search(self.PAGE_COUNT_PATTERN, html).group(1)) + new_links = [] + + for i in range(1, page_count + 1): + self.logInfo("Fetching links from page %i" % i) + new_links.extend(re.findall(self.LINK_PATTERN, html)) + + if i < page_count: + html = self.load("%s?page=%d" % (pyfile.url, i+1)) + + if new_links: + self.core.files.addLinks(new_links, self.pyfile.package().id) + else: + self.fail('Could not extract any links')
\ No newline at end of file diff --git a/module/plugins/crypter/FilesonicComFolder.py b/module/plugins/crypter/FilesonicComFolder.py deleted file mode 100644 index 02ae66295..000000000 --- a/module/plugins/crypter/FilesonicComFolder.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -from module.plugins.Crypter import Crypter - -class FilesonicComFolder(Crypter): - __pattern__ = r"http://(\w*\.)?(sharingmatrix|filesonic|wupload)\.[^/]*/folder/\w+/?" - __version__ = "0.11" - __description__ = """Filesonic.com/Wupload.com Folder Plugin""" - __author_name__ = ("zoidberg") - __author_mail__ = ("zoidberg@mujmail.cz") - - FOLDER_PATTERN = r'<table>\s*<caption>Files Folder</caption>(.*?)</table>' - LINK_PATTERN = r'<a href="([^"]+)">' - - def decryptURL(self, url): - html = self.load(url) - new_links = [] - - folder = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if not folder: self.fail("Parse error (FOLDER)") - - new_links.extend(re.findall(self.LINK_PATTERN, folder.group(1))) - - if new_links: - return new_links - else: - self.fail('Could not extract any links') - diff --git a/module/plugins/crypter/LetitbitNetFolder.py b/module/plugins/crypter/LetitbitNetFolder.py new file mode 100644 index 000000000..68aad9dd7 --- /dev/null +++ b/module/plugins/crypter/LetitbitNetFolder.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +import re +from module.plugins.Crypter import Crypter + + +class LetitbitNetFolder(Crypter): + __name__ = "LetitbitNetFolder" + __type__ = "crypter" + __pattern__ = r"http://(?:www\.)?letitbit.net/folder/\w+" + __version__ = "0.1" + __description__ = """Letitbit.net Folder Plugin""" + __author_name__ = ("DHMH", "z00nx") + __author_mail__ = ("webmaster@pcProfil.de", "z00nx0@gmail.com") + + FOLDER_PATTERN = r'<table>(.*)</table>' + LINK_PATTERN = r'<a href="([^"]+)" target="_blank">' + + def decrypt(self, pyfile): + html = self.load(self.pyfile.url) + + new_links = [] + + folder = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + if folder is None: + self.fail("Parse error (FOLDER)") + + new_links.extend(re.findall(self.LINK_PATTERN, folder.group(0))) + + if new_links: + self.core.files.addLinks(new_links, self.pyfile.package().id) + else: + self.fail('Could not extract any links') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 2d568c592..30cc61055 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -97,10 +97,10 @@ class LinkSaveIn(Crypter): self.html = self.load(self.pyfile.url, post=post)
def unlockCaptchaProtection(self):
- hash = re.search(r'name="hash" value="([^"]+)', self.html).group(1)
- captchaUrl = re.search(r'src=".(/captcha/cap.php\?hsh=[^"]+)', self.html).group(1)
- code = self.decryptCaptcha("http://linksave.in" + captchaUrl, forceUser=True)
- self.html = self.load(self.pyfile.url, post={"id": self.fileid, "hash": hash, "code": code})
+ captcha_hash = re.search(r'name="hash" value="([^"]+)', self.html).group(1)
+ captcha_url = re.search(r'src=".(/captcha/cap.php\?hsh=[^"]+)', self.html).group(1)
+ captcha_code = self.decryptCaptcha("http://linksave.in" + captcha_url, forceUser=True)
+ self.html = self.load(self.pyfile.url, post={"id": self.fileid, "hash": captcha_hash, "code": captcha_code})
def getPackageInfo(self):
name = self.pyfile.package().name
@@ -141,11 +141,11 @@ class LinkSaveIn(Crypter): pattern = r'<a href="http://linksave\.in/(\w{43})"'
ids = re.findall(pattern, self.html)
self.logDebug("Decrypting %d Web links" % len(ids))
- for i, id in enumerate(ids):
+ for i, weblink_id in enumerate(ids):
try:
- webLink = "http://linksave.in/%s" % id
+ webLink = "http://linksave.in/%s" % weblink_id
self.logDebug("Decrypting Web link %d, %s" % (i+1, webLink))
- fwLink = "http://linksave.in/fw-%s" % id
+ fwLink = "http://linksave.in/fw-%s" % weblink_id
response = self.load(fwLink)
jscode = re.findall(r'<script type="text/javascript">(.*)</script>', response)[-1]
jseval = self.js.eval("document = { write: function(e) { return e; } }; %s" % jscode)
diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py index ff21916ef..69d2f8192 100644 --- a/module/plugins/crypter/LinkdecrypterCom.py +++ b/module/plugins/crypter/LinkdecrypterCom.py @@ -22,79 +22,79 @@ from module.plugins.Crypter import Crypter class LinkdecrypterCom(Crypter): __name__ = "LinkdecrypterCom" __type__ = "crypter" - __version__ = "0.26" + __version__ = "0.27" __description__ = """linkdecrypter.com""" __author_name__ = ("zoidberg", "flowlee") - + TEXTAREA_PATTERN = r'<textarea name="links" wrap="off" readonly="1" class="caja_des">(.+)</textarea>' PASSWORD_PATTERN = r'<input type="text" name="password"' CAPTCHA_PATTERN = r'<img class="captcha" src="(.+?)"(.*?)>' REDIR_PATTERN = r'<i>(Click <a href="./">here</a> if your browser does not redirect you).</i>' - + def decrypt(self, pyfile): self.passwords = self.getPassword().splitlines() - + # API not working anymore - new_links = self.decryptHTML() + new_links = self.decryptHTML() if new_links: self.core.files.addLinks(new_links, self.pyfile.package().id) else: - self.fail('Could not extract any links') + self.fail('Could not extract any links') def decryptAPI(self): - - get_dict = { "t": "link", "url": self.pyfile.url, "lcache": "1" } + + get_dict = { "t": "link", "url": self.pyfile.url, "lcache": "1" } self.html = self.load('http://linkdecrypter.com/api', get = get_dict) if self.html.startswith('http://'): return self.html.splitlines() - + if self.html == 'INTERRUPTION(PASSWORD)': for get_dict['pass'] in self.passwords: self.html = self.load('http://linkdecrypter.com/api', get= get_dict) - if self.html.startswith('http://'): return self.html.splitlines() - + if self.html.startswith('http://'): return self.html.splitlines() + self.logError('API', self.html) if self.html == 'INTERRUPTION(PASSWORD)': self.fail("No or incorrect password") - - return None - + + return None + def decryptHTML(self): retries = 5 - - post_dict = { "link_cache": "on", "pro_links": self.pyfile.url, "modo_links": "text" } - self.html = self.load('http://linkdecrypter.com/', post = post_dict, cookies = True) - - while self.passwords or retries: - found = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.DOTALL) + + post_dict = { "link_cache": "on", "pro_links": self.pyfile.url, "modo_links": "text" } + self.html = self.load('http://linkdecrypter.com/', post=post_dict, cookies=True, decode=True) + + while self.passwords or retries: + found = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.DOTALL) if found: return [ x for x in found.group(1).splitlines() if '[LINK-ERROR]' not in x ] - + found = re.search(self.CAPTCHA_PATTERN, self.html) if found: captcha_url = 'http://linkdecrypter.com/' + found.group(1) result_type = "positional" if "getPos" in found.group(2) else "textual" - + found = re.search(r"<p><i><b>([^<]+)</b></i></p>", self.html) msg = found.group(1) if found else "" self.logInfo("Captcha protected link", result_type, msg) - + captcha = self.decryptCaptcha(captcha_url, result_type = result_type) if result_type == "positional": captcha = "%d|%d" % captcha - self.html = self.load('http://linkdecrypter.com/', post={ "captcha": captcha }) + self.html = self.load('http://linkdecrypter.com/', post={ "captcha": captcha }, decode=True) retries -= 1 - + elif self.PASSWORD_PATTERN in self.html: if self.passwords: password = self.passwords.pop(0) self.logInfo("Password protected link, trying " + password) - self.html = self.load('http://linkdecrypter.com/', post= {'password': password}) + self.html = self.load('http://linkdecrypter.com/', post={'password': password}, decode=True) else: self.fail("No or incorrect password") - + else: - retries -= 1 - self.html = self.load('http://linkdecrypter.com/', cookies = True) - - return None
\ No newline at end of file + retries -= 1 + self.html = self.load('http://linkdecrypter.com/', cookies=True, decode=True) + + return None diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 379b10764..e2ee30731 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -9,12 +9,12 @@ class LixIn(Crypter): __name__ = "LixIn" __type__ = "container" __pattern__ = r"http://(www.)?lix.in/(?P<id>.*)" - __version__ = "0.21" + __version__ = "0.22" __description__ = """Lix.in Container Plugin""" __author_name__ = ("spoob") __author_mail__ = ("spoob@pyload.org") - CAPTCHA_PATTERN='<img src="(?P<image>captcha_img.php\?PHPSESSID=.*?)"' + CAPTCHA_PATTERN='<img src="(?P<image>captcha_img.php\?.*?)"' SUBMIT_PATTERN=r"value='continue.*?'" LINK_PATTERN=r'name="ifram" src="(?P<link>.*?)"' @@ -33,7 +33,7 @@ class LixIn(Crypter): matches = re.search(self.SUBMIT_PATTERN,self.html) if not matches: - self.fail("link doesn't seem valid") + self.fail("link doesn't seem valid") matches = re.search(self.CAPTCHA_PATTERN, self.html) if matches: @@ -42,20 +42,19 @@ class LixIn(Crypter): if matches: self.logDebug("trying captcha") captcharesult = self.decryptCaptcha("http://lix.in/"+matches.group("image")) - self.html = self.req.load(url, decode=True, post={"capt" : captcharesult, "submit":"submit","tiny":id}) - else: - self.logDebug("no captcha/captcha solved") - break - else: + self.html = self.req.load(url, decode=True, post={"capt" : captcharesult, "submit":"submit","tiny":id}) + else: + self.logDebug("no captcha/captcha solved") + break + else: self.html = self.req.load(url, decode=True, post={"submit" : "submit", - "tiny" : id}) - + "tiny" : id}) + matches = re.search(self.LINK_PATTERN, self.html) if not matches: - self.fail("can't find destination url") + self.fail("can't find destination url") new_link = matches.group("link") self.logDebug("Found link %s, adding to package" % new_link) self.packages.append((self.pyfile.package().name, [new_link], self.pyfile.package().name)) -
\ No newline at end of file diff --git a/module/plugins/crypter/MegauploadComFolder.py b/module/plugins/crypter/MegauploadComFolder.py deleted file mode 100644 index e18c10758..000000000 --- a/module/plugins/crypter/MegauploadComFolder.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.SimpleCrypter import SimpleCrypter -from re import search -from time import time - -class MegauploadComFolder(SimpleCrypter): - __name__ = "MegauploadComFolder" - __type__ = "crypter" - __pattern__ = r"http://(?:www\.)?megaupload.com/(?:\?f|xml/folderfiles.php\?folderid)=(\w+)" - __version__ = "0.01" - __description__ = """Depositfiles.com Folder Plugin""" - __author_name__ = ("zoidberg") - __author_mail__ = ("zoidberg@mujmail.cz") - - LINK_PATTERN = r'<ROW[^>]*?url="([^"]+)[^>]*?expired="0"></ROW>' - - def init (self): - folderid = search(self.__pattern__, self.pyfile.url).group(1) - uniq = time() * 1000 - self.url = "http://www.megaupload.com/xml/folderfiles.php?folderid=%s&uniq=%d" % (folderid, uniq) - diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py new file mode 100644 index 000000000..f5800b498 --- /dev/null +++ b/module/plugins/crypter/Movie2kTo.py @@ -0,0 +1,141 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.plugins.Crypter import Crypter +from collections import defaultdict + +class Movie2kTo(Crypter): + __name__ = 'Movie2kTo' + __type__ = 'container' + __pattern__ = r'http://(?:www\.)?movie2k\.to/(.*)\.html' + __version__ = '0.3' + __config__ = [('accepted_hosters', 'str', 'List of accepted hosters', 'Xvidstage, '), + ('whole_season', 'bool', 'Download whole season', 'False'), + ('everything', 'bool', 'Download everything', 'False'), + ('firstN', 'int', 'Download the first N files for each episode. The first file is probably all you will need.', '1')] + __description__ = """Movie2k.to Container Plugin""" + __author_name__ = ('4Christopher') + __author_mail__ = ('4Christopher@gmx.de') + BASE_URL_PATTERN = r'http://(?:www\.)?movie2k\.to/' + TVSHOW_URL_PATH_PATTERN = r'tvshows-(?P<id>\d+?)-(?P<name>.+)' + FILM_URL_PATH_PATTERN = r'(?P<name>.+?)-(?:online-film|watch-movie)-(?P<id>\d+)' + SEASON_PATTERN = r'<div id="episodediv(\d+?)" style="display:(inline|none)">(.*?)</div>' + EP_PATTERN = r'<option value="(.+?)"( selected)?>Episode\s*?(\d+?)</option>' + BASE_URL = 'http://www.movie2k.to' + + def decrypt(self, pyfile): + self.package = pyfile.package() + self.folder = self.package.folder + self.qStatReset() + whole_season = self.getConfig('whole_season') + everything = self.getConfig('everything') + self.getInfo(pyfile.url) + + if (whole_season or everything) and self.format == 'tvshow': + self.logDebug('Downloading the whole season') + for season, season_sel, html in re.findall(self.SEASON_PATTERN, self.html, re.DOTALL | re.I): + if (season_sel == 'inline') or everything: + season_links = [] + for url_path, ep_sel, ep in re.findall(self.EP_PATTERN, html, re.I): + season_name = self.name_tvshow(season, ep) + self.logDebug('%s: %s' % (season_name, url_path)) + if ep_sel and (season_sel == 'inline'): + self.logDebug('%s selected (in the start URL: %s)' % (season_name, pyfile.url)) + season_links += self.getInfoAndLinks('%s/%s' % (self.BASE_URL, url_path)) + elif (whole_season and (season_sel == 'inline')) or everything: + season_links += self.getInfoAndLinks('%s/%s' % (self.BASE_URL, url_path)) + + self.logDebug(season_links) + self.packages.append(('%s: Season %s (%s)' + % (self.name, season, self.qStat()), season_links, 'Season %s' % season)) + self.qStatReset() + else: + links = self.getLinks() + self.package.name = '%s%s' % (self.package.name, self.qStat()) + self.packages.append((self.package.name, links , self.package.folder)) + + def qStat(self): + if len(self.q) == 0: return '' + return (' (Average quality: %d, min: %d, max: %d, %s, max (all hosters): %d)' + % (sum(self.q) / float(len(self.q)), min(self.q), max(self.q), self.q, self.max_q)) + def qStatReset(self): + self.q = [] ## to calculate the average, min and max of the quality + self.max_q = None + def tvshow_number(self, number): + if int(number) < 10: + return '0%s' % number + else: + return number + + def name_tvshow(self, season, ep): + return '%s S%sE%s' % (self.name, self.tvshow_number(season), self.tvshow_number(ep)) + + def getInfo(self, url): + self.html = self.load(url) + self.url_path = re.match(self.__pattern__, url).group(1) + self.format = pattern_re = None + if re.match(r'tvshows', self.url_path): + self.format = 'tvshow' + pattern_re = re.search(self.TVSHOW_URL_PATH_PATTERN, self.url_path) + elif re.search(self.FILM_URL_PATH_PATTERN, self.url_path): + self.format = 'film' + pattern_re = re.search(self.FILM_URL_PATH_PATTERN, self.url_path) + + + self.name = pattern_re.group('name') + self.id = pattern_re.group('id') + self.logDebug('URL Path: %s (ID: %s, Name: %s, Format: %s)' + % (self.url_path, self.id, self.name, self.format)) + + def getInfoAndLinks(self, url): + self.getInfo(url) + return self.getLinks() + + ## This function returns the links for one episode as list + def getLinks(self): + accepted_hosters = re.findall(r'\b(\w+?)\b', self.getConfig('accepted_hosters')) + firstN = self.getConfig('firstN') + links = [] + re_quality = re.compile(r'.+?Quality:.+?smileys/(\d)\.gif') + ## The quality is one digit. 0 is the worst and 5 is the best. + ## Is not always there … + re_hoster_id_html = re.compile(r'(?:<td height|<tr id).+?<a href=".*?(\d{7}).*?".+? ([^<>]+?)</a>(.+?)</tr>') + re_hoster_id_js = re.compile(r'links\[(\d+?)\].+ (.+?)</a>(.+?)</tr>') + ## I assume that the ID is 7 digits longs + count = defaultdict(int) + matches = re_hoster_id_html.findall(self.html) + matches += re_hoster_id_js.findall(self.html) + # self.logDebug(matches) + ## h_id: hoster_id of a possible hoster + for h_id, hoster, q_html in matches: + match_q = re_quality.search(q_html) + if match_q: + quality = int(match_q.group(1)) + if self.max_q: + if self.max_q < quality: self.max_q = quality + else: ## was None before + self.max_q = quality + q_s = ', Quality: %d' % quality + else: + q_s = ', unknown quality' + if hoster in accepted_hosters: + self.logDebug('Accepted: %s, ID: %s%s' % (hoster, h_id, q_s)) + count[hoster] += 1 + if count[hoster] <= firstN: + if match_q: self.q.append(quality) + if h_id != self.id: + self.html = self.load('%s/tvshows-%s-%s.html' % (self.BASE_URL, h_id, self.name)) + else: + self.logDebug('This is already the right ID') + try: + url = re.search(r'<a target="_blank" href="(http://.*?)"', self.html).group(1) + self.logDebug('id: %s, %s: %s' % (h_id, hoster, url)) + links.append(url) + except: + self.logDebug('Failed to find the URL') + else: + self.logDebug('Not accepted: %s, ID: %s%s' % (hoster, h_id, q_s)) + + # self.logDebug(links) + return links diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index c8110ef6b..d71a73d0a 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -7,7 +7,7 @@ class NetfolderIn(Crypter): __name__ = "NetfolderIn" __type__ = "crypter" __pattern__ = r"http://(?:www\.)?netfolder.in/((?P<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>\w+))" - __version__ = "0.3" + __version__ = "0.4" __description__ = """NetFolder Crypter Plugin""" __author_name__ = ("RaNaN", "fragonib") __author_mail__ = ("RaNaN@pyload.org", "fragonib[AT]yahoo[DOT]es") @@ -47,7 +47,7 @@ class NetfolderIn(Crypter): m = re.match(self.__pattern__, self.pyfile.url) id = max(m.group('id1'), m.group('id2')) except AttributeError: - self.logDebug("Unable to get package id from url [%s]" % url) + self.logDebug("Unable to get package id from url [%s]" % self.pyfile.url) return url = "http://netfolder.in/folder.php?folder_id=" + id password = self.getPassword() diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index d00e4cc18..8f29a9158 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -5,136 +5,244 @@ from module.plugins.Crypter import Crypter import base64 import binascii import re -import urllib +import os + class RelinkUs(Crypter): __name__ = "RelinkUs" __type__ = "crypter" __pattern__ = r"http://(www\.)?relink.us/(f/|((view|go).php\?id=))(?P<id>.+)" - __version__ = "2.3" + __version__ = "3.0" __description__ = """Relink.us Crypter Plugin""" __author_name__ = ("fragonib") __author_mail__ = ("fragonib[AT]yahoo[DOT]es") # Constants - _JK_KEY_ = "jk" - _CRYPTED_KEY_ = "crypted" + PREFERRED_LINK_SOURCES = ['cnl2', 'dlc', 'web'] + + OFFLINE_TOKEN = "<title>Tattooside" + PASSWORD_TOKEN = "container_password.php" + PASSWORD_ERROR_ROKEN = "You have entered an incorrect password" + PASSWORD_SUBMIT_URL = "http://www.relink.us/container_password.php" + CAPTCHA_TOKEN = "container_captcha.php" + CAPTCHA_ERROR_ROKEN = "You have solved the captcha wrong" + CAPTCHA_IMG_URL = "http://www.relink.us/core/captcha/circlecaptcha.php" + CAPTCHA_SUBMIT_URL = "http://www.relink.us/container_captcha.php" + FILE_TITLE_REGEX = r"<th>Title</th><td><i>(.*)</i></td></tr>" + FILE_NOTITLE = 'No title' + + CNL2_FORM_REGEX = r'<form id="cnl_form-(.*?)</form>' + CNL2_FORMINPUT_REGEX = r'<input.*?name="%s".*?value="(.*?)"' + CNL2_JK_KEY = "jk" + CNL2_CRYPTED_KEY = "crypted" + DLC_LINK_REGEX = r'<a href=".*?" class="dlc_button" target="_blank">' + DLC_DOWNLOAD_URL = "http://www.relink.us/download.php" + WEB_FORWARD_REGEX = r"getFile\('(?P<link>.+)'\)"; + WEB_FORWARD_URL = "http://www.relink.us/frame.php" + WEB_LINK_REGEX = r'<iframe name="Container" height="100%" frameborder="no" width="100%" src="(?P<link>.+)"></iframe>' + def setup(self): + self.fileid = None + self.package = None + self.password = None self.html = None - + self.captcha = False + def decrypt(self, pyfile): + # Init - self.pyfile = pyfile - self.package = pyfile.package() + self.initPackage(pyfile) # Request package - self.html = self.requestPackageInfo() + self.requestPackage() + + # Check for online if not self.isOnline(): self.offline() - # Check for password protection + # Check for protection if self.isPasswordProtected(): - self.html = self.submitPassword() - if self.html is None: - self.fail("Incorrect password, please set right password on Edit package form and retry") + self.unlockPasswordProtection() + self.handleErrors() + + if self.isCaptchaProtected(): + self.captcha = True + self.unlockCaptchaProtection() + self.handleErrors() # Get package name and folder - (package_name, folder_name) = self.getPackageNameAndFolder() + (package_name, folder_name) = self.getPackageInfo() - # Get package links - try: - (crypted, jk) = self.getCipherParams() - package_links = self.getLinks(crypted, jk) - except: - self.fail("Unable to decrypt package") + # Extract package links + package_links = [] + for sources in self.PREFERRED_LINK_SOURCES: + package_links.extend(self.handleLinkSource(sources)) + if package_links: # use only first source which provides links + break + package_links = set(package_links) # Pack - self.packages = [(package_name, package_links, folder_name)] + if package_links: + self.packages = [(package_name, package_links, folder_name)] + else: + self.fail('Could not extract any links') + + def initPackage(self, pyfile): + self.fileid = re.match(self.__pattern__, pyfile.url).group('id') + self.package = pyfile.package() + self.password = self.getPassword() + self.url = pyfile.url + + def requestPackage(self): + self.html = self.load(self.url, decode = True) def isOnline(self): - if "sorry.png" in self.html: + if self.OFFLINE_TOKEN in self.html: self.logDebug("File not found") return False return True def isPasswordProtected(self): - if "<h1>Container Protection</h1>" in self.html: + if self.PASSWORD_TOKEN in self.html: self.logDebug("Links are password protected") return True - return False - - def requestPackageInfo(self): - return self.load(self.pyfile.url) - - def submitPassword(self): - # Gather data - url = self.pyfile.url - m = re.match(self.__pattern__, url) - if m is None: - self.logDebug("Unable to get package id from url [%s]" % url) - return - id = m.group('id') - password = self.getPassword() - - # Submit package password - url = "http://www.relink.us/container_password.php?id=" + id - post = { '#' : '', 'password' : password, 'pw' : 'submit' } - self.logDebug("Submitting password [%s] for protected links with id [%s]" % (password, id)) - html = self.load(url, {}, post) - # Check for invalid password - if "An error occurred!" in html: - self.logDebug("Incorrect password, please set right password on Add package form and retry") - return None - else: - return html - - def getPackageNameAndFolder(self): - # Get title from html - try: - title_re = r'<td class="top">Title</td><td class="top">\|</td><td><span class="info_view_id"><i>(?P<title>.+)</i></span></td>' - title = re.search(title_re, self.html).group('title') - if 'Title deactived by the owner' in title: - title = None - except: - title = None + def isCaptchaProtected(self): + if self.CAPTCHA_TOKEN in self.html: + self.logDebug("Links are captcha protected") + return True + return False - # Set name & folder - if title is None: + def unlockPasswordProtection(self): + self.logDebug("Submitting password [%s] for protected links" % self.password) + passwd_url = self.PASSWORD_SUBMIT_URL + "?id=%s" % self.fileid + passwd_data = { 'id': self.fileid, 'password': self.password, 'pw': 'submit' } + self.html = self.load(passwd_url, post=passwd_data, decode=True) + + def unlockCaptchaProtection(self): + self.logDebug("Request user positional captcha resolving") + captcha_img_url = self.CAPTCHA_IMG_URL + "?id=%s" % self.fileid + coords = self.decryptCaptcha(captcha_img_url, forceUser=True, imgtype="png", result_type='positional') + self.logDebug("Captcha resolved, coords [%s]" % str(coords)) + captcha_post_url = self.CAPTCHA_SUBMIT_URL + "?id=%s" % self.fileid + captcha_post_data = { 'button.x': coords[0], 'button.y': coords[1], 'captcha': 'submit' } + self.html = self.load(captcha_post_url, post=captcha_post_data, decode=True) + + def getPackageInfo(self): + name = folder = None + + # Try to get info from web + m = re.search(self.FILE_TITLE_REGEX, self.html) + if m is not None: + title = m.group(1).strip() + if not self.FILE_NOTITLE in title: + name = folder = title + self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) + + # Fallback to defaults + if not name or not folder: name = self.package.name folder = self.package.folder self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) - else: - name = folder = title - self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) - return name, folder - - def getCipherParams(self): + # Return package info + return name, folder + + def handleErrors(self): + if self.PASSWORD_ERROR_ROKEN in self.html: + msg = "Incorrect password, please set right password on 'Edit package' form and retry" + self.logDebug(msg) + self.fail(msg) - # Get vars dict - vars = {} - m = re.search(r'flashVars="(?P<vars>.*)"', self.html) - text = m.group('vars') - pairs = text.split('&') - for pair in pairs: - index = pair.index('=') - vars[pair[:index]] = pair[index + 1:] + if self.captcha: + if self.CAPTCHA_ERROR_ROKEN in self.html: + self.logDebug("Invalid captcha, retrying") + self.invalidCaptcha() + self.retry() + else: + self.correctCaptcha() + + def handleLinkSource(self, source): + if source == 'cnl2': + return self.handleCNL2Links() + elif source == 'dlc': + return self.handleDLCLinks() + elif source == 'web': + return self.handleWEBLinks() + else: + self.fail('Unknown source [%s] (this is probably a bug)' % source) + + def handleCNL2Links(self): + self.logDebug("Search for CNL2 links") + package_links = [] + m = re.search(self.CNL2_FORM_REGEX, self.html, re.DOTALL) + if m is not None: + cnl2_form = m.group(1) + try: + (vcrypted, vjk) = self._getCipherParams(cnl2_form) + for (crypted, jk) in zip(vcrypted, vjk): + package_links.extend(self._getLinks(crypted, jk)) + except: + self.logDebug("Unable to decrypt CNL2 links") + return package_links + + def handleDLCLinks(self): + self.logDebug('Search for DLC links') + package_links = [] + m = re.search(self.DLC_LINK_REGEX, self.html) + if m is not None: + container_url = self.DLC_DOWNLOAD_URL + "?id=%s&dlc=1" % self.fileid + self.logDebug("Downloading DLC container link [%s]" % container_url) + try: + dlc = self.load(container_url) + dlc_filename = self.fileid + ".dlc" + dlc_filepath = os.path.join(self.config["general"]["download_folder"], dlc_filename) + f = open(dlc_filepath, "wb") + f.write(dlc) + f.close() + package_links.append(dlc_filepath) + except: + self.logDebug("Unable to download DLC container") + return package_links - # Extract cipher pair - jk = urllib.unquote(vars[RelinkUs._JK_KEY_].replace("+", " ")) - crypted = vars[RelinkUs._CRYPTED_KEY_] + def handleWEBLinks(self): + self.logDebug("Search for WEB links") + package_links = [] + fw_params = re.findall(self.WEB_FORWARD_REGEX, self.html) + self.logDebug("Decrypting %d Web links" % len(fw_params)) + for index, fw_param in enumerate(fw_params): + try: + fw_url = self.WEB_FORWARD_URL + "?%s" % fw_param + self.logDebug("Decrypting Web link %d, %s" % (index+1, fw_url)) + fw_response = self.load(fw_url, decode=True) + dl_link = re.search(self.WEB_LINK_REGEX, fw_response).group('link') + package_links.append(dl_link) + except Exception, detail: + self.logDebug("Error decrypting Web link %s, %s" % (index, detail)) + self.setWait(4) + self.wait() + return package_links + + def _getCipherParams(self, cnl2_form): + + # Get jk + jk_re = self.CNL2_FORMINPUT_REGEX % self.CNL2_JK_KEY + vjk = re.findall(jk_re, cnl2_form, re.IGNORECASE) + + # Get crypted + crypted_re = self.CNL2_FORMINPUT_REGEX % RelinkUs.CNL2_CRYPTED_KEY + vcrypted = re.findall(crypted_re, cnl2_form, re.IGNORECASE) # Log and return - self.logDebug("Javascript cipher key function [%s]" % jk) - return crypted, jk + self.logDebug("Detected %d crypted blocks" % len(vcrypted)) + return vcrypted, vjk - def getLinks(self, crypted, jk): + def _getLinks(self, crypted, jk): # Get key jreturn = self.js.eval("%s f()" % jk) - self.logDebug("JsEngine returns value key=[%s]" % jreturn) + self.logDebug("JsEngine returns value [%s]" % jreturn) key = binascii.unhexlify(jreturn) # Decode crypted diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 0df26110e..1ffa5d41a 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -12,7 +12,7 @@ class ShareLinksBiz(Crypter): __name__ = "ShareLinksBiz"
__type__ = "crypter"
__pattern__ = r"(?P<base>http://[\w\.]*?(share-links|s2l)\.biz)/(?P<id>_?[0-9a-z]+)(/.*)?"
- __version__ = "1.1"
+ __version__ = "1.12"
__description__ = """Share-Links.biz Crypter"""
__author_name__ = ("fragonib")
__author_mail__ = ("fragonib[AT]yahoo[DOT]es")
@@ -32,7 +32,7 @@ class ShareLinksBiz(Crypter): # Request package
url = self.baseUrl + '/' + self.fileId
- self.html = self.load(url)
+ self.html = self.load(url, decode=True)
# Unblock server (load all images)
self.unblockServer()
@@ -96,7 +96,7 @@ class ShareLinksBiz(Crypter): self.logDebug("Submitting password [%s] for protected links" % password)
post = {"password": password, 'login': 'Submit form'}
url = self.baseUrl + '/' + self.fileId
- self.html = self.load(url, post=post)
+ self.html = self.load(url, post=post, decode=True)
def unlockCaptchaProtection(self):
# Get captcha map
@@ -119,7 +119,7 @@ class ShareLinksBiz(Crypter): self.wait()
self.retry()
url = self.baseUrl + href
- self.html = self.load(url)
+ self.html = self.load(url, decode=True)
def _getCaptchaMap(self):
map = {}
@@ -152,16 +152,24 @@ class ShareLinksBiz(Crypter): self.correctCaptcha()
def getPackageInfo(self):
+ name = folder = None
+
+ # Extract from web package header
title_re = r'<h2><img.*?/>(.*)</h2>'
m = re.search(title_re, self.html, re.DOTALL)
if m is not None:
title = m.group(1).strip()
- name = folder = title
- self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder))
- else:
+ if 'unnamed' not in title:
+ name = folder = title
+ self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder))
+
+ # Fallback to defaults
+ if not name or not folder:
name = self.package.name
folder = self.package.folder
self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder))
+
+ # Return package info
return name, folder
def handleWebLinks(self):
diff --git a/module/plugins/crypter/SpeedLoadOrgFolder.py b/module/plugins/crypter/SpeedLoadOrgFolder.py new file mode 100644 index 000000000..5b350787f --- /dev/null +++ b/module/plugins/crypter/SpeedLoadOrgFolder.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.SimpleCrypter import SimpleCrypter + +class SpeedLoadOrgFolder(SimpleCrypter): + __name__ = "SpeedLoadOrgFolder" + __type__ = "crypter" + __pattern__ = r"http://(www\.)?speedload\.org/(\d+~f$|folder/\d+/)" + __version__ = "0.2" + __description__ = """Speedload Crypter Plugin""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + LINK_PATTERN = r'<div class="link"><a href="(http://speedload.org/\w+)"' + TITLE_PATTERN = r'<title>Files of: (?P<title>[^<]+) folder</title>' diff --git a/module/plugins/crypter/TrailerzoneInfo.py b/module/plugins/crypter/TrailerzoneInfo.py index 2683c2429..43a4fcce5 100644 --- a/module/plugins/crypter/TrailerzoneInfo.py +++ b/module/plugins/crypter/TrailerzoneInfo.py @@ -22,10 +22,10 @@ class TrailerzoneInfo(Crypter): self.handleProtect(url) elif goPattern.match(url): self.handleGo(url) - + def handleProtect(self, url): self.handleGo("http://trailerzone.info/go.html#:::" + url.split("#:::",1)[1]) - + def handleGo(self, url): src = self.req.load(str(url)) diff --git a/module/plugins/crypter/UploadedToFolder.py b/module/plugins/crypter/UploadedToFolder.py new file mode 100644 index 000000000..d4534297e --- /dev/null +++ b/module/plugins/crypter/UploadedToFolder.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*-
+
+from module.plugins.Crypter import Crypter
+import re
+
+class UploadedToFolder(Crypter):
+ __name__ = "UploadedToFolder"
+ __type__ = "crypter"
+ __pattern__ = r"http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|list)/(?P<id>\w+)"
+ __version__ = "0.1"
+ __description__ = """UploadedTo Crypter Plugin"""
+ __author_name__ = ("stickell")
+ __author_mail__ = ("l.stickell@yahoo.it")
+
+ PLAIN_PATTERN = r'<small class="date"><a href="(?P<plain>[\w/]+)" onclick='
+ TITLE_PATTERN = r'<title>(?P<title>[^<]+)</title>'
+
+ def decrypt(self, pyfile):
+ self.html = self.load(pyfile.url)
+
+ package_name, folder_name = self.getPackageNameAndFolder()
+
+ m = re.search(self.PLAIN_PATTERN, self.html)
+ if m:
+ plain_link = 'http://uploaded.net/' + m.group('plain')
+ else:
+ self.fail('Parse error - Unable to find plain url list')
+
+ self.html = self.load(plain_link)
+ package_links = self.html.split('\n')[:-1]
+ self.logDebug('Package has %d links' % len(package_links))
+
+ self.packages = [(package_name, package_links, folder_name)]
+
+ def getPackageNameAndFolder(self):
+ m = re.search(self.TITLE_PATTERN, self.html)
+ if m:
+ name = folder = m.group('title')
+ self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder))
+ return name, folder
+ else:
+ name = self.pyfile.package().name
+ folder = self.pyfile.package().folder
+ self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder))
+ return name, folder
diff --git a/module/plugins/crypter/YoutubeBatch.py b/module/plugins/crypter/YoutubeBatch.py index b48026654..2e68dfe02 100644 --- a/module/plugins/crypter/YoutubeBatch.py +++ b/module/plugins/crypter/YoutubeBatch.py @@ -8,26 +8,19 @@ from module.plugins.Crypter import Crypter class YoutubeBatch(Crypter): __name__ = "YoutubeBatch" __type__ = "container" - __pattern__ = r"http://(?:www\.)?(?:de\.)?\youtube\.com/(?:user/.*?/user/(?P<g1>.{16})|(?:.*?feature=PlayList\&|view_play_list\?)p=(?P<g2>.{16}))" - __version__ = "0.9" + __pattern__ = r"http://(?:[^/]*?)youtube\.com/((?:view_play_list|playlist|.*?feature=PlayList).*?[\?&](?:list|p)=|user/)(\w+)" + __version__ = "0.92" __description__ = """Youtube.com Channel Download Plugin""" - __author_name__ = ("RaNaN", "Spoob") - __author_mail__ = ("RaNaN@pyload.org", "spoob@pyload.org") - - def setup(self): - compile_id = re.compile(self.__pattern__) - match_id = compile_id.match(self.pyfile.url) - self.playlist = match_id.group(match_id.lastgroup) - - def file_exists(self): - if "User not found" in self.req.load("http://gdata.youtube.com/feeds/api/playlists/%s?v=2" % self.playlist): - return False - return True + __author_name__ = ("RaNaN", "Spoob", "zoidberg") + __author_mail__ = ("RaNaN@pyload.org", "spoob@pyload.org", "zoidberg@mujmail.cz") def decrypt(self, pyfile): - if not self.file_exists(): - self.offline() - url = "http://gdata.youtube.com/feeds/api/playlists/%s?v=2" % self.playlist + match_id = re.match(self.__pattern__, self.pyfile.url) + if match_id.group(1) == "user/": + url = "http://gdata.youtube.com/feeds/api/users/%s/uploads?v=2" % match_id.group(2) + else: + url = "http://gdata.youtube.com/feeds/api/playlists/%s?v=2" % match_id.group(2) + rep = self.load(url) new_links = [] new_links.extend(re.findall(r"href\='(http:\/\/www.youtube.com\/watch\?v\=[^']+)&", rep)) |