diff options
Diffstat (limited to 'module/plugins/crypter')
73 files changed, 665 insertions, 832 deletions
diff --git a/module/plugins/crypter/BitshareComFolder.py b/module/plugins/crypter/BitshareComFolder.py index 7139c26a6..219dabce8 100644 --- a/module/plugins/crypter/BitshareComFolder.py +++ b/module/plugins/crypter/BitshareComFolder.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from module.plugins.internal.SimpleCrypter import SimpleCrypter @@ -20,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class BitshareComFolder(SimpleCrypter): __name__ = "BitshareComFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?bitshare\.com/\?d=\w+' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?bitshare\.com/\?d=\w+' + __description__ = """Bitshare.com folder decrypter plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" diff --git a/module/plugins/crypter/C1neonCom.py b/module/plugins/crypter/C1neonCom.py index 8923cfc32..829ed63d6 100644 --- a/module/plugins/crypter/C1neonCom.py +++ b/module/plugins/crypter/C1neonCom.py @@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class C1neonCom(DeadCrypter): __name__ = "C1neonCom" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?c1neon.com/.*?' __version__ = "0.05" + + __pattern__ = r'http://(?:www\.)?c1neon.com/.*?' + __description__ = """C1neon.com decrypter plugin""" __author_name__ = "godofdream" __author_mail__ = "soilfiction@gmail.com" diff --git a/module/plugins/crypter/ChipDe.py b/module/plugins/crypter/ChipDe.py index 529ec6918..a75cc5e0e 100644 --- a/module/plugins/crypter/ChipDe.py +++ b/module/plugins/crypter/ChipDe.py @@ -7,18 +7,21 @@ from module.plugins.Crypter import Crypter class ChipDe(Crypter): __name__ = "ChipDe" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?chip.de/video/.*\.html' __version__ = "0.1" + + __pattern__ = r'http://(?:www\.)?chip.de/video/.*\.html' + __description__ = """Chip.de decrypter plugin""" __author_name__ = "4Christopher" __author_mail__ = "4Christopher@gmx.de" + def decrypt(self, pyfile): self.html = self.load(pyfile.url) try: - url = re.search(r'"(http://video.chip.de/\d+?/.*)"', self.html).group(1) - self.logDebug('The file URL is %s' % url) + f = re.search(r'"(http://video.chip.de/\d+?/.*)"', self.html) except: self.fail('Failed to find the URL') - - self.packages.append((pyfile.package().name, [url], pyfile.package().folder)) + else: + self.urls = [f.group(1)] + self.logDebug('The file URL is %s' % self.urls[0]) diff --git a/module/plugins/crypter/CrockoComFolder.py b/module/plugins/crypter/CrockoComFolder.py index e64e63534..56abeac29 100644 --- a/module/plugins/crypter/CrockoComFolder.py +++ b/module/plugins/crypter/CrockoComFolder.py @@ -6,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class CrockoComFolder(SimpleCrypter): __name__ = "CrockoComFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?crocko.com/f/.*' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?crocko.com/f/.*' + __description__ = """Crocko.com folder decrypter plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/module/plugins/crypter/CryptItCom.py b/module/plugins/crypter/CryptItCom.py index 6f8fbaa1a..66c5e7ca7 100644 --- a/module/plugins/crypter/CryptItCom.py +++ b/module/plugins/crypter/CryptItCom.py @@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class CryptItCom(DeadCrypter): __name__ = "CryptItCom" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?crypt-it\.com/(s|e|d|c)/[\w]+' __version__ = "0.11" + + __pattern__ = r'http://(?:www\.)?crypt-it\.com/(s|e|d|c)/[\w]+' + __description__ = """Crypt-it.com decrypter plugin""" __author_name__ = "jeix" __author_mail__ = "jeix@hasnomail.de" diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index d1ba8335c..64affc867 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -7,25 +7,25 @@ from module.plugins.Crypter import Crypter class CzshareComFolder(Crypter): __name__ = "CzshareComFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' __version__ = "0.2" + + __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' + __description__ = """Czshare.com folder decrypter plugin, now Sdilej.cz""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" FOLDER_PATTERN = r'<tr class="subdirectory">\s*<td>\s*<table>(.*?)</table>' LINK_PATTERN = r'<td class="col2"><a href="([^"]+)">info</a></td>' - #NEXT_PAGE_PATTERN = r'<a class="next " href="/([^"]+)"> </a>' + def decrypt(self, pyfile): html = self.load(pyfile.url) - new_links = [] - found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: self.fail("Parse error (FOLDER)") - new_links.extend(re.findall(self.LINK_PATTERN, found.group(1))) + m = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + if m is None: + self.fail("Parse error (FOLDER)") - if new_links: - self.core.files.addLinks(new_links, pyfile.package().id) - else: + self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1))) + if not self.urls: self.fail('Could not extract any links') diff --git a/module/plugins/crypter/DDLMusicOrg.py b/module/plugins/crypter/DDLMusicOrg.py index 27cff3f9d..f5e7203d3 100644 --- a/module/plugins/crypter/DDLMusicOrg.py +++ b/module/plugins/crypter/DDLMusicOrg.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import re + from time import sleep from module.plugins.Crypter import Crypter @@ -9,12 +10,15 @@ from module.plugins.Crypter import Crypter class DDLMusicOrg(Crypter): __name__ = "DDLMusicOrg" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?ddl-music\.org/captcha/ddlm_cr\d\.php\?\d+\?\d+' __version__ = "0.3" + + __pattern__ = r'http://(?:www\.)?ddl-music\.org/captcha/ddlm_cr\d\.php\?\d+\?\d+' + __description__ = """Ddl-music.org decrypter plugin""" __author_name__ = "mkaay" __author_mail__ = "mkaay@mkaay.de" + def setup(self): self.multiDL = False @@ -39,6 +43,6 @@ class DDLMusicOrg(Crypter): "linknr": linknr}) m = re.search(r"<form id=\"ff\" action=\"(.*?)\" method=\"post\">", htmlwithlink) if m: - self.packages.append((pyfile.package().name, [m.group(1)], pyfile.package().folder)) + self.urls = [m.group(1)] else: self.retry() diff --git a/module/plugins/crypter/DailymotionBatch.py b/module/plugins/crypter/DailymotionBatch.py index 5c0dd9cec..e43d4e1fd 100644 --- a/module/plugins/crypter/DailymotionBatch.py +++ b/module/plugins/crypter/DailymotionBatch.py @@ -1,24 +1,8 @@ # -*- 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/>. - - @author: Walter Purcaro -""" +import re from urlparse import urljoin -import re from module.common.json_layer import json_loads from module.plugins.Crypter import Crypter @@ -28,12 +12,15 @@ from module.utils import save_join class DailymotionBatch(Crypter): __name__ = "DailymotionBatch" __type__ = "crypter" - __pattern__ = r'https?://(?:www\.)?dailymotion\.com/((playlists/)?(?P<TYPE>playlist|user)/)?(?P<ID>[\w^_]+)(?(TYPE)|#)' __version__ = "0.01" + + __pattern__ = r'https?://(?:www\.)?dailymotion\.com/((playlists/)?(?P<TYPE>playlist|user)/)?(?P<ID>[\w^_]+)(?(TYPE)|#)' + __description__ = """Dailymotion.com channel & playlist decrypter""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" + def api_response(self, ref, req=None): url = urljoin("https://api.dailymotion.com/", ref) page = self.load(url, get=req) @@ -47,8 +34,8 @@ class DailymotionBatch(Crypter): if "error" in playlist: return - name = playlist["name"] - owner = playlist["owner.screenname"] + name = playlist['name'] + owner = playlist['owner.screenname'] return name, owner def _getPlaylists(self, user_id, page=1): @@ -59,10 +46,10 @@ class DailymotionBatch(Crypter): if "error" in user: return - for playlist in user["list"]: - yield playlist["id"] + for playlist in user['list']: + yield playlist['id'] - if user["has_more"]: + if user['has_more']: for item in self._getPlaylists(user_id, page + 1): yield item @@ -77,10 +64,10 @@ class DailymotionBatch(Crypter): if "error" in playlist: return - for video in playlist["list"]: - yield video["url"] + for video in playlist['list']: + yield video['url'] - if playlist["has_more"]: + if playlist['has_more']: for item in self._getVideos(id, page + 1): yield item diff --git a/module/plugins/crypter/DataHuFolder.py b/module/plugins/crypter/DataHuFolder.py index 04ef152fc..4f6116100 100644 --- a/module/plugins/crypter/DataHuFolder.py +++ b/module/plugins/crypter/DataHuFolder.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ import re @@ -22,8 +8,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class DataHuFolder(SimpleCrypter): __name__ = "DataHuFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?data.hu/dir/\w+' __version__ = "0.03" + + __pattern__ = r'http://(?:www\.)?data.hu/dir/\w+' + __description__ = """Data.hu folder decrypter plugin""" __author_name__ = ("crash", "stickell") __author_mail__ = "l.stickell@yahoo.it" @@ -31,6 +19,7 @@ class DataHuFolder(SimpleCrypter): LINK_PATTERN = r"<a href='(http://data\.hu/get/.+)' target='_blank'>\1</a>" TITLE_PATTERN = ur'<title>(?P<title>.+) Let\xf6lt\xe9se</title>' + def decrypt(self, pyfile): self.html = self.load(pyfile.url, decode=True) diff --git a/module/plugins/crypter/DdlstorageComFolder.py b/module/plugins/crypter/DdlstorageComFolder.py index 6501de822..3b1dc6dd6 100644 --- a/module/plugins/crypter/DdlstorageComFolder.py +++ b/module/plugins/crypter/DdlstorageComFolder.py @@ -1,29 +1,18 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.DeadCrypter import DeadCrypter, create_getInfo -class DdlstorageComFolder(SimpleCrypter): +class DdlstorageComFolder(DeadCrypter): __name__ = "DdlstorageComFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?ddlstorage.com/folder/\w{10}' - __version__ = "0.02" + __version__ = "0.03" + + __pattern__ = r'https?://(?:www\.)?ddlstorage\.com/folder/\w+' + __description__ = """DDLStorage.com folder decrypter plugin""" __author_name__ = ("godofdream", "stickell") __author_mail__ = ("soilfiction@gmail.com", "l.stickell@yahoo.it") - LINK_PATTERN = '<a class="sub_title" style="text-decoration:none;" href="(http://www.ddlstorage.com/.*)">' + +getInfo = create_getInfo(SpeedLoadOrg) diff --git a/module/plugins/crypter/DepositfilesComFolder.py b/module/plugins/crypter/DepositfilesComFolder.py index 74d199e12..b7c273f0b 100644 --- a/module/plugins/crypter/DepositfilesComFolder.py +++ b/module/plugins/crypter/DepositfilesComFolder.py @@ -6,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class DepositfilesComFolder(SimpleCrypter): __name__ = "DepositfilesComFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?depositfiles.com/folders/\w+' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?depositfiles.com/folders/\w+' + __description__ = """Depositfiles.com folder decrypter plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/module/plugins/crypter/Dereferer.py b/module/plugins/crypter/Dereferer.py index 4b6309c17..21529ddfd 100644 --- a/module/plugins/crypter/Dereferer.py +++ b/module/plugins/crypter/Dereferer.py @@ -1,22 +1,8 @@ # -*- 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 urllib import unquote from module.plugins.Crypter import Crypter @@ -24,12 +10,15 @@ 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" + + __pattern__ = r'https?://([^/]+)/.*?(?P<url>(ht|f)tps?(://|%3A%2F%2F).*)' + __description__ = """Crypter for dereferers""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + def decrypt(self, pyfile): link = re.match(self.__pattern__, pyfile.url).group('url') - self.core.files.addLinks([urllib.unquote(link).rstrip('+')], pyfile.package().id) + self.urls = [unquote(link).rstrip('+')] diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index dbe5bf705..4c958437a 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -1,22 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################### -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -# @author: Walter Purcaro -############################################################################### import re + from base64 import urlsafe_b64encode from time import time @@ -26,13 +11,16 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class DlProtectCom(SimpleCrypter): __name__ = "DlProtectCom" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?dl-protect\.com/((en|fr)/)?(?P<ID>\w+)' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?dl-protect\.com/((en|fr)/)?(?P<ID>\w+)' + __description__ = """Dl-protect.com decrypter plugin""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" - OFFLINE_PATTERN = ">Unfortunately, the link you are looking for is not found" + OFFLINE_PATTERN = r'>Unfortunately, the link you are looking for is not found' + def getLinks(self): # Direct link with redirect @@ -55,14 +43,14 @@ class DlProtectCom(SimpleCrypter): post_req.update({"i": b64time, "submitform": "Decrypt+link"}) if ">Password :" in self.html: - post_req["pwd"] = self.getPassword() + post_req['pwd'] = self.getPassword() if ">Security Code" in self.html: captcha_id = re.search(r'/captcha\.php\?uid=(.+?)"', self.html).group(1) captcha_url = "http://www.dl-protect.com/captcha.php?uid=" + captcha_id captcha_code = self.decryptCaptcha(captcha_url, imgtype="gif") - post_req["secure"] = captcha_code + post_req['secure'] = captcha_code self.html = self.load(self.pyfile.url, post=post_req) diff --git a/module/plugins/crypter/DontKnowMe.py b/module/plugins/crypter/DontKnowMe.py index 42a38e98f..23fbb8d52 100644 --- a/module/plugins/crypter/DontKnowMe.py +++ b/module/plugins/crypter/DontKnowMe.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- import re -import urllib + +from urllib import unquote from module.plugins.Crypter import Crypter @@ -9,14 +10,17 @@ from module.plugins.Crypter import Crypter class DontKnowMe(Crypter): __name__ = "DontKnowMe" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?dontknow.me/at/\?.+$' __version__ = "0.1" + + __pattern__ = r'http://(?:www\.)?dontknow.me/at/\?.+$' + __description__ = """DontKnow.me decrypter plugin""" __author_name__ = "selaux" - __author_mail__ = "" + __author_mail__ = None + + LINK_PATTERN = r'http://dontknow.me/at/\?(.+)$' - LINK_PATTERN = r"http://dontknow.me/at/\?(.+)$" def decrypt(self, pyfile): link = re.findall(self.LINK_PATTERN, pyfile.url)[0] - self.core.files.addLinks([urllib.unquote(link)], pyfile.package().id) + self.urls = [unquote(link)] diff --git a/module/plugins/crypter/DownloadVimeoCom.py b/module/plugins/crypter/DownloadVimeoCom.py deleted file mode 100644 index 3e137bab1..000000000 --- a/module/plugins/crypter/DownloadVimeoCom.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -import HTMLParser -from module.plugins.Crypter import Crypter - - -class DownloadVimeoCom(Crypter): - __name__ = 'DownloadVimeoCom' - __type__ = 'crypter' - __pattern__ = r'(?:http://vimeo\.com/\d*|http://smotri\.com/video/view/\?id=.*)' - __version__ = '0.1' - __description__ = """Vimeo.com decrypter plugin""" - __author_name__ = "4Christopher" - __author_mail__ = "4Christopher@gmx.de" - - BASE_URL = 'http://downloadvimeo.com' - - def decrypt(self, pyfile): - self.package = pyfile.package() - html = self.load('%s/generate?url=%s' % (self.BASE_URL, pyfile.url)) - h = HTMLParser.HTMLParser() - try: - f = re.search(r'cmd quality="(?P<quality>[^"]+?)">\s*?(?P<URL>[^<]*?)</cmd>', html) - except: - self.logDebug('Failed to find the URL') - else: - url = h.unescape(f.group('URL')) - self.logDebug('Quality: %s, URL: %s' % (f.group('quality'), url)) - self.packages.append((self.package.name, [url], self.package.folder)) diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index f44bac2e9..e7a5a59e9 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -1,48 +1,52 @@ # -*- coding: utf-8 -*- import re + from module.lib.BeautifulSoup import BeautifulSoup + from module.plugins.Crypter import Crypter class DuckCryptInfo(Crypter): __name__ = "DuckCryptInfo" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?duckcrypt.info/(folder|wait|link)/(\w+)/?(\w*)' __version__ = "0.02" + + __pattern__ = r'http://(?:www\.)?duckcrypt.info/(folder|wait|link)/(\w+)/?(\w*)' + __description__ = """DuckCrypt.info decrypter plugin""" __author_name__ = "godofdream" __author_mail__ = "soilfiction@gmail.com" TIMER_PATTERN = r'<span id="timer">(.*)</span>' + def decrypt(self, pyfile): url = pyfile.url # seems we don't need to wait #src = self.req.load(str(url)) - #found = re.search(self.TIMER_PATTERN, src) - #if found: - # self.logDebug("Sleeping for" % found.group(1)) - # self.setWait(int(found.group(1)) ,False) - found = re.match(self.__pattern__, url) - if not found: + #m = re.search(self.TIMER_PATTERN, src) + #if m: + # self.logDebug("Sleeping for" % m.group(1)) + # self.setWait(int(m.group(1)) ,False) + m = re.match(self.__pattern__, url) + if m is None: self.fail('Weird error in link') - if str(found.group(1)) == "link": + if str(m.group(1)) == "link": self.handleLink(url) else: - self.handleFolder(found) + self.handleFolder(m) - - def handleFolder(self, found): - src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(found.group(2))) - found = re.match(self.__pattern__, src) - self.logDebug("Redirectet to " + str(found.group(0))) - src = self.load(str(found.group(0))) + def handleFolder(self, m): + src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(m.group(2))) + m = re.match(self.__pattern__, src) + self.logDebug("Redirectet to " + str(m.group(0))) + src = self.load(str(m.group(0))) soup = BeautifulSoup(src) 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?)') + self.fail('no links m - (Plugin out of date?)') for clink in cryptlinks: if clink.find("a"): self.handleLink(clink.find("a")['href']) @@ -50,8 +54,6 @@ class DuckCryptInfo(Crypter): def handleLink(self, url): src = self.load(url) soup = BeautifulSoup(src) - link = soup.find("iframe")["src"] - if not link: - self.logDebug('no links found - (Plugin out of date?)') - else: - self.core.files.addLinks([link], self.pyfile.package().id) + self.urls = [soup.find("iframe")['src']] + if not self.urls: + self.logDebug('no links m - (Plugin out of date?)') diff --git a/module/plugins/crypter/DuploadOrgFolder.py b/module/plugins/crypter/DuploadOrgFolder.py index 4913bdf2e..6f764f687 100644 --- a/module/plugins/crypter/DuploadOrgFolder.py +++ b/module/plugins/crypter/DuploadOrgFolder.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from module.plugins.internal.SimpleCrypter import SimpleCrypter @@ -20,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class DuploadOrgFolder(SimpleCrypter): __name__ = "DuploadOrgFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?dupload\.org/folder/\d+/' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?dupload\.org/folder/\d+/' + __description__ = """Dupload.org folder decrypter plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" diff --git a/module/plugins/crypter/EasybytezComFolder.py b/module/plugins/crypter/EasybytezComFolder.py index b4a6284fc..7832bef5f 100644 --- a/module/plugins/crypter/EasybytezComFolder.py +++ b/module/plugins/crypter/EasybytezComFolder.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from module.plugins.internal.SimpleCrypter import SimpleCrypter @@ -20,13 +6,15 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class EasybytezComFolder(SimpleCrypter): __name__ = "EasybytezComFolder" __type__ = "crypter" + __version__ = "0.06" + __pattern__ = r'http://(?:www\.)?easybytez\.com/users/(?P<ID>\d+/\d+)' - __version__ = "0.05" + __description__ = """Easybytez.com decrypter plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - FILE_URL_REPLACEMENTS = [(__pattern__, r"http://www.easybytez.com/users/\g<ID>?per_page=10000")] + URL_REPLACEMENTS = [(__pattern__, r"http://www.easybytez.com/users/\g<ID>?per_page=10000")] LINK_PATTERN = r'<td><a href="(http://www\.easybytez\.com/\w+)" target="_blank">.+(?:</a>)?</td>' TITLE_PATTERN = r'<Title>Files of \d+: (?P<title>.+) folder</Title>' diff --git a/module/plugins/crypter/EmbeduploadCom.py b/module/plugins/crypter/EmbeduploadCom.py index fbccf71aa..6b876ed7f 100644 --- a/module/plugins/crypter/EmbeduploadCom.py +++ b/module/plugins/crypter/EmbeduploadCom.py @@ -8,42 +8,43 @@ from module.network.HTTPRequest import BadHeader class EmbeduploadCom(Crypter): __name__ = "EmbeduploadCom" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?embedupload.com/\?d=.*' __version__ = "0.02" - __description__ = """EmbedUpload.com decrypter plugin""" + + __pattern__ = r'http://(?:www\.)?embedupload.com/\?d=.*' __config__ = [("preferedHoster", "str", "Prefered hoster list (bar-separated) ", "embedupload"), ("ignoredHoster", "str", "Ignored hoster list (bar-separated) ", "")] + + __description__ = """EmbedUpload.com decrypter plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" LINK_PATTERN = r'<div id="([^"]+)"[^>]*>\s*<a href="([^"]+)" target="_blank" (?:class="DownloadNow"|style="color:red")>' + def decrypt(self, pyfile): self.html = self.load(pyfile.url, decode=True) tmp_links = [] - new_links = [] - found = re.findall(self.LINK_PATTERN, self.html) - if found: + m = re.findall(self.LINK_PATTERN, self.html) + if m: prefered_set = set(self.getConfig("preferedHoster").split('|')) prefered_set = map(lambda s: s.lower().split('.')[0], prefered_set) print "PF", prefered_set - tmp_links.extend([x[1] for x in found if x[0] in prefered_set]) - self.getLocation(tmp_links, new_links) + tmp_links.extend([x[1] for x in m if x[0] in prefered_set]) + self.urls = self.getLocation(tmp_links) - if not new_links: + if not self.urls: ignored_set = set(self.getConfig("ignoredHoster").split('|')) ignored_set = map(lambda s: s.lower().split('.')[0], ignored_set) print "IG", ignored_set - tmp_links.extend([x[1] for x in found if x[0] not in ignored_set]) - self.getLocation(tmp_links, new_links) + tmp_links.extend([x[1] for x in m if x[0] not in ignored_set]) + self.urls = self.getLocation(tmp_links) - if new_links: - self.core.files.addLinks(new_links, pyfile.package().id) - else: + if not self.urls: self.fail('Could not extract any links') - def getLocation(self, tmp_links, new_links): + def getLocation(self, tmp_links): + new_links = [] for link in tmp_links: try: header = self.load(link, just_header=True) @@ -51,3 +52,4 @@ class EmbeduploadCom(Crypter): new_links.append(header['location']) except BadHeader: pass + return new_links diff --git a/module/plugins/crypter/FilebeerInfoFolder.py b/module/plugins/crypter/FilebeerInfoFolder.py index f5818e072..0743dcb0f 100644 --- a/module/plugins/crypter/FilebeerInfoFolder.py +++ b/module/plugins/crypter/FilebeerInfoFolder.py @@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class FilebeerInfoFolder(DeadCrypter): __name__ = "FilebeerInfoFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?filebeer\.info/(\d+~f).*' __version__ = "0.02" + + __pattern__ = r'http://(?:www\.)?filebeer\.info/(\d+~f).*' + __description__ = """Filebeer.info folder decrypter plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/module/plugins/crypter/FilecloudIoFolder.py b/module/plugins/crypter/FilecloudIoFolder.py new file mode 100644 index 000000000..9ec950061 --- /dev/null +++ b/module/plugins/crypter/FilecloudIoFolder.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.SimpleCrypter import SimpleCrypter + + +class FilecloudIoFolder(SimpleCrypter): + __name__ = "FilecloudIoFolder" + __type__ = "crypter" + __version__ = "0.01" + + __pattern__ = r'https?://(?:www\.)?(filecloud\.io|ifile\.it)/_\w+' + + __description__ = """Filecloud.io folder decrypter plugin""" + __author_name__ = "Walter Purcaro" + __author_mail__ = "vuolter@gmail.com" + + LINK_PATTERN = r'href="(http://filecloud.io/\w+)" title' + TITLE_PATTERN = r'>(?P<title>.+?) - filecloud.io<' diff --git a/module/plugins/crypter/FilefactoryComFolder.py b/module/plugins/crypter/FilefactoryComFolder.py index aece1a01d..562c56732 100644 --- a/module/plugins/crypter/FilefactoryComFolder.py +++ b/module/plugins/crypter/FilefactoryComFolder.py @@ -1,45 +1,25 @@ # -*- coding: utf-8 -*- -import re -from module.plugins.Crypter import Crypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter -class FilefactoryComFolder(Crypter): +class FilefactoryComFolder(SimpleCrypter): __name__ = "FilefactoryComFolder" __type__ = "crypter" - __pattern__ = r'(http://(?:www\.)?filefactory\.com/f/\w+).*' - __version__ = "0.1" + __version__ = "0.2" + + __pattern__ = r'https?://(?:www\.)?filefactory\.com/(?:f|folder)/\w+' + __description__ = """Filefactory.com folder decrypter plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - FOLDER_PATTERN = r'<table class="items" cellspacing="0" cellpadding="0">(.*?)</table>' - LINK_PATTERN = r'<td class="name"><a href="([^"]+)">' - PAGINATOR_PATTERN = r'<div class="list">\s*<label>Pages</label>\s*<ul>(.*?)</ul>\s*</div>' - NEXT_PAGE_PATTERN = r'<li class="current">.*?</li>\s*<li class=""><a href="([^"]+)">' - - def decrypt(self, pyfile): - url_base = re.match(self.__pattern__, pyfile.url).group(1) - html = self.load(url_base) - - new_links = [] - for i in xrange(1, 100): - self.logInfo("Fetching links from page %i" % i) - found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: self.fail("Parse error (FOLDER)") - - new_links.extend(re.findall(self.LINK_PATTERN, found.group(1))) - - try: - paginator = re.search(self.PAGINATOR_PATTERN, html, re.DOTALL).group(1) - next_page = re.search(self.NEXT_PAGE_PATTERN, paginator).group(1) - html = self.load("%s/%s" % (url_base, next_page)) - except Exception, e: - break - else: - self.logInfo("Limit of 99 pages reached, aborting") - - if new_links: - self.core.files.addLinks(new_links, pyfile.package().id) - else: - self.fail('Could not extract any links') + __author_name__ = "stickell" + __author_mail__ = "l.stickell@yahoo.it" + + LINK_PATTERN = r'<td><a href="([^"]+)">' + TITLE_PATTERN = r'<h1>Files in <span>(?P<title>.+)</span></h1>' + PAGES_PATTERN = r'data-paginator-totalPages="(?P<pages>\d+)"' + + SH_COOKIES = [('.filefactory.com', 'locale', 'en_US.utf8')] + + + def loadPage(self, page_n): + return self.load(self.pyfile.url, get={'page': page_n}) diff --git a/module/plugins/crypter/FilerNetFolder.py b/module/plugins/crypter/FilerNetFolder.py new file mode 100644 index 000000000..9951661b5 --- /dev/null +++ b/module/plugins/crypter/FilerNetFolder.py @@ -0,0 +1,22 @@ +import re + +from module.plugins.internal.SimpleCrypter import SimpleCrypter + + +class FilerNetFolder(SimpleCrypter): + __name__ = "FilerNetFolder" + __type__ = "crypter" + __version__ = "0.3" + + __pattern__ = r'https?://filer\.net/folder/\w{16}' + + __description__ = """Filer.net decrypter plugin""" + __author_name_ = ("nath_schwarz", "stickell") + __author_mail_ = ("nathan.notwhite@gmail.com", "l.stickell@yahoo.it") + + LINK_PATTERN = r'href="(/get/\w{16})">(?!<)' + TITLE_PATTERN = r'<h3>(?P<title>.+) - <small' + + + def getLinks(self): + return ['http://filer.net%s' % link for link in re.findall(self.LINK_PATTERN, self.html)] diff --git a/module/plugins/crypter/FileserveComFolder.py b/module/plugins/crypter/FileserveComFolder.py index c3c8b58fe..2db6baf0e 100644 --- a/module/plugins/crypter/FileserveComFolder.py +++ b/module/plugins/crypter/FileserveComFolder.py @@ -8,8 +8,10 @@ from module.plugins.Crypter import Crypter class FileserveComFolder(Crypter): __name__ = "FileserveComFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?fileserve.com/list/\w+' __version__ = "0.11" + + __pattern__ = r'http://(?:www\.)?fileserve.com/list/\w+' + __description__ = """FileServe.com folder decrypter plugin""" __author_name__ = "fionnc" __author_mail__ = "fionnc@gmail.com" @@ -17,17 +19,19 @@ class FileserveComFolder(Crypter): FOLDER_PATTERN = r'<table class="file_list">(.*?)</table>' LINK_PATTERN = r'<a href="([^"]+)" class="sheet_icon wbold">' + def decrypt(self, pyfile): html = self.load(pyfile.url) new_links = [] folder = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if folder is None: self.fail("Parse error (FOLDER)") + if folder is None: + self.fail("Parse error (FOLDER)") new_links.extend(re.findall(self.LINK_PATTERN, folder.group(1))) if new_links: - self.core.files.addLinks(map(lambda s: "http://fileserve.com%s" % s, new_links), pyfile.package().id) + self.urls = [map(lambda s: "http://fileserve.com%s" % s, new_links)] else: self.fail('Could not extract any links') diff --git a/module/plugins/crypter/FilestubeCom.py b/module/plugins/crypter/FilestubeCom.py index f4f09e878..f0aaaa579 100644 --- a/module/plugins/crypter/FilestubeCom.py +++ b/module/plugins/crypter/FilestubeCom.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from module.plugins.internal.SimpleCrypter import SimpleCrypter @@ -20,11 +6,13 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class FilestubeCom(SimpleCrypter): __name__ = "FilestubeCom" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?filestube\.(?:com|to)/\w+' __version__ = "0.03" + + __pattern__ = r'http://(?:www\.)?filestube\.(?:com|to)/\w+' + __description__ = """Filestube.com decrypter plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - LINK_PATTERN = r"<a class=\"file-link-main(?: noref)?\" [^>]* href=\"(http://[^\"]+)" - TITLE_PATTERN = r"<h1\s*> (?P<title>.+) download\s*</h1>" + LINK_PATTERN = r'<a class=\"file-link-main(?: noref)?\" [^>]* href=\"(http://[^\"]+)' + TITLE_PATTERN = r'<h1\s*> (?P<title>.+) download\s*</h1>' diff --git a/module/plugins/crypter/FiletramCom.py b/module/plugins/crypter/FiletramCom.py index 8cdf32ad5..7052955cf 100644 --- a/module/plugins/crypter/FiletramCom.py +++ b/module/plugins/crypter/FiletramCom.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from module.plugins.internal.SimpleCrypter import SimpleCrypter @@ -20,11 +6,13 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class FiletramCom(SimpleCrypter): __name__ = "FiletramCom" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?filetram.com/[^/]+/.+' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?filetram.com/[^/]+/.+' + __description__ = """Filetram.com decrypter plugin""" __author_name__ = ("igel", "stickell") __author_mail__ = ("igelkun@myopera.com", "l.stickell@yahoo.it") - LINK_PATTERN = r"\s+(http://.+)" - TITLE_PATTERN = r"<title>(?P<title>[^<]+) - Free Download[^<]*</title>" + LINK_PATTERN = r'\s+(http://.+)' + TITLE_PATTERN = r'<title>(?P<title>[^<]+) - Free Download[^<]*</title>' diff --git a/module/plugins/crypter/FiredriveComFolder.py b/module/plugins/crypter/FiredriveComFolder.py new file mode 100644 index 000000000..a94d0847f --- /dev/null +++ b/module/plugins/crypter/FiredriveComFolder.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.SimpleCrypter import SimpleCrypter + + +class FiredriveComFolder(SimpleCrypter): + __name__ = "FiredriveComFolder" + __type__ = "crypter" + __version__ = "0.01" + + __pattern__ = r'https?://(?:www\.)?(firedrive|putlocker)\.com/share/.+' + + __description__ = """Firedrive.com folder decrypter plugin""" + __author_name__ = "Walter Purcaro" + __author_mail__ = "vuolter@gmail.com" + + LINK_PATTERN = r'<div class="pf_item pf_(file|folder).+?public=\'(.+?)\'' + TITLE_PATTERN = r'>Shared Folder "(?P<title>.+)" | Firedrive<' + OFFLINE_PATTERN = r'class="sad_face_image"|>No such page here.<' + TEMP_OFFLINE_PATTERN = r'>(File Temporarily Unavailable|Server Error. Try again later)' + + + def getLinks(self): + return map(lambda x: "http://www.firedrive.com/%s/%s" % + ("share" if x[0] == "folder" else "file", x[1]), + re.findall(self.LINK_PATTERN, self.html)) diff --git a/module/plugins/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py index 010451c46..c497fa799 100644 --- a/module/plugins/crypter/FourChanOrg.py +++ b/module/plugins/crypter/FourChanOrg.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +# +# Based on 4chandl by Roland Beermann (https://gist.github.com/enkore/3492599) import re @@ -6,20 +8,18 @@ from module.plugins.Crypter import Crypter class FourChanOrg(Crypter): - # Based on 4chandl by Roland Beermann - # https://gist.github.com/enkore/3492599 __name__ = "FourChanOrg" __type__ = "crypter" __version__ = "0.3" + __pattern__ = r'http://(?:www\.)?boards\.4chan.org/\w+/res/(\d+)' + __description__ = """4chan.org folder decrypter plugin""" + __author_name__ = None + __author_mail__ = None + def decrypt(self, pyfile): pagehtml = self.load(pyfile.url) - images = set(re.findall(r'(images\.4chan\.org/[^/]*/src/[^"<]*)', pagehtml)) - urls = [] - for image in images: - urls.append("http://" + image) - - self.core.files.addLinks(urls, pyfile.package().id) + self.urls = ["http://" + image for image in images] diff --git a/module/plugins/crypter/FreakhareComFolder.py b/module/plugins/crypter/FreakhareComFolder.py index c5df7ff17..2a6877891 100644 --- a/module/plugins/crypter/FreakhareComFolder.py +++ b/module/plugins/crypter/FreakhareComFolder.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ import re @@ -22,8 +8,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class FreakhareComFolder(SimpleCrypter): __name__ = "FreakhareComFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?freakshare\.com/folder/.+' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?freakshare\.com/folder/.+' + __description__ = """Freakhare.com folder decrypter plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" @@ -32,6 +20,7 @@ class FreakhareComFolder(SimpleCrypter): TITLE_PATTERN = r'Folder:</b> (?P<title>.+)' PAGES_PATTERN = r'Pages: +(?P<pages>\d+)' + def loadPage(self, page_n): if not hasattr(self, 'f_id') and not hasattr(self, 'f_md5'): m = re.search(r'http://freakshare.com/\?x=folder&f_id=(\d+)&f_md5=(\w+)', self.html) diff --git a/module/plugins/crypter/FreetexthostCom.py b/module/plugins/crypter/FreetexthostCom.py index e5c9c3d21..bd8a90ce5 100644 --- a/module/plugins/crypter/FreetexthostCom.py +++ b/module/plugins/crypter/FreetexthostCom.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ import re @@ -22,15 +8,18 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class FreetexthostCom(SimpleCrypter): __name__ = "FreetexthostCom" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?freetexthost\.com/\w+' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?freetexthost\.com/\w+' + __description__ = """Freetexthost.com decrypter plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + def getLinks(self): m = re.search(r'<div id="contentsinner">\s*(.+)<div class="viewcount">', self.html, re.DOTALL) - if not m: + if m is None: self.fail('Unable to extract links | Plugin may be out-of-date') links = m.group(1) return links.strip().split("<br />\r\n") diff --git a/module/plugins/crypter/FshareVnFolder.py b/module/plugins/crypter/FshareVnFolder.py index 6e67905d9..5976ff6d5 100644 --- a/module/plugins/crypter/FshareVnFolder.py +++ b/module/plugins/crypter/FshareVnFolder.py @@ -6,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class FshareVnFolder(SimpleCrypter): __name__ = "FshareVnFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?fshare.vn/folder/.*' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?fshare.vn/folder/.*' + __description__ = """Fshare.vn folder decrypter plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 15f0a9a8c..1d9c2801f 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from module.plugins.Crypter import Crypter from module.common.json_layer import json_loads @@ -21,13 +7,16 @@ from module.common.json_layer import json_loads class GooGl(Crypter): __name__ = "GooGl" __type__ = "crypter" - __pattern__ = r'https?://(?:www\.)?goo\.gl/\w+' __version__ = "0.01" + + __pattern__ = r'https?://(?:www\.)?goo\.gl/\w+' + __description__ = """Goo.gl decrypter plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - API_URL = 'https://www.googleapis.com/urlshortener/v1/url' + API_URL = "https://www.googleapis.com/urlshortener/v1/url" + def decrypt(self, pyfile): rep = self.load(self.API_URL, get={'shortUrl': pyfile.url}) @@ -35,6 +24,6 @@ class GooGl(Crypter): rep = json_loads(rep) if 'longUrl' in rep: - self.core.files.addLinks([rep['longUrl']], pyfile.package().id) + self.urls = [rep['longUrl']] else: self.fail('Unable to expand shortened link') diff --git a/module/plugins/crypter/HoerbuchIn.py b/module/plugins/crypter/HoerbuchIn.py index c6773b3f0..924ce5d3a 100644 --- a/module/plugins/crypter/HoerbuchIn.py +++ b/module/plugins/crypter/HoerbuchIn.py @@ -2,15 +2,18 @@ import re -from module.plugins.Crypter import Crypter from module.lib.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup +from module.plugins.Crypter import Crypter + class HoerbuchIn(Crypter): __name__ = "HoerbuchIn" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?hoerbuch\.in/(wp/horbucher/\d+/.+/|tp/out.php\?.+|protection/folder_\d+\.html)' __version__ = "0.6" + + __pattern__ = r'http://(?:www\.)?hoerbuch\.in/(wp/horbucher/\d+/.+/|tp/out.php\?.+|protection/folder_\d+\.html)' + __description__ = """Hoerbuch.in decrypter plugin""" __author_name__ = ("spoob", "mkaay") __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de") @@ -18,6 +21,7 @@ class HoerbuchIn(Crypter): article = re.compile("http://(?:www\.)?hoerbuch\.in/wp/horbucher/\d+/.+/") protection = re.compile("http://(?:www\.)?hoerbuch\.in/protection/folder_\d+.html") + def decrypt(self, pyfile): self.pyfile = pyfile @@ -28,17 +32,15 @@ class HoerbuchIn(Crypter): abookname = soup.find("a", attrs={"rel": "bookmark"}).text for a in soup.findAll("a", attrs={"href": self.protection}): package = "%s (%s)" % (abookname, a.previousSibling.previousSibling.text[:-1]) - links = self.decryptFolder(a["href"]) + links = self.decryptFolder(a['href']) - self.packages.append((package, links, pyfile.package().folder)) + self.packages.append((package, links, package)) else: - links = self.decryptFolder(pyfile.url) - - self.packages.append((pyfile.package().name, links, pyfile.package().folder)) + self.urls = self.decryptFolder(pyfile.url) def decryptFolder(self, url): m = self.protection.search(url) - if not m: + if m is None: self.fail("Bad URL") url = m.group(0) diff --git a/module/plugins/crypter/HotfileFolderCom.py b/module/plugins/crypter/HotfileFolderCom.py index 3a4a9d70a..3efd8fc87 100644 --- a/module/plugins/crypter/HotfileFolderCom.py +++ b/module/plugins/crypter/HotfileFolderCom.py @@ -8,12 +8,15 @@ from module.plugins.Crypter import Crypter class HotfileFolderCom(Crypter): __name__ = "HotfileFolderCom" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?hotfile.com/list/\w+/\w+' __version__ = "0.1" + + __pattern__ = r'http://(?:www\.)?hotfile.com/list/\w+/\w+' + __description__ = """Hotfile.com folder decrypter plugin""" __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.org" + def decrypt(self, pyfile): html = self.load(pyfile.url) @@ -24,4 +27,4 @@ class HotfileFolderCom(Crypter): new_links = [x[0] for x in new_links] - self.packages.append((name, new_links, name)) + self.packages = [(name, new_links, name)] diff --git a/module/plugins/crypter/ILoadTo.py b/module/plugins/crypter/ILoadTo.py index 3a388d41f..d7818570a 100644 --- a/module/plugins/crypter/ILoadTo.py +++ b/module/plugins/crypter/ILoadTo.py @@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class ILoadTo(DeadCrypter): __name__ = "ILoadTo" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?iload\.to/go/\d+-[\w\.-]+/' __version__ = "0.11" + + __pattern__ = r'http://(?:www\.)?iload\.to/go/\d+-[\w\.-]+/' + __description__ = """Iload.to decrypter plugin""" __author_name__ = "hzpz" - __author_mail__ = "" + __author_mail__ = None diff --git a/module/plugins/crypter/ImgurComAlbum.py b/module/plugins/crypter/ImgurComAlbum.py new file mode 100644 index 000000000..eb1f4441a --- /dev/null +++ b/module/plugins/crypter/ImgurComAlbum.py @@ -0,0 +1,24 @@ +import re + +from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.utils import uniqify + + +class ImgurComAlbum(SimpleCrypter): + __name__ = "ImgurComAlbum" + __type__ = "crypter" + __version__ = "0.4" + + __pattern__ = r'https?://(?:www\.|m\.)?imgur\.com/(a|gallery|)/?\w{5,7}' + + __description__ = """Imgur.com decrypter plugin""" + __author_name_ = "nath_schwarz" + __author_mail_ = "nathan.notwhite@gmail.com" + + TITLE_PATTERN = r'(?P<title>.+) - Imgur' + LINK_PATTERN = r'i\.imgur\.com/\w{7}s?\.(?:jpeg|jpg|png|gif|apng)' + + + def getLinks(self): + f = lambda url: "http://" + re.sub(r'(\w{7})s\.', r'\1.', url) + return uniqify(map(f, re.findall(self.LINK_PATTERN, self.html))) diff --git a/module/plugins/crypter/LetitbitNetFolder.py b/module/plugins/crypter/LetitbitNetFolder.py index 8e994984b..0297d2007 100644 --- a/module/plugins/crypter/LetitbitNetFolder.py +++ b/module/plugins/crypter/LetitbitNetFolder.py @@ -7,8 +7,10 @@ from module.plugins.Crypter import Crypter class LetitbitNetFolder(Crypter): __name__ = "LetitbitNetFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?letitbit.net/folder/\w+' __version__ = "0.1" + + __pattern__ = r'http://(?:www\.)?letitbit.net/folder/\w+' + __description__ = """Letitbit.net folder decrypter plugin""" __author_name__ = ("DHMH", "z00nx") __author_mail__ = ("webmaster@pcProfil.de", "z00nx0@gmail.com") @@ -16,18 +18,15 @@ class LetitbitNetFolder(Crypter): FOLDER_PATTERN = r'<table>(.*)</table>' LINK_PATTERN = r'<a href="([^"]+)" target="_blank">' + def decrypt(self, pyfile): html = self.load(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))) + self.urls.extend(re.findall(self.LINK_PATTERN, folder.group(0))) - if new_links: - self.core.files.addLinks(new_links, pyfile.package().id) - else: + if not self.urls: self.fail('Could not extract any links') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 85dde6c87..060a434d2 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- - # -# v2.01 - hagg # * cnl2 and web links are skipped if JS is not available (instead of failing the package) # * only best available link source is used (priority: cnl2>rsdf>ccf>dlc>web -# import base64 import binascii @@ -18,8 +15,10 @@ from module.unescape import unescape class LinkSaveIn(Crypter): __name__ = "LinkSaveIn" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?linksave.in/(?P<id>\w+)$' __version__ = "2.01" + + __pattern__ = r'http://(?:www\.)?linksave.in/(?P<id>\w+)$' + __description__ = """LinkSave.in decrypter plugin""" __author_name__ = "fragonib" __author_mail__ = "fragonib[AT]yahoo[DOT]es" @@ -27,21 +26,21 @@ class LinkSaveIn(Crypter): # Constants _JK_KEY_ = "jk" _CRYPTED_KEY_ = "crypted" - HOSTER_DOMAIN = "linksave.in" + HOSTER_NAME = "linksave.in" + def setup(self): self.html = None self.fileid = None self.captcha = False self.package = None - self.preferred_sources = ['cnl2', 'rsdf', 'ccf', 'dlc', 'web'] + self.preferred_sources = ["cnl2", "rsdf", "ccf", "dlc", "web"] def decrypt(self, pyfile): - # Init self.package = pyfile.package() self.fileid = re.match(self.__pattern__, pyfile.url).group('id') - self.req.cj.setCookie(self.HOSTER_DOMAIN, "Linksave_Language", "english") + self.req.cj.setCookie(self.HOSTER_NAME, "Linksave_Language", "english") # Request package self.html = self.load(pyfile.url) @@ -124,11 +123,11 @@ class LinkSaveIn(Crypter): self.correctCaptcha() def handleLinkSource(self, type_): - if type_ == 'cnl2': + if type_ == "cnl2": return self.handleCNL2() - elif type_ in ('rsdf', 'ccf', 'dlc'): + elif type_ in ("rsdf", "ccf", "dlc"): return self.handleContainer(type_) - elif type_ == 'web': + elif type_ == "web": return self.handleWebLinks() else: self.fail('unknown source type "%s" (this is probably a bug)' % type_) @@ -189,7 +188,6 @@ class LinkSaveIn(Crypter): return package_links def _getCipherParams(self): - # Get jk jk_re = r'<INPUT.*?NAME="%s".*?VALUE="(.*?)"' % LinkSaveIn._JK_KEY_ vjk = re.findall(jk_re, self.html) @@ -203,7 +201,6 @@ class LinkSaveIn(Crypter): return vcrypted, vjk def _getLinks(self, crypted, jk): - # Get key jreturn = self.js.eval("%s f()" % jk) self.logDebug("JsEngine returns value [%s]" % jreturn) diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py index a6e6faa40..21f05b962 100644 --- a/module/plugins/crypter/LinkdecrypterCom.py +++ b/module/plugins/crypter/LinkdecrypterCom.py @@ -1,22 +1,5 @@ # -*- 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/>. - - @author: zoidberg -""" - import re from module.plugins.Crypter import Crypter @@ -25,6 +8,9 @@ class LinkdecrypterCom(Crypter): __name__ = "LinkdecrypterCom" __type__ = "crypter" __version__ = "0.27" + + __pattern__ = None + __description__ = """Linkdecrypter.com""" __author_name__ = ("zoidberg", "flowlee") __author_mail__ = ("zoidberg@mujmail.cz", "") @@ -34,15 +20,14 @@ class LinkdecrypterCom(Crypter): 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() - if new_links: - self.core.files.addLinks(new_links, pyfile.package().id) - else: + self.urls = self.decryptHTML() + if not self.urls: self.fail('Could not extract any links') def decryptAPI(self): @@ -72,17 +57,17 @@ class LinkdecrypterCom(Crypter): 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] + m = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.DOTALL) + if m: + return [x for x in m.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" + m = re.search(self.CAPTCHA_PATTERN, self.html) + if m: + captcha_url = 'http://linkdecrypter.com/' + m.group(1) + result_type = "positional" if "getPos" in m.group(2) else "textual" - found = re.search(r"<p><i><b>([^<]+)</b></i></p>", self.html) - msg = found.group(1) if found else "" + m = re.search(r"<p><i><b>([^<]+)</b></i></p>", self.html) + msg = m.group(1) if m else "" self.logInfo("Captcha protected link", result_type, msg) captcha = self.decryptCaptcha(captcha_url, result_type=result_type) diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 619a474f2..cdf87eeb2 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -8,39 +8,42 @@ from module.plugins.Crypter import Crypter class LixIn(Crypter): __name__ = "LixIn" __type__ = "crypter" - __pattern__ = r'http://(www.)?lix.in/(?P<id>.*)' __version__ = "0.22" + + __pattern__ = r'http://(www.)?lix.in/(?P<id>.*)' + __description__ = """Lix.in decrypter plugin""" __author_name__ = "spoob" __author_mail__ = "spoob@pyload.org" - CAPTCHA_PATTERN = '<img src="(?P<image>captcha_img.php\?.*?)"' + CAPTCHA_PATTERN = r'<img src="(?P<image>captcha_img.php\?.*?)"' SUBMIT_PATTERN = r"value='continue.*?'" LINK_PATTERN = r'name="ifram" src="(?P<link>.*?)"' + def decrypt(self, pyfile): url = pyfile.url - matches = re.match(self.__pattern__, url) - if not matches: + m = re.match(self.__pattern__, url) + if m is None: self.fail("couldn't identify file id") - id = matches.group("id") + id = m.group("id") self.logDebug("File id is %s" % id) self.html = self.req.load(url, decode=True) - matches = re.search(self.SUBMIT_PATTERN, self.html) - if not matches: + m = re.search(self.SUBMIT_PATTERN, self.html) + if m is None: self.fail("link doesn't seem valid") - matches = re.search(self.CAPTCHA_PATTERN, self.html) - if matches: + m = re.search(self.CAPTCHA_PATTERN, self.html) + if m: for _ in xrange(5): - matches = re.search(self.CAPTCHA_PATTERN, self.html) - if matches: + m = re.search(self.CAPTCHA_PATTERN, self.html) + if m: self.logDebug("trying captcha") - captcharesult = self.decryptCaptcha("http://lix.in/" + matches.group("image")) + captcharesult = self.decryptCaptcha("http://lix.in/" + m.group("image")) self.html = self.req.load(url, decode=True, post={"capt": captcharesult, "submit": "submit", "tiny": id}) else: @@ -48,11 +51,9 @@ class LixIn(Crypter): else: self.html = self.req.load(url, decode=True, post={"submit": "submit", "tiny": id}) - matches = re.search(self.LINK_PATTERN, self.html) - if not matches: + m = re.search(self.LINK_PATTERN, self.html) + if m is None: 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((pyfile.package().name, [new_link], pyfile.package().name)) + else: + self.urls = [m.group("link")] + self.logDebug("Found link %s, adding to package" % self.urls[0]) diff --git a/module/plugins/crypter/LofCc.py b/module/plugins/crypter/LofCc.py index a17d58884..8a5cd86ee 100644 --- a/module/plugins/crypter/LofCc.py +++ b/module/plugins/crypter/LofCc.py @@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class LofCc(DeadCrypter): __name__ = "LofCc" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?lof.cc/(.*)' __version__ = "0.21" + + __pattern__ = r'http://(?:www\.)?lof.cc/(.*)' + __description__ = """Lof.cc decrypter plugin""" __author_name__ = "mkaay" __author_mail__ = "mkaay@mkaay.de" diff --git a/module/plugins/crypter/MBLinkInfo.py b/module/plugins/crypter/MBLinkInfo.py index 8aa70e8ff..4fc066e57 100644 --- a/module/plugins/crypter/MBLinkInfo.py +++ b/module/plugins/crypter/MBLinkInfo.py @@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class MBLinkInfo(DeadCrypter): __name__ = "MBLinkInfo" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?mblink\.info/?\?id=(\d+)' __version__ = "0.03" + + __pattern__ = r'http://(?:www\.)?mblink\.info/?\?id=(\d+)' + __description__ = """MBLink.info decrypter plugin""" __author_name__ = ("Gummibaer", "stickell") __author_mail__ = ("Gummibaer@wiki-bierkiste.de", "l.stickell@yahoo.it") diff --git a/module/plugins/crypter/MediafireComFolder.py b/module/plugins/crypter/MediafireComFolder.py index 46856229c..bb7c90722 100644 --- a/module/plugins/crypter/MediafireComFolder.py +++ b/module/plugins/crypter/MediafireComFolder.py @@ -9,33 +9,34 @@ from module.common.json_layer import json_loads class MediafireComFolder(Crypter): __name__ = "MediafireComFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?mediafire\.com/(folder/|\?sharekey=|\?\w{13}($|[/#]))' __version__ = "0.14" + + __pattern__ = r'http://(?:www\.)?mediafire\.com/(folder/|\?sharekey=|\?\w{13}($|[/#]))' + __description__ = """Mediafire.com folder decrypter plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" FOLDER_KEY_PATTERN = r"var afI= '(\w+)';" - FILE_URL_PATTERN = '<meta property="og:url" content="http://www.mediafire.com/\?(\w+)"/>' + FILE_URL_PATTERN = r'<meta property="og:url" content="http://www.mediafire.com/\?(\w+)"/>' - def decrypt(self, pyfile): - new_links = [] + def decrypt(self, pyfile): url, result = checkHTMLHeader(pyfile.url) self.logDebug('Location (%d): %s' % (result, url)) if result == 0: - # load and parse html + # load and parse html html = self.load(pyfile.url) - found = re.search(self.FILE_URL_PATTERN, html) - if found: + m = re.search(self.FILE_URL_PATTERN, html) + if m: # file page - new_links.append("http://www.mediafire.com/file/%s" % found.group(1)) + self.urls.append("http://www.mediafire.com/file/%s" % m.group(1)) else: # folder page - found = re.search(self.FOLDER_KEY_PATTERN, html) - if found: - folder_key = found.group(1) + m = re.search(self.FOLDER_KEY_PATTERN, html) + if m: + folder_key = m.group(1) self.logDebug("FOLDER KEY: %s" % folder_key) json_resp = json_loads(self.load( @@ -43,15 +44,13 @@ class MediafireComFolder(Crypter): #self.logInfo(json_resp) if json_resp['response']['result'] == "Success": for link in json_resp['response']['folder_info']['files']: - new_links.append("http://www.mediafire.com/file/%s" % link['quickkey']) + self.urls.append("http://www.mediafire.com/file/%s" % link['quickkey']) else: self.fail(json_resp['response']['message']) elif result == 1: self.offline() else: - new_links.append(url) + self.urls.append(url) - if new_links: - self.core.files.addLinks(new_links, pyfile.package().id) - else: + if not self.urls: self.fail('Could not extract any links') diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py index 991e1e1ee..ba201621f 100644 --- a/module/plugins/crypter/Movie2kTo.py +++ b/module/plugins/crypter/Movie2kTo.py @@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class Movie2kTo(DeadCrypter): __name__ = "Movie2kTo" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?movie2k\.to/(.*)\.html' __version__ = "0.51" + + __pattern__ = r'http://(?:www\.)?movie2k\.to/(.*)\.html' + __description__ = """Movie2k.to decrypter plugin""" __author_name__ = "4Christopher" __author_mail__ = "4Christopher@gmx.de" diff --git a/module/plugins/crypter/MultiUpOrg.py b/module/plugins/crypter/MultiUpOrg.py index 997d60862..ffeaa6f04 100644 --- a/module/plugins/crypter/MultiUpOrg.py +++ b/module/plugins/crypter/MultiUpOrg.py @@ -1,22 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################### -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -# @author: Walter Purcaro -############################################################################### - import re from urlparse import urljoin @@ -26,14 +9,17 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class MultiUpOrg(SimpleCrypter): __name__ = "MultiUpOrg" __type__ = "crypter" - __pattern__ = r"http://(?:www\.)?multiup\.org/(en|fr)/(?P<TYPE>project|download|miror)/\w+(/\w+)?" __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?multiup\.org/(en|fr)/(?P<TYPE>project|download|miror)/\w+(/\w+)?' + __description__ = """MultiUp.org crypter plugin""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" TITLE_PATTERN = r'<title>.*(Project|Projet|ownload|élécharger) (?P<title>.+?) (\(|- )' + def getLinks(self): m_type = re.match(self.__pattern__, self.pyfile.url).group("TYPE") diff --git a/module/plugins/crypter/MultiloadCz.py b/module/plugins/crypter/MultiloadCz.py index 5e7051bad..7d43ec729 100644 --- a/module/plugins/crypter/MultiloadCz.py +++ b/module/plugins/crypter/MultiloadCz.py @@ -7,36 +7,36 @@ from module.plugins.Crypter import Crypter class MultiloadCz(Crypter): __name__ = "MultiloadCz" __type__ = "crypter" - __pattern__ = r'http://(?:[^/]*\.)?multiload.cz/(stahnout|slozka)/.*' __version__ = "0.4" - __description__ = """Multiload.cz decrypter plugin""" + + __pattern__ = r'http://(?:[^/]*\.)?multiload.cz/(stahnout|slozka)/.*' __config__ = [("usedHoster", "str", "Prefered hoster list (bar-separated) ", ""), ("ignoredHoster", "str", "Ignored hoster list (bar-separated) ", "")] + + __description__ = """Multiload.cz decrypter plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" FOLDER_PATTERN = r'<form action="" method="get"><textarea[^>]*>([^>]*)</textarea></form>' LINK_PATTERN = r'<p class="manager-server"><strong>([^<]+)</strong></p><p class="manager-linky"><a href="([^"]+)">' + def decrypt(self, pyfile): self.html = self.load(pyfile.url, decode=True) - new_links = [] if re.match(self.__pattern__, pyfile.url).group(1) == "slozka": - found = re.search(self.FOLDER_PATTERN, self.html) - if found is not None: - new_links.extend(found.group(1).split()) + m = re.search(self.FOLDER_PATTERN, self.html) + if m: + self.urls.extend(m.group(1).split()) else: - found = re.findall(self.LINK_PATTERN, self.html) - if found: + m = re.findall(self.LINK_PATTERN, self.html) + if m: prefered_set = set(self.getConfig("usedHoster").split('|')) - new_links.extend([x[1] for x in found if x[0] in prefered_set]) + self.urls.extend([x[1] for x in m if x[0] in prefered_set]) - if not new_links: + if not self.urls: ignored_set = set(self.getConfig("ignoredHoster").split('|')) - new_links.extend([x[1] for x in found if x[0] not in ignored_set]) + self.urls.extend([x[1] for x in m if x[0] not in ignored_set]) - if new_links: - self.core.files.addLinks(new_links, pyfile.package().id) - else: + if not self.urls: self.fail('Could not extract any links') diff --git a/module/plugins/crypter/MultiuploadCom.py b/module/plugins/crypter/MultiuploadCom.py index 677080772..96cd734e4 100644 --- a/module/plugins/crypter/MultiuploadCom.py +++ b/module/plugins/crypter/MultiuploadCom.py @@ -10,53 +10,53 @@ from module.common.json_layer import json_loads class MultiuploadCom(Crypter): __name__ = "MultiuploadCom" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?multiupload.com/(\w+)' __version__ = "0.01" - __description__ = """MultiUpload.com decrypter plugin""" + + __pattern__ = r'http://(?:www\.)?multiupload.com/(\w+)' __config__ = [("preferedHoster", "str", "Prefered hoster list (bar-separated) ", "multiupload"), ("ignoredHoster", "str", "Ignored hoster list (bar-separated) ", "")] + + __description__ = """MultiUpload.com decrypter plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" ML_LINK_PATTERN = r'<div id="downloadbutton_" style=""><a href="([^"]+)"' + def decrypt(self, pyfile): self.html = self.load(pyfile.url) - found = re.search(self.ML_LINK_PATTERN, self.html) - ml_url = found.group(1) if found else None + m = re.search(self.ML_LINK_PATTERN, self.html) + ml_url = m.group(1) if m else None json_list = json_loads(self.load("http://multiupload.com/progress/", get={ "d": re.match(self.__pattern__, pyfile.url).group(1), "r": str(int(time() * 1000)) })) - new_links = [] prefered_set = map(lambda s: s.lower().split('.')[0], set(self.getConfig("preferedHoster").split('|'))) if ml_url and 'multiupload' in prefered_set: - new_links.append(ml_url) + self.urls.append(ml_url) for link in json_list: if link['service'].lower() in prefered_set and int(link['status']) and not int(link['deleted']): url = self.getLocation(link['url']) if url: - new_links.append(url) + self.urls.append(url) - if not new_links: + if not self.urls: ignored_set = map(lambda s: s.lower().split('.')[0], set(self.getConfig("ignoredHoster").split('|'))) if 'multiupload' not in ignored_set: - new_links.append(ml_url) + self.urls.append(ml_url) for link in json_list: if link['service'].lower() not in ignored_set and int(link['status']) and not int(link['deleted']): url = self.getLocation(link['url']) if url: - new_links.append(url) + self.urls.append(url) - if new_links: - self.core.files.addLinks(new_links, pyfile.package().id) - else: + if not self.urls: self.fail('Could not extract any links') def getLocation(self, url): diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index eacd4aa8d..1b7b8b3d4 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -5,6 +5,7 @@ import binascii import re from Crypto.Cipher import AES + from module.plugins.Crypter import Crypter from module.plugins.internal.CaptchaService import ReCaptcha @@ -12,27 +13,28 @@ from module.plugins.internal.CaptchaService import ReCaptcha class NCryptIn(Crypter): __name__ = "NCryptIn" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?ncrypt.in/(?P<type>folder|link|frame)-([^/\?]+)' __version__ = "1.32" + + __pattern__ = r'http://(?:www\.)?ncrypt.in/(?P<type>folder|link|frame)-([^/\?]+)' + __description__ = """NCrypt.in decrypter plugin""" __author_name__ = ("fragonib", "stickell") __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "l.stickell@yahoo.it") - # Constants - _JK_KEY_ = "jk" - _CRYPTED_KEY_ = "crypted" + JK_KEY = "jk" + CRYPTED_KEY = "crypted" NAME_PATTERN = r'<meta name="description" content="(?P<N>[^"]+)"' + def setup(self): self.package = None self.html = None self.cleanedHtml = None - self.links_source_order = ['cnl2', 'rsdf', 'ccf', 'dlc', 'web'] + self.links_source_order = ["cnl2", "rsdf", "ccf", "dlc", "web"] self.protection_type = None def decrypt(self, pyfile): - # Init self.package = pyfile.package() package_links = [] @@ -52,7 +54,7 @@ class NCryptIn(Crypter): if not self.isOnline(): self.offline() - # Check for folder protection + # Check for folder protection if self.isProtected(): self.html = self.unlockProtection() self.cleanedHtml = self.removeHtmlCrap(self.html) @@ -75,7 +77,7 @@ class NCryptIn(Crypter): def isSingleLink(self): link_type = re.match(self.__pattern__, self.pyfile.url).group('type') - return link_type in ('link', 'frame') + return link_type in ("link", "frame") def requestFolderHome(self): return self.load(self.pyfile.url, decode=True) @@ -93,16 +95,16 @@ class NCryptIn(Crypter): def isOnline(self): if "Your folder does not exist" in self.cleanedHtml: - self.logDebug("File not found") + self.logDebug("File not m") return False return True def isProtected(self): - form_match = re.search(r'<form.*?name.*?protected.*?>(.*?)</form>', self.cleanedHtml, re.DOTALL) - if form_match: - form_content = form_match.group(1) + form = re.search(r'<form.*?name.*?protected.*?>(.*?)</form>', self.cleanedHtml, re.DOTALL) + if form is not None: + content = form.group(1) for keyword in ("password", "captcha"): - if keyword in form_content: + if keyword in content: self.protection_type = keyword self.logDebug("Links are %s protected" % self.protection_type) return True @@ -116,7 +118,7 @@ class NCryptIn(Crypter): else: name = self.package.name folder = self.package.folder - self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) + self.logDebug("Package info not m, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) return name, folder def unlockProtection(self): @@ -139,7 +141,7 @@ class NCryptIn(Crypter): self.logDebug("Captcha resolved [%s]" % captcha) postData['captcha'] = captcha - # Resolve recaptcha + # Resolve recaptcha if "recaptcha" in form: self.logDebug("ReCaptcha protected") captcha_key = re.search(r'\?k=(.*?)"', form).group(1) @@ -163,7 +165,6 @@ class NCryptIn(Crypter): return self.load(self.pyfile.url, post=postData, decode=True) def handleErrors(self): - if self.protection_type == "password": if "This password is invalid!" in self.cleanedHtml: self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") @@ -178,9 +179,8 @@ class NCryptIn(Crypter): self.correctCaptcha() def handleLinkSource(self, link_source_type): - # Check for JS engine - require_js_engine = link_source_type in ('cnl2', 'rsdf', 'ccf', 'dlc') + require_js_engine = link_source_type in ("cnl2", "rsdf", "ccf", "dlc") if require_js_engine and not self.js: self.logDebug("No JS engine available, skip %s links" % link_source_type) return [] @@ -190,9 +190,9 @@ class NCryptIn(Crypter): return self.handleSingleLink() if link_source_type == 'cnl2': return self.handleCNL2() - elif link_source_type in ('rsdf', 'ccf', 'dlc'): + elif link_source_type in ("rsdf", "ccf", "dlc"): return self.handleContainer(link_source_type) - elif link_source_type == 'web': + elif link_source_type == "web": return self.handleWebLinks() else: self.fail('unknown source type "%s" (this is probably a bug)' % link_source_type) @@ -267,11 +267,11 @@ class NCryptIn(Crypter): pattern = r'<input.*?name="%s".*?value="(.*?)"' # Get jk - jk_re = pattern % NCryptIn._JK_KEY_ + jk_re = pattern % NCryptIn.JK_KEY vjk = re.findall(jk_re, self.html) # Get crypted - crypted_re = pattern % NCryptIn._CRYPTED_KEY_ + crypted_re = pattern % NCryptIn.CRYPTED_KEY vcrypted = re.findall(crypted_re, self.html) # Log and return @@ -279,7 +279,6 @@ class NCryptIn(Crypter): return vcrypted, vjk def _getLinks(self, crypted, jk): - # Get key jreturn = self.js.eval("%s f()" % jk) self.logDebug("JsEngine returns value [%s]" % jreturn) diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 28ee3a9dd..1c337391c 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -8,22 +8,25 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class NetfolderIn(SimpleCrypter): __name__ = "NetfolderIn" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?netfolder.in/((?P<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>\w+))' __version__ = "0.6" + + __pattern__ = r'http://(?:www\.)?netfolder.in/((?P<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>\w+))' + __description__ = """NetFolder.in decrypter plugin""" __author_name__ = ("RaNaN", "fragonib") __author_mail__ = ("RaNaN@pyload.org", "fragonib[AT]yahoo[DOT]es") TITLE_PATTERN = r'<div class="Text">Inhalt des Ordners <span(.*)>(?P<title>.+)</span></div>' + def decrypt(self, pyfile): # Request package self.html = self.load(pyfile.url) - # Check for password protection + # Check for password protection if self.isPasswordProtected(): self.html = self.submitPassword() - if self.html is None: + if not self.html: self.fail("Incorrect password, please set right password on Add package form and retry") # Get package name and folder @@ -36,7 +39,6 @@ class NetfolderIn(SimpleCrypter): self.packages = [(package_name, package_links, folder_name)] def isPasswordProtected(self): - if '<input type="password" name="password"' in self.html: self.logDebug("Links are password protected") return True @@ -53,7 +55,7 @@ class NetfolderIn(SimpleCrypter): url = "http://netfolder.in/folder.php?folder_id=" + id password = self.getPassword() - # Submit package password + # Submit package password post = {'password': password, 'save': 'Absenden'} self.logDebug("Submitting password [%s] for protected links with id [%s]" % (password, id)) html = self.load(url, {}, post) diff --git a/module/plugins/crypter/NosvideoCom.py b/module/plugins/crypter/NosvideoCom.py index 63e199a7a..a3bb11b16 100644 --- a/module/plugins/crypter/NosvideoCom.py +++ b/module/plugins/crypter/NosvideoCom.py @@ -6,11 +6,13 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class NosvideoCom(SimpleCrypter): __name__ = "NosvideoCom" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?nosvideo\.com/\?v=\w+' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?nosvideo\.com/\?v=\w+' + __description__ = """Nosvideo.com decrypter plugin""" __author_name__ = "igel" __author_mail__ = "igelkun@myopera.com" LINK_PATTERN = r'href="(http://(?:w{3}\.)?nosupload.com/\?d=\w+)"' - TITLE_PATTERN = r"<[tT]itle>Watch (?P<title>.+)</[tT]itle>" + TITLE_PATTERN = r'<[tT]itle>Watch (?P<title>.+)</[tT]itle>' diff --git a/module/plugins/crypter/OneKhDe.py b/module/plugins/crypter/OneKhDe.py index 82fad86ce..ba93278d5 100644 --- a/module/plugins/crypter/OneKhDe.py +++ b/module/plugins/crypter/OneKhDe.py @@ -9,12 +9,15 @@ from module.plugins.Crypter import Crypter class OneKhDe(Crypter): __name__ = "OneKhDe" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?1kh.de/f/' __version__ = "0.1" + + __pattern__ = r'http://(?:www\.)?1kh.de/f/' + __description__ = """1kh.de decrypter plugin""" __author_name__ = "spoob" __author_mail__ = "spoob@pyload.org" + def __init__(self, parent): Crypter.__init__(self, parent) self.parent = parent @@ -28,10 +31,8 @@ class OneKhDe(Crypter): def proceed(self, url, location): url = self.parent.url self.html = self.req.load(url) - temp_links = [] link_ids = re.findall(r"<a id=\"DownloadLink_(\d*)\" href=\"http://1kh.de/", self.html) for id in link_ids: new_link = unescape( re.search("width=\"100%\" src=\"(.*)\"></iframe>", self.req.load("http://1kh.de/l/" + id)).group(1)) - temp_links.append(new_link) - self.links = temp_links + self.urls.append(new_link) diff --git a/module/plugins/crypter/OronComFolder.py b/module/plugins/crypter/OronComFolder.py index f087370ac..f0b2f943c 100755 --- a/module/plugins/crypter/OronComFolder.py +++ b/module/plugins/crypter/OronComFolder.py @@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class OronComFolder(DeadCrypter): __name__ = "OronComFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?oron.com/folder/\w+' __version__ = "0.11" + + __pattern__ = r'http://(?:www\.)?oron.com/folder/\w+' + __description__ = """Oron.com folder decrypter plugin""" __author_name__ = "DHMH" __author_mail__ = "webmaster@pcProfil.de" diff --git a/module/plugins/crypter/PastebinCom.py b/module/plugins/crypter/PastebinCom.py index e74f71a5c..55aa2ee4a 100644 --- a/module/plugins/crypter/PastebinCom.py +++ b/module/plugins/crypter/PastebinCom.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from module.plugins.internal.SimpleCrypter import SimpleCrypter @@ -20,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class PastebinCom(SimpleCrypter): __name__ = "PastebinCom" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?pastebin\.com/\w+' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?pastebin\.com/\w+' + __description__ = """Pastebin.com decrypter plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" diff --git a/module/plugins/crypter/QuickshareCzFolder.py b/module/plugins/crypter/QuickshareCzFolder.py index 13d7671bf..9840b84df 100644 --- a/module/plugins/crypter/QuickshareCzFolder.py +++ b/module/plugins/crypter/QuickshareCzFolder.py @@ -7,8 +7,10 @@ from module.plugins.Crypter import Crypter class QuickshareCzFolder(Crypter): __name__ = "QuickshareCzFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?quickshare.cz/slozka-\d+.*' __version__ = "0.1" + + __pattern__ = r'http://(?:www\.)?quickshare.cz/slozka-\d+.*' + __description__ = """Quickshare.cz folder decrypter plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -16,16 +18,14 @@ class QuickshareCzFolder(Crypter): FOLDER_PATTERN = r'<textarea[^>]*>(.*?)</textarea>' LINK_PATTERN = r'(http://www.quickshare.cz/\S+)' + def decrypt(self, pyfile): html = self.load(pyfile.url) - new_links = [] - found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: + m = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + if m is None: self.fail("Parse error (FOLDER)") - new_links.extend(re.findall(self.LINK_PATTERN, found.group(1))) + self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1))) - if new_links: - self.core.files.addLinks(new_links, pyfile.package().id) - else: + if not self.urls: self.fail('Could not extract any links') diff --git a/module/plugins/crypter/RSLayerCom.py b/module/plugins/crypter/RSLayerCom.py index 9f1a9a394..7dda0beab 100644 --- a/module/plugins/crypter/RSLayerCom.py +++ b/module/plugins/crypter/RSLayerCom.py @@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class RSLayerCom(DeadCrypter): __name__ = "RSLayerCom" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?rs-layer.com/directory-' __version__ = "0.21" + + __pattern__ = r'http://(?:www\.)?rs-layer.com/directory-' + __description__ = """RS-Layer.com decrypter plugin""" __author_name__ = "hzpz" - __author_mail__ = "" + __author_mail__ = None diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index aad55c867..1b120fc77 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -12,36 +12,39 @@ from module.plugins.Crypter import Crypter class RelinkUs(Crypter): __name__ = "RelinkUs" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?relink.us/(f/|((view|go).php\?id=))(?P<id>.+)' __version__ = "3.0" + + __pattern__ = r'http://(?:www\.)?relink.us/(f/|((view|go).php\?id=))(?P<id>.+)' + __description__ = """Relink.us decrypter plugin""" __author_name__ = "fragonib" __author_mail__ = "fragonib[AT]yahoo[DOT]es" # Constants - 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' + PREFERRED_LINK_SOURCES = ["cnl2", "dlc", "web"] + + OFFLINE_TOKEN = r'<title>Tattooside' + PASSWORD_TOKEN = r'container_password\.php' + PASSWORD_ERROR_ROKEN = r'You have entered an incorrect password' + PASSWORD_SUBMIT_URL = r'http://www\.relink\.us/container_password\.php' + CAPTCHA_TOKEN = r'container_captcha\.php' + CAPTCHA_ERROR_ROKEN = r'You have solved the captcha wrong' + CAPTCHA_IMG_URL = r'http://www\.relink\.us/core/captcha/circlecaptcha\.php' + CAPTCHA_SUBMIT_URL = r'http://www\.relink\.us/container_captcha\.php' + FILE_TITLE_REGEX = r'<th>Title</th><td><i>(.*)</i></td></tr>' + FILE_NOTITLE = r'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" + DLC_DOWNLOAD_URL = r'http://www\.relink\.us/download\.php' WEB_FORWARD_REGEX = r"getFile\('(?P<link>.+)'\)" - WEB_FORWARD_URL = "http://www.relink.us/frame.php" + WEB_FORWARD_URL = r'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 @@ -50,7 +53,6 @@ class RelinkUs(Crypter): self.captcha = False def decrypt(self, pyfile): - # Init self.initPackage(pyfile) @@ -61,7 +63,7 @@ class RelinkUs(Crypter): if not self.isOnline(): self.offline() - # Check for protection + # Check for protection if self.isPasswordProtected(): self.unlockPasswordProtection() self.handleErrors() @@ -92,10 +94,9 @@ class RelinkUs(Crypter): 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) + self.html = self.load(self.pyfile.url, decode=True) def isOnline(self): if self.OFFLINE_TOKEN in self.html: @@ -132,7 +133,7 @@ class RelinkUs(Crypter): def getPackageInfo(self): name = folder = None - # Try to get info from web + # 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() @@ -146,7 +147,7 @@ class RelinkUs(Crypter): folder = self.package.folder self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) - # Return package info + # Return package info return name, folder def handleErrors(self): @@ -197,7 +198,7 @@ class RelinkUs(Crypter): try: dlc = self.load(container_url) dlc_filename = self.fileid + ".dlc" - dlc_filepath = os.path.join(self.config["general"]["download_folder"], dlc_filename) + dlc_filepath = os.path.join(self.config['general']['download_folder'], dlc_filename) f = open(dlc_filepath, "wb") f.write(dlc) f.close() @@ -225,7 +226,6 @@ class RelinkUs(Crypter): 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) @@ -239,7 +239,6 @@ class RelinkUs(Crypter): return vcrypted, vjk def _getLinks(self, crypted, jk): - # Get key jreturn = self.js.eval("%s f()" % jk) self.logDebug("JsEngine returns value [%s]" % jreturn) diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 4a907c28d..e0c165705 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -1,24 +1,29 @@ # -*- coding: utf-8 -*- import re + from pycurl import FOLLOWLOCATION +from module.lib.BeautifulSoup import BeautifulSoup + from module.common.json_layer import json_loads from module.plugins.Crypter import Crypter from module.plugins.internal.CaptchaService import SolveMedia -from module.lib.BeautifulSoup import BeautifulSoup class SafelinkingNet(Crypter): - __name__ = 'SafelinkingNet' - __type__ = 'crypter' + __name__ = "SafelinkingNet" + __type__ = "crypter" + __version__ = "0.1" + __pattern__ = r'https?://(?:www\.)?safelinking.net/([pd])/\w+' - __version__ = '0.1' + __description__ = """Safelinking.net decrypter plugin""" __author_name__ = "quareevo" __author_mail__ = "quareevo@arcor.de" - __Solvemedia_pattern__ = "solvemediaApiKey = '([\w\.\-_]+)';" + SOLVEMEDIA_PATTERN = "solvemediaApiKey = '([\w\.\-_]+)';" + def decrypt(self, pyfile): url = pyfile.url @@ -27,24 +32,23 @@ class SafelinkingNet(Crypter): self.load(url) m = re.search("^Location: (.+)$", self.req.http.header, re.MULTILINE) if m: - self.core.files.addLinks([m.group(1)], pyfile.package().id) + self.urls = [m.group(1)] else: self.fail("Couldn't find forwarded Link") else: password = "" - packageLinks = [] postData = {"post-protect": "1"} self.html = self.load(url) if "link-password" in self.html: password = pyfile.package().password - postData["link-password"] = password + postData['link-password'] = password if "altcaptcha" in self.html: for _ in xrange(5): - m = re.search(self.__Solvemedia_pattern__, self.html) + m = re.search(self.SOLVEMEDIA_PATTERN, self.html) if m: captchaKey = m.group(1) captcha = SolveMedia(self) @@ -53,8 +57,8 @@ class SafelinkingNet(Crypter): self.fail("Error parsing captcha") challenge, response = captcha.challenge(captchaKey) - postData["adcopy_challenge"] = challenge - postData["adcopy_response"] = response + postData['adcopy_challenge'] = challenge + postData['adcopy_response'] = response self.html = self.load(url, post=postData) if "The password you entered was incorrect" in self.html: @@ -72,9 +76,7 @@ class SafelinkingNet(Crypter): if m: linkDict = json_loads(m.group(1)) for link in linkDict: - if not "http://" in link["full"]: - packageLinks.append("https://safelinking.net/d/" + link["full"]) + if not "http://" in link['full']: + self.urls.append("https://safelinking.net/d/" + link['full']) else: - packageLinks.append(link["full"]) - - self.core.files.addLinks(packageLinks, pyfile.package().id) + self.urls.append(link['full']) diff --git a/module/plugins/crypter/SecuredIn.py b/module/plugins/crypter/SecuredIn.py index 771205ec8..0b558c688 100644 --- a/module/plugins/crypter/SecuredIn.py +++ b/module/plugins/crypter/SecuredIn.py @@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class SecuredIn(DeadCrypter): __name__ = "SecuredIn" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?secured\.in/download-[\d]+-[\w]{8}\.html' __version__ = "0.21" + + __pattern__ = r'http://(?:www\.)?secured\.in/download-[\d]+-[\w]{8}\.html' + __description__ = """Secured.in decrypter plugin""" __author_name__ = "mkaay" __author_mail__ = "mkaay@mkaay.de" diff --git a/module/plugins/crypter/SerienjunkiesOrg.py b/module/plugins/crypter/SerienjunkiesOrg.py index 6fbbfedb3..fe4ee4e36 100644 --- a/module/plugins/crypter/SerienjunkiesOrg.py +++ b/module/plugins/crypter/SerienjunkiesOrg.py @@ -1,18 +1,22 @@ # -*- coding: utf-8 -*- +import random import re + from time import sleep -import random -from module.plugins.Crypter import Crypter + from module.lib.BeautifulSoup import BeautifulSoup + +from module.plugins.Crypter import Crypter from module.unescape import unescape class SerienjunkiesOrg(Crypter): __name__ = "SerienjunkiesOrg" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?(serienjunkies.org|dokujunkies.org)/.*?' __version__ = "0.39" + + __pattern__ = r'http://(?:www\.)?(serienjunkies.org|dokujunkies.org)/.*?' __config__ = [("changeNameSJ", "Packagename;Show;Season;Format;Episode", "Take SJ.org name", "Show"), ("changeNameDJ", "Packagename;Show;Format;Episode", "Take DJ.org name", "Show"), ("randomPreferred", "bool", "Randomize Preferred-List", False), @@ -21,10 +25,12 @@ class SerienjunkiesOrg(Crypter): ("hosterList", "str", "Preferred Hoster list (comma separated)", "RapidshareCom,UploadedTo,NetloadIn,FilefactoryCom,FreakshareNet,FilebaseTo,HotfileCom,DepositfilesCom,EasyshareCom,KickloadCom"), ("ignoreList", "str", "Ignored Hoster list (comma separated)", "MegauploadCom")] + __description__ = """Serienjunkies.org decrypter plugin""" __author_name__ = ("mkaay", "godofdream") __author_mail__ = ("mkaay@mkaay.de", "soilfiction@gmail.com") + def setup(self): self.multiDL = False @@ -51,9 +57,9 @@ class SerienjunkiesOrg(Crypter): package_links = [] for a in nav.findAll("a"): if self.getConfig("changeNameSJ") == "Show": - package_links.append(a["href"]) + package_links.append(a['href']) else: - package_links.append(a["href"] + "#hasName") + package_links.append(a['href'] + "#hasName") if self.getConfig("changeNameSJ") == "Show": self.packages.append((packageName, package_links, packageName)) else: @@ -85,32 +91,32 @@ class SerienjunkiesOrg(Crypter): opts[n.strip()] = val.strip() gid += 1 groups[gid] = {} - groups[gid]["ep"] = {} - groups[gid]["opts"] = opts + groups[gid]['ep'] = {} + groups[gid]['opts'] = opts elif re.search("<strong>Download:", str(p)): parts = str(p).split("<br />") if re.search("<strong>", parts[0]): ename = re.search('<strong>(.*?)</strong>', parts[0]).group(1).strip().decode("utf-8").replace( "–", "-") - groups[gid]["ep"][ename] = {} + groups[gid]['ep'][ename] = {} parts.remove(parts[0]) for part in parts: hostername = re.search(r" \| ([-a-zA-Z0-9]+\.\w+)", part) if hostername: hostername = hostername.group(1) - groups[gid]["ep"][ename][hostername] = [] + groups[gid]['ep'][ename][hostername] = [] links = re.findall('href="(.*?)"', part) for link in links: - groups[gid]["ep"][ename][hostername].append(link + "#hasName") + groups[gid]['ep'][ename][hostername].append(link + "#hasName") links = [] for g in groups.values(): - for ename in g["ep"]: - links.extend(self.getpreferred(g["ep"][ename])) + for ename in g['ep']: + links.extend(self.getpreferred(g['ep'][ename])) if self.getConfig("changeNameSJ") == "Episode": self.packages.append((ename, links, ename)) links = [] - package = "%s (%s, %s)" % (seasonName, g["opts"]["Format"], g["opts"]["Sprache"]) + package = "%s (%s, %s)" % (seasonName, g['opts']['Format'], g['opts']['Sprache']) if self.getConfig("changeNameSJ") == "Format": self.packages.append((package, links, package)) links = [] @@ -135,12 +141,12 @@ class SerienjunkiesOrg(Crypter): sleep(5) self.retry() - captchaUrl = "http://download.serienjunkies.org" + captchaTag["src"] + captchaUrl = "http://download.serienjunkies.org" + captchaTag['src'] result = self.decryptCaptcha(str(captchaUrl), imgtype="png") sinp = form.find(attrs={"name": "s"}) self.req.lastURL = str(url) - sj = self.load(str(url), post={'s': sinp["value"], 'c': result, 'action': "Download"}) + sj = self.load(str(url), post={'s': sinp['value'], 'c': result, 'action': "Download"}) soup = BeautifulSoup(sj) rawLinks = soup.findAll(attrs={"action": re.compile("^http://download.serienjunkies.org/")}) @@ -154,7 +160,7 @@ class SerienjunkiesOrg(Crypter): links = [] for link in rawLinks: - frameUrl = link["action"].replace("/go-", "/frame/go-") + frameUrl = link['action'].replace("/go-", "/frame/go-") links.append(self.handleFrame(frameUrl)) if re.search("#hasName", url) or ((self.getConfig("changeNameSJ") == "Packagename") and (self.getConfig("changeNameDJ") == "Packagename")): @@ -171,12 +177,12 @@ class SerienjunkiesOrg(Crypter): soup = BeautifulSoup(sj) form = soup.find("form", attrs={"action": re.compile("^http://serienjunkies.org")}) captchaTag = form.find(attrs={"src": re.compile("^/safe/secure/")}) - captchaUrl = "http://serienjunkies.org" + captchaTag["src"] + captchaUrl = "http://serienjunkies.org" + captchaTag['src'] result = self.decryptCaptcha(str(captchaUrl)) - url = form["action"] + url = form['action'] sinp = form.find(attrs={"name": "s"}) - self.req.load(str(url), post={'s': sinp["value"], 'c': result, 'dl.start': "Download"}, cookies=False, + self.req.load(str(url), post={'s': sinp['value'], 'c': result, 'dl.start': "Download"}, cookies=False, just_header=True) decrypted = self.req.lastEffectiveURL if decrypted == str(url): @@ -215,32 +221,32 @@ class SerienjunkiesOrg(Crypter): opts[n.strip()] = val.strip() gid += 1 groups[gid] = {} - groups[gid]["ep"] = {} - groups[gid]["opts"] = opts + groups[gid]['ep'] = {} + groups[gid]['opts'] = opts elif re.search("<strong>Download:", str(p)): parts = str(p).split("<br />") if re.search("<strong>", parts[0]): ename = re.search('<strong>(.*?)</strong>', parts[0]).group(1).strip().decode("utf-8").replace( "–", "-") - groups[gid]["ep"][ename] = {} + groups[gid]['ep'][ename] = {} parts.remove(parts[0]) for part in parts: hostername = re.search(r" \| ([-a-zA-Z0-9]+\.\w+)", part) if hostername: hostername = hostername.group(1) - groups[gid]["ep"][ename][hostername] = [] + groups[gid]['ep'][ename][hostername] = [] links = re.findall('href="(.*?)"', part) for link in links: - groups[gid]["ep"][ename][hostername].append(link + "#hasName") + groups[gid]['ep'][ename][hostername].append(link + "#hasName") links = [] for g in groups.values(): - for ename in g["ep"]: - links.extend(self.getpreferred(g["ep"][ename])) + for ename in g['ep']: + links.extend(self.getpreferred(g['ep'][ename])) if self.getConfig("changeNameDJ") == "Episode": self.packages.append((ename, links, ename)) links = [] - package = "%s (%s, %s)" % (seasonName, g["opts"]["Format"], g["opts"]["Sprache"]) + package = "%s (%s, %s)" % (seasonName, g['opts']['Format'], g['opts']['Sprache']) if self.getConfig("changeNameDJ") == "Format": self.packages.append((package, links, package)) links = [] @@ -255,7 +261,7 @@ class SerienjunkiesOrg(Crypter): soup = BeautifulSoup(src) content = soup.find("div", attrs={"id": "content"}) for a in content.findAll("a", attrs={"rel": "bookmark"}): - package_links.append(a["href"]) + package_links.append(a['href']) self.core.files.addLinks(package_links, self.pyfile.package().id) def decrypt(self, pyfile): diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 816842216..87bb16a50 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -11,12 +11,15 @@ from module.plugins.Crypter import Crypter class ShareLinksBiz(Crypter): __name__ = "ShareLinksBiz" __type__ = "crypter" - __pattern__ = r'(?P<base>http://(?:www\.)?(share-links|s2l)\.biz)/(?P<id>_?[0-9a-z]+)(/.*)?' __version__ = "1.13" + + __pattern__ = r'http://(?:www\.)?(share-links|s2l)\.biz/(?P<ID>_?\w+)' + __description__ = """Share-Links.biz decrypter plugin""" __author_name__ = "fragonib" __author_mail__ = "fragonib[AT]yahoo[DOT]es" + def setup(self): self.baseUrl = None self.fileId = None @@ -25,7 +28,6 @@ class ShareLinksBiz(Crypter): self.captcha = False def decrypt(self, pyfile): - # Init self.initFile(pyfile) @@ -63,8 +65,8 @@ class ShareLinksBiz(Crypter): url = pyfile.url if 's2l.biz' in url: url = self.load(url, just_header=True)['location'] - self.baseUrl = re.match(self.__pattern__, url).group(1) - self.fileId = re.match(self.__pattern__, url).group('id') + self.baseUrl = "http://www.%s.biz" % re.match(self.__pattern__, url).group(1) + self.fileId = re.match(self.__pattern__, url).group('ID') self.package = pyfile.package() def isOnline(self): @@ -223,7 +225,6 @@ class ShareLinksBiz(Crypter): return package_links def _getCipherParams(self): - # Request CNL2 code = re.search(r'ClicknLoad.swf\?code=(.*?)"', self.html).group(1) url = "%s/get/cnl2/%s" % (self.baseUrl, code) @@ -244,7 +245,6 @@ class ShareLinksBiz(Crypter): return crypted, jk def _getLinks(self, crypted, jk): - # Get key jreturn = self.js.eval("%s f()" % jk) self.logDebug("JsEngine returns value [%s]" % jreturn) diff --git a/module/plugins/crypter/ShareRapidComFolder.py b/module/plugins/crypter/ShareRapidComFolder.py index 15c8dccde..fd12ff96f 100644 --- a/module/plugins/crypter/ShareRapidComFolder.py +++ b/module/plugins/crypter/ShareRapidComFolder.py @@ -6,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class ShareRapidComFolder(SimpleCrypter): __name__ = "ShareRapidComFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?((share(-?rapid\.(biz|com|cz|info|eu|net|org|pl|sk)|-(central|credit|free|net)\.cz|-ms\.net)|(s-?rapid|rapids)\.(cz|sk))|(e-stahuj|mediatack|premium-rapidshare|rapidshare-premium|qiuck)\.cz|kadzet\.com|stahuj-zdarma\.eu|strelci\.net|universal-share\.com)/(slozka/.+)' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?((share(-?rapid\.(biz|com|cz|info|eu|net|org|pl|sk)|-(central|credit|free|net)\.cz|-ms\.net)|(s-?rapid|rapids)\.(cz|sk))|(e-stahuj|mediatack|premium-rapidshare|rapidshare-premium|qiuck)\.cz|kadzet\.com|stahuj-zdarma\.eu|strelci\.net|universal-share\.com)/(slozka/.+)' + __description__ = """Share-Rapid.com folder decrypter plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/module/plugins/crypter/SpeedLoadOrgFolder.py b/module/plugins/crypter/SpeedLoadOrgFolder.py index 4bb1562ee..092d3efe4 100644 --- a/module/plugins/crypter/SpeedLoadOrgFolder.py +++ b/module/plugins/crypter/SpeedLoadOrgFolder.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from module.plugins.internal.DeadCrypter import DeadCrypter @@ -20,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class SpeedLoadOrgFolder(DeadCrypter): __name__ = "SpeedLoadOrgFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?speedload\.org/(\d+~f$|folder/\d+/)' __version__ = "0.3" + + __pattern__ = r'http://(?:www\.)?speedload\.org/(\d+~f$|folder/\d+/)' + __description__ = """Speedload decrypter plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" diff --git a/module/plugins/crypter/StealthTo.py b/module/plugins/crypter/StealthTo.py index e97a741e0..402724e89 100644 --- a/module/plugins/crypter/StealthTo.py +++ b/module/plugins/crypter/StealthTo.py @@ -1,48 +1,15 @@ # -*- coding: utf-8 -*- -import re +from module.plugins.internal.DeadCrypter import DeadCrypter -from module.plugins.Crypter import Crypter - -class StealthTo(Crypter): +class StealthTo(DeadCrypter): __name__ = "StealthTo" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?stealth.to/folder/' - __version__ = "0.1" + __version__ = "0.2" + + __pattern__ = r'http://(?:www\.)?stealth\.to/folder/.+' + __description__ = """Stealth.to decrypter plugin""" __author_name__ = "spoob" __author_mail__ = "spoob@pyload.org" - - def __init__(self, parent): - Crypter.__init__(self, parent) - self.parent = parent - self.html = None - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - url = self.parent.url - self.html = self.req.load(url, cookies=True) - temp_links = [] - ids = [] - ats = [] # authenticity_token - inputs = re.findall(r"(<(input|form)[^>]+)", self.html) - for input in inputs: - if re.search(r"name=\"authenticity_token\"", input[0]): - ats.append(re.search(r"value=\"([^\"]+)", input[0]).group(1)) - if re.search(r"name=\"id\"", input[0]): - ids.append(re.search(r"value=\"([^\"]+)", input[0]).group(1)) - - for i in xrange(0, len(ids)): - self.req.load(url + "/web", - post={"authenticity_token": ats[i], "id": str(ids[i]), "link": ("download_" + str(ids[i]))}, - cookies=True) - new_html = self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": "1"}, - cookies=True) - temp_links.append(re.search(r"iframe src=\"(.*)\" frameborder", new_html).group(1)) - - self.links = temp_links diff --git a/module/plugins/crypter/TnyCz.py b/module/plugins/crypter/TnyCz.py index 6c56f7639..3ae2c5ed2 100644 --- a/module/plugins/crypter/TnyCz.py +++ b/module/plugins/crypter/TnyCz.py @@ -1,22 +1,5 @@ # -*- 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/>. - - @author: Walter Purcaro -""" - from module.plugins.internal.SimpleCrypter import SimpleCrypter import re @@ -25,14 +8,17 @@ import re class TnyCz(SimpleCrypter): __name__ = "TnyCz" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?tny\.cz/\w+' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?tny\.cz/\w+' + __description__ = """Tny.cz decrypter plugin""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" TITLE_PATTERN = r'<title>(?P<title>.+) - .+</title>' + def getLinks(self): m = re.search(r'<a id=\'save_paste\' href="(.+save\.php\?hash=.+)">', self.html) return re.findall(".+", self.load(m.group(1), decode=True)) if m else None diff --git a/module/plugins/crypter/TrailerzoneInfo.py b/module/plugins/crypter/TrailerzoneInfo.py index 84a476a38..42e45a819 100644 --- a/module/plugins/crypter/TrailerzoneInfo.py +++ b/module/plugins/crypter/TrailerzoneInfo.py @@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class TrailerzoneInfo(DeadCrypter): __name__ = "TrailerzoneInfo" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?trailerzone.info/.*?' __version__ = "0.03" + + __pattern__ = r'http://(?:www\.)?trailerzone.info/.*?' + __description__ = """TrailerZone.info decrypter plugin""" __author_name__ = "godofdream" __author_mail__ = "soilfiction@gmail.com" diff --git a/module/plugins/crypter/TurbobitNetFolder.py b/module/plugins/crypter/TurbobitNetFolder.py index d9e63b4ce..0810e0ed1 100644 --- a/module/plugins/crypter/TurbobitNetFolder.py +++ b/module/plugins/crypter/TurbobitNetFolder.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################### -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -############################################################################### import re @@ -23,22 +9,25 @@ from module.common.json_layer import json_loads class TurbobitNetFolder(SimpleCrypter): __name__ = "TurbobitNetFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?turbobit\.net/download/folder/(?P<ID>\w+)' __version__ = "0.03" + + __pattern__ = r'http://(?:www\.)?turbobit\.net/download/folder/(?P<ID>\w+)' + __description__ = """Turbobit.net folder decrypter plugin""" __author_name__ = ("stickell", "Walter Purcaro") __author_mail__ = ("l.stickell@yahoo.it", "vuolter@gmail.com") TITLE_PATTERN = r"src='/js/lib/grid/icon/folder.png'> <span>(?P<title>.+?)</span>" + def _getLinks(self, id, page=1): gridFile = self.load("http://turbobit.net/downloadfolder/gridFile", get={"rootId": id, "rows": 200, "page": page}, decode=True) grid = json_loads(gridFile) - if grid["rows"]: - for i in grid["rows"]: - yield i["id"] + if grid['rows']: + for i in grid['rows']: + yield i['id'] for id in self._getLinks(id, page + 1): yield id else: diff --git a/module/plugins/crypter/TusfilesNetFolder.py b/module/plugins/crypter/TusfilesNetFolder.py index 0bc770f99..f51c2b715 100644 --- a/module/plugins/crypter/TusfilesNetFolder.py +++ b/module/plugins/crypter/TusfilesNetFolder.py @@ -1,20 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################### -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -# @author: Walter Purcaro -############################################################################### import math import re @@ -26,8 +10,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class TusfilesNetFolder(SimpleCrypter): __name__ = "TusfilesNetFolder" __type__ = "crypter" + __version__ = "0.02" + __pattern__ = r'https?://(?:www\.)?tusfiles\.net/go/(?P<ID>\w+)/?' - __version__ = "0.01" + __description__ = """Tusfiles.net folder decrypter plugin""" __author_name__ = ("Walter Purcaro", "stickell") __author_mail__ = ("vuolter@gmail.com", "l.stickell@yahoo.it") @@ -36,7 +22,8 @@ class TusfilesNetFolder(SimpleCrypter): TITLE_PATTERN = r'<Title>.*?\: (?P<title>.+) folder</Title>' PAGES_PATTERN = r'>\((?P<pages>\d+) \w+\)<' - FILE_URL_REPLACEMENTS = [(__pattern__, r'https://www.tusfiles.net/go/\g<ID>/')] + URL_REPLACEMENTS = [(__pattern__, r'https://www.tusfiles.net/go/\g<ID>/')] + def loadPage(self, page_n): return self.load(urljoin(self.pyfile.url, str(page_n)), decode=True) diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index eebb14497..06d30099c 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -7,8 +7,10 @@ from module.plugins.Crypter import Crypter class UlozToFolder(Crypter): __name__ = "UlozToFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(m|soubory)/.*' __version__ = "0.2" + + __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(m|soubory)/.*' + __description__ = """Uloz.to folder decrypter plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -17,26 +19,27 @@ class UlozToFolder(Crypter): LINK_PATTERN = r'<br /><a href="/([^"]+)">[^<]+</a>' NEXT_PAGE_PATTERN = r'<a class="next " href="/([^"]+)"> </a>' + def decrypt(self, pyfile): html = self.load(pyfile.url) new_links = [] for i in xrange(1, 100): self.logInfo("Fetching links from page %i" % i) - found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: + m = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + if m is None: self.fail("Parse error (FOLDER)") - new_links.extend(re.findall(self.LINK_PATTERN, found.group(1))) - found = re.search(self.NEXT_PAGE_PATTERN, html) - if found: - html = self.load("http://ulozto.net/" + found.group(1)) + new_links.extend(re.findall(self.LINK_PATTERN, m.group(1))) + m = re.search(self.NEXT_PAGE_PATTERN, html) + if m: + html = self.load("http://ulozto.net/" + m.group(1)) else: break else: self.logInfo("Limit of 99 pages reached, aborting") if new_links: - self.core.files.addLinks(map(lambda s: "http://ulozto.net/%s" % s, new_links), pyfile.package().id) + self.urls = [map(lambda s: "http://ulozto.net/%s" % s, new_links)] else: self.fail('Could not extract any links') diff --git a/module/plugins/crypter/UploadableChFolder.py b/module/plugins/crypter/UploadableChFolder.py new file mode 100644 index 000000000..b76076531 --- /dev/null +++ b/module/plugins/crypter/UploadableChFolder.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.SimpleCrypter import SimpleCrypter + + +class UploadableChFolder(SimpleCrypter): + __name__ = "UploadableChFolder" + __type__ = "crypter" + __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?uploadable\.ch/list/\w+' + + __description__ = """ Uploadable.ch folder decrypter plugin """ + __author_name__ = ("guidobelix", "Walter Purcaro") + __author_mail__ = ("guidobelix@hotmail.it", "vuolter@gmail.com") + + + LINK_PATTERN = r'"(.+?)" class="icon_zipfile">' + TITLE_PATTERN = r'<div class="folder"><span> </span>(?P<title>.+?)</div>' + OFFLINE_PATTERN = r'We are sorry... The URL you entered cannot be found on the server.' + TEMP_OFFLINE_PATTERN = r'<div class="icon_err">' diff --git a/module/plugins/crypter/UploadedToFolder.py b/module/plugins/crypter/UploadedToFolder.py index 97c77fdce..068412062 100644 --- a/module/plugins/crypter/UploadedToFolder.py +++ b/module/plugins/crypter/UploadedToFolder.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ import re @@ -22,8 +8,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class UploadedToFolder(SimpleCrypter): __name__ = "UploadedToFolder" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|folder|list)/(?P<id>\w+)' __version__ = "0.3" + + __pattern__ = r'http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|folder|list)/(?P<id>\w+)' + __description__ = """UploadedTo decrypter plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" @@ -31,6 +19,7 @@ class UploadedToFolder(SimpleCrypter): 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) diff --git a/module/plugins/crypter/WiiReloadedOrg.py b/module/plugins/crypter/WiiReloadedOrg.py index 0b983c705..cb02fbd2d 100644 --- a/module/plugins/crypter/WiiReloadedOrg.py +++ b/module/plugins/crypter/WiiReloadedOrg.py @@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class WiiReloadedOrg(DeadCrypter): __name__ = "WiiReloadedOrg" __type__ = "crypter" - __pattern__ = r'http://(?:www\.)?wii-reloaded\.org/protect/get\.php\?i=.+' __version__ = "0.11" + + __pattern__ = r'http://(?:www\.)?wii-reloaded\.org/protect/get\.php\?i=.+' + __description__ = """Wii-Reloaded.org decrypter plugin""" __author_name__ = "hzpz" - __author_mail__ = "" + __author_mail__ = None diff --git a/module/plugins/crypter/XupPl.py b/module/plugins/crypter/XupPl.py index c04fc69f8..5e5f511a8 100644 --- a/module/plugins/crypter/XupPl.py +++ b/module/plugins/crypter/XupPl.py @@ -6,15 +6,18 @@ from module.plugins.Crypter import Crypter class XupPl(Crypter): __name__ = "XupPl" __type__ = "crypter" - __pattern__ = r'https?://(?:[^/]*\.)?xup\.pl/.*' __version__ = "0.1" + + __pattern__ = r'https?://(?:[^/]*\.)?xup\.pl/.*' + __description__ = """Xup.pl decrypter plugin""" __author_name__ = "z00nx" __author_mail__ = "z00nx0@gmail.com" + def decrypt(self, pyfile): header = self.load(pyfile.url, just_header=True) if 'location' in header: - self.core.files.addLinks([header['location']], pyfile.package().id) + self.urls = [header['location']] else: self.fail('Unable to find link') diff --git a/module/plugins/crypter/YoutubeBatch.py b/module/plugins/crypter/YoutubeBatch.py index e6976471c..1caca16bd 100644 --- a/module/plugins/crypter/YoutubeBatch.py +++ b/module/plugins/crypter/YoutubeBatch.py @@ -1,44 +1,31 @@ # -*- 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/>. - - @author: Walter Purcaro -""" +import re from urlparse import urljoin -import re from module.common.json_layer import json_loads from module.plugins.Crypter import Crypter from module.utils import save_join -API_KEY = "AIzaSyCKnWLNlkX-L4oD1aEzqqhRw1zczeD6_k0" +API_URL = "AIzaSyCKnWLNlkX-L4oD1aEzqqhRw1zczeD6_k0" class YoutubeBatch(Crypter): __name__ = "YoutubeBatch" __type__ = "crypter" - __pattern__ = r'https?://(?:www\.)?(m\.)?youtube\.com/(?P<TYPE>user|playlist|view_play_list)(/|.*?[?&](?:list|p)=)(?P<ID>[\w-]+)' __version__ = "1.00" - __description__ = """Youtube.com channel & playlist decrypter plugin""" + + __pattern__ = r'https?://(?:www\.|m\.)?youtube\.com/(?P<TYPE>user|playlist|view_play_list)(/|.*?[?&](?:list|p)=)(?P<ID>[\w-]+)' __config__ = [("likes", "bool", "Grab user (channel) liked videos", False), ("favorites", "bool", "Grab user (channel) favorite videos", False), ("uploads", "bool", "Grab channel unplaylisted videos", True)] + + __description__ = """Youtube.com channel & playlist decrypter plugin""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" + def api_response(self, ref, req): req.update({"key": API_KEY}) url = urljoin("https://www.googleapis.com/youtube/v3/", ref) @@ -47,21 +34,21 @@ class YoutubeBatch(Crypter): def getChannel(self, user): channels = self.api_response("channels", {"part": "id,snippet,contentDetails", "forUsername": user, "maxResults": "50"}) - if channels["items"]: - channel = channels["items"][0] - return {"id": channel["id"], - "title": channel["snippet"]["title"], - "relatedPlaylists": channel["contentDetails"]["relatedPlaylists"], + if channels['items']: + channel = channels['items'][0] + return {"id": channel['id'], + "title": channel['snippet']['title'], + "relatedPlaylists": channel['contentDetails']['relatedPlaylists'], "user": user} # One lone channel for user? def getPlaylist(self, p_id): playlists = self.api_response("playlists", {"part": "snippet", "id": p_id}) - if playlists["items"]: - playlist = playlists["items"][0] + if playlists['items']: + playlist = playlists['items'][0] return {"id": p_id, - "title": playlist["snippet"]["title"], - "channelId": playlist["snippet"]["channelId"], - "channelTitle": playlist["snippet"]["channelTitle"]} + "title": playlist['snippet']['title'], + "channelId": playlist['snippet']['channelId'], + "channelTitle": playlist['snippet']['channelTitle']} def _getPlaylists(self, id, token=None): req = {"part": "id", "maxResults": "50", "channelId": id} @@ -70,11 +57,11 @@ class YoutubeBatch(Crypter): playlists = self.api_response("playlists", req) - for playlist in playlists["items"]: - yield playlist["id"] + for playlist in playlists['items']: + yield playlist['id'] if "nextPageToken" in playlists: - for item in self._getPlaylists(id, playlists["nextPageToken"]): + for item in self._getPlaylists(id, playlists['nextPageToken']): yield item def getPlaylists(self, ch_id): @@ -87,20 +74,20 @@ class YoutubeBatch(Crypter): playlist = self.api_response("playlistItems", req) - for item in playlist["items"]: - yield item["contentDetails"]["videoId"] + for item in playlist['items']: + yield item['contentDetails']['videoId'] if "nextPageToken" in playlist: - for item in self._getVideosId(id, playlist["nextPageToken"]): + for item in self._getVideosId(id, playlist['nextPageToken']): yield item def getVideosId(self, p_id): return list(self._getVideosId(p_id)) def decrypt(self, pyfile): - match = re.match(self.__pattern__, pyfile.url) - m_id = match.group("ID") - m_type = match.group("TYPE") + m = re.match(self.__pattern__, pyfile.url) + m_id = m.group("ID") + m_type = m.group("TYPE") if m_type == "user": self.logDebug("Url recognized as Channel") @@ -108,18 +95,18 @@ class YoutubeBatch(Crypter): channel = self.getChannel(user) if channel: - playlists = self.getPlaylists(channel["id"]) - self.logDebug("%s playlist\s found on channel \"%s\"" % (len(playlists), channel["title"])) + playlists = self.getPlaylists(channel['id']) + self.logDebug("%s playlist\s found on channel \"%s\"" % (len(playlists), channel['title'])) - relatedplaylist = {p_name: self.getPlaylist(p_id) for p_name, p_id in channel["relatedPlaylists"].iteritems()} + relatedplaylist = {p_name: self.getPlaylist(p_id) for p_name, p_id in channel['relatedPlaylists'].iteritems()} self.logDebug("Channel's related playlists found = %s" % relatedplaylist.keys()) - relatedplaylist["uploads"]["title"] = "Unplaylisted videos" - relatedplaylist["uploads"]["checkDups"] = True #: checkDups flag + relatedplaylist['uploads']['title'] = "Unplaylisted videos" + relatedplaylist['uploads']['checkDups'] = True #: checkDups flag for p_name, p_data in relatedplaylist.iteritems(): if self.getConfig(p_name): - p_data["title"] += " of " + user + p_data['title'] += " of " + user playlists.append(p_data) else: playlists = [] @@ -133,9 +120,9 @@ class YoutubeBatch(Crypter): addedvideos = [] urlize = lambda x: "https://www.youtube.com/watch?v=" + x for p in playlists: - p_name = p["title"] - p_videos = self.getVideosId(p["id"]) - p_folder = save_join(self.config['general']['download_folder'], p["channelTitle"], p_name) + p_name = p['title'] + p_videos = self.getVideosId(p['id']) + p_folder = save_join(self.config['general']['download_folder'], p['channelTitle'], p_name) self.logDebug("%s video\s found on playlist \"%s\"" % (len(p_videos), p_name)) if not p_videos: |