From c3438b39d7497178300f4518692ef212abd5c614 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 13 Oct 2013 19:38:44 +0200 Subject: Mark dead crypters as DeadCrypter --- module/plugins/crypter/ILoadTo.py | 61 +---- module/plugins/crypter/LofCc.py | 44 +-- module/plugins/crypter/MBLinkInfo.py | 20 +- module/plugins/crypter/Movie2kTo.py | 163 +----------- module/plugins/crypter/OronComFolder.py | 27 +- module/plugins/crypter/RSLayerCom.py | 43 +-- module/plugins/crypter/SecuredIn.py | 426 +----------------------------- module/plugins/crypter/TrailerzoneInfo.py | 39 +-- module/plugins/crypter/WiiReloadedOrg.py | 46 +--- 9 files changed, 35 insertions(+), 834 deletions(-) (limited to 'module/plugins/crypter') diff --git a/module/plugins/crypter/ILoadTo.py b/module/plugins/crypter/ILoadTo.py index 61869fdc0..d155f4bb6 100644 --- a/module/plugins/crypter/ILoadTo.py +++ b/module/plugins/crypter/ILoadTo.py @@ -1,64 +1,13 @@ -import re -import urllib +# -*- coding: utf-8 -*- -from module.plugins.Crypter import Crypter -from module.lib.BeautifulSoup import BeautifulSoup +from module.plugins.internal.DeadCrypter import DeadCrypter -class ILoadTo(Crypter): +class ILoadTo(DeadCrypter): __name__ = "ILoadTo" __type__ = "crypter" __pattern__ = r"http://iload\.to/go/\d+-[\w\.-]+/" - __config__ = [] - __version__ = "0.1" + __version__ = "0.11" __description__ = """iload.to Crypter Plugin""" __author_name__ = ("hzpz") - __author_mail__ = ("none") - - - def decrypt(self, pyfile): - url = pyfile.url - src = self.req.load(str(url)) - soup = BeautifulSoup(src) - - # find captcha URL and decrypt - captchaTag = soup.find("img", attrs={"id": "Captcha"}) - if not captchaTag: - self.fail("Cannot find Captcha") - - captchaUrl = "http://iload.to" + captchaTag["src"] - self.logDebug("Captcha URL: %s" % captchaUrl) - result = self.decryptCaptcha(str(captchaUrl)) - - # find captcha form URL - formTag = soup.find("form", attrs={"id": "CaptchaForm"}) - formUrl = "http://iload.to" + formTag["action"] - self.logDebug("Form URL: %s" % formUrl) - - # submit decrypted captcha - self.req.lastURL = url - src = self.req.load(str(formUrl), post={'captcha': result}) - - # find decrypted links - links = re.findall( - r"", - src) - - if not len(links) > 0: - self.retry() - - self.correctCaptcha() - - cleanedLinks = [] - for link in links: - if link.startswith("http://dontknow.me/at/?"): - cleanedLink = urllib.unquote(link[23:]) - else: - cleanedLink = link - self.logDebug("Link: %s" % cleanedLink) - cleanedLinks.append(cleanedLink) - - self.logDebug("Decrypted %d links" % len(links)) - - self.pyfile.package().password = "iload.to" - self.packages.append((self.pyfile.package().name, cleanedLinks, self.pyfile.package().folder)) + __author_mail__ = ("") diff --git a/module/plugins/crypter/LofCc.py b/module/plugins/crypter/LofCc.py index 5fee776c7..458609881 100644 --- a/module/plugins/crypter/LofCc.py +++ b/module/plugins/crypter/LofCc.py @@ -1,51 +1,13 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- -import re -from os.path import join +from module.plugins.internal.DeadCrypter import DeadCrypter -from module.plugins.Crypter import Crypter -from module.plugins.internal.CaptchaService import ReCaptcha - -class LofCc(Crypter): +class LofCc(DeadCrypter): __name__ = "LofCc" __type__ = "container" __pattern__ = r"http://lof.cc/(.*)" - __version__ = "0.2" + __version__ = "0.21" __description__ = """lof.cc Plugin""" __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") - - def setup(self): - self.multiDL = False - - def decrypt(self, pyfile): - html = self.req.load(self.pyfile.url, cookies=True) - - m = re.search(r"src=\"http://www.google.com/recaptcha/api/challenge\?k=(.*?)\">", html) - if not m: - self.offline() - - recaptcha = ReCaptcha(self) - challenge, code = recaptcha.challenge(m.group(1)) - - resultHTML = self.req.load(self.pyfile.url, - post={"recaptcha_challenge_field": challenge, "recaptcha_response_field": code}, - cookies=True) - - if re.search("class=\"error\"", resultHTML): - self.retry() - - self.correctCaptcha() - - dlc = self.req.load(self.pyfile.url + "/dlc", cookies=True) - - name = re.search(self.__pattern__, self.pyfile.url).group(1) + ".dlc" - - dlcFile = join(self.config["general"]["download_folder"], name) - f = open(dlcFile, "wb") - f.write(dlc) - f.close() - - self.packages.append((self.pyfile.package().name, [dlcFile], self.pyfile.package().folder)) diff --git a/module/plugins/crypter/MBLinkInfo.py b/module/plugins/crypter/MBLinkInfo.py index e266c7722..434819d07 100644 --- a/module/plugins/crypter/MBLinkInfo.py +++ b/module/plugins/crypter/MBLinkInfo.py @@ -1,27 +1,13 @@ # -*- coding: utf-8 -*- -import re +from module.plugins.internal.DeadCrypter import DeadCrypter -from module.plugins.Crypter import Crypter - -class MBLinkInfo(Crypter): +class MBLinkInfo(DeadCrypter): __name__ = "MBLinkInfo" __type__ = "container" __pattern__ = r"http://(?:www\.)?mblink\.info/?\?id=(\d+)" - __version__ = "0.02" + __version__ = "0.03" __description__ = """MBLink.Info Container Plugin""" __author_name__ = ("Gummibaer", "stickell") __author_mail__ = ("Gummibaer@wiki-bierkiste.de", "l.stickell@yahoo.it") - - URL_PATTERN = r'' - - def decrypt(self, pyfile): - src = self.load(pyfile.url) - found = re.search(self.URL_PATTERN, src) - if found: - link = found.group(1) - self.logDebug("Redirected to " + link) - self.core.files.addLinks([link], self.pyfile.package().id) - else: - self.fail('Unable to detect valid link') diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py index 92ec7211a..c9c3f8f2d 100644 --- a/module/plugins/crypter/Movie2kTo.py +++ b/module/plugins/crypter/Movie2kTo.py @@ -1,160 +1,13 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- -import re -from collections import defaultdict +from module.plugins.internal.DeadCrypter import DeadCrypter -from module.plugins.Crypter import Crypter - -class Movie2kTo(Crypter): - __name__ = 'Movie2kTo' - __type__ = 'container' - __pattern__ = r'http://(?:www\.)?movie2k\.to/(.*)\.html' - __version__ = '0.5' - __config__ = [('accepted_hosters', 'str', 'List of accepted hosters', 'Xvidstage, Putlocker, '), - ('dir_quality', 'bool', 'Show the quality of the footage in the folder name', 'True'), - ('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')] +class Movie2kTo(DeadCrypter): + __name__ = "Movie2kTo" + __type__ = "container" + __pattern__ = r"http://(?:www\.)?movie2k\.to/(.*)\.html" + __version__ = "0.51" __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\d+?)-(?P.+)' - FILM_URL_PATH_PATTERN = r'(?P.+?)-(?:online-film|watch-movie)-(?P\d+)' - SEASON_PATTERN = r'
(.*?)
' - EP_PATTERN = r'' - 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) - folder = '%s: Season %s' % (self.name, season) - name = '%s%s' % (folder, self.qStat()) - self.packages.append((name, season_links, folder)) - self.qStatReset() - else: - links = self.getLinks() - name = '%s%s' % (self.package.name, self.qStat()) - self.packages.append((name, links, self.package.folder)) - - def qStat(self): - if len(self.q) == 0: - return '' - if not self.getConfig('dir_quality'): - return '' - if len(self.q) == 1: - return ' (Quality: %d, max (all hosters): %d)' % (self.q[0], self.max_q) - 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 # maximum quality of all hosters - - 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_js = re.compile(r'links\[(\d+?)\].+ (.+?)
(.+?)') - re_hoster_id_html = re.compile( - r'(?:]+?)(.+?)') - ## 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 == None: - self.max_q = quality - else: - if self.max_q < quality: - 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') - # The iframe tag must continue with a width. There where - # two iframes in the site and I try to make sure that it - # matches the right one. This is not (yet) nessesary - # because the right iframe happens to be the first iframe. - for pattern in (r'(.*)\n ' - LINK_PATTERN = r'' - - 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') \ No newline at end of file diff --git a/module/plugins/crypter/RSLayerCom.py b/module/plugins/crypter/RSLayerCom.py index 6a1f86657..0dc7ddf4e 100644 --- a/module/plugins/crypter/RSLayerCom.py +++ b/module/plugins/crypter/RSLayerCom.py @@ -1,50 +1,13 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- -import re +from module.plugins.internal.DeadCrypter import DeadCrypter -from module.plugins.Crypter import Crypter -from module.lib.BeautifulSoup import BeautifulSoup -from module.unescape import unescape - -class RSLayerCom(Crypter): +class RSLayerCom(DeadCrypter): __name__ = "RSLayerCom" __type__ = "container" __pattern__ = r"http://(www\.)?rs-layer.com/directory-" - __config__ = [] - __version__ = "0.2" + __version__ = "0.21" __description__ = """RS-Layer.com Container Plugin""" __author_name__ = ("hzpz") __author_mail__ = ("none") - - def decrypt(self, pyfile): - url = pyfile.url - src = self.req.load(str(url)) - - soup = BeautifulSoup(src) - captchaTag = soup.find("img", attrs={"id": "captcha_image"}) - if captchaTag: - captchaUrl = "http://rs-layer.com/" + captchaTag["src"] - self.logDebug("Captcha URL: %s" % captchaUrl) - result = self.decryptCaptcha(str(captchaUrl), imgtype="png") - captchaInput = soup.find("input", attrs={"id": "captcha"}) - self.req.lastUrl = url - src = self.req.load(str(url), post={'captcha_input': result, 'image_name': captchaTag["src"]}) - - link_ids = re.findall(r"onclick=\"getFile\(\'([0-9]{7}-.{8})\'\);changeBackgroundColor", src) - - if not len(link_ids) > 0: - self.retry() - - self.correctCaptcha() - - links = [] - for id in link_ids: - self.logDebug("ID: %s" % id) - new_link = unescape(re.search(r"