diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 18:11:19 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 18:11:19 +0100 |
commit | 00e547899c7fcfd8bcfc61cd1cc5d0a8aec8cee5 (patch) | |
tree | 874064edf3723afbd30c54e14b489085e23f1ad7 /module/plugins/crypter | |
parent | module temp (diff) | |
parent | [ZippyshareCom] Update get_checksum (diff) | |
download | pyload-00e547899c7fcfd8bcfc61cd1cc5d0a8aec8cee5.tar.xz |
Merge branch 'stable' into 0.4.10
Conflicts:
module/plugins/OCR.py
module/plugins/accounts/BayfilesCom.py
module/plugins/accounts/CatShareNet.py
module/plugins/accounts/DebridItaliaCom.py
module/plugins/accounts/FourSharedCom.py
module/plugins/accounts/FshareVn.py
module/plugins/accounts/Keep2ShareCc.py
module/plugins/accounts/LomafileCom.py
module/plugins/accounts/RapiduNet.py
module/plugins/accounts/RyushareCom.py
module/plugins/accounts/ShareonlineBiz.py
module/plugins/addon/Checksum.py
module/plugins/addon/ExternalScripts.py
module/plugins/addon/ExtractArchive.py
module/plugins/addon/MergeFiles.py
module/plugins/addon/RestartSlow.py
module/plugins/addon/SkipRev.py
module/plugins/addon/UnSkipOnFail.py
module/plugins/addon/UpdateManager.py
module/plugins/addon/WindowsPhoneToastNotify.py
module/plugins/container/CCF.py
module/plugins/container/LinkList.py
module/plugins/container/RSDF.py
module/plugins/crypter/BitshareCom.py
module/plugins/crypter/CrockoCom.py
module/plugins/crypter/DataHu.py
module/plugins/crypter/DepositfilesCom.py
module/plugins/crypter/Dereferer.py
module/plugins/crypter/DevhostStFolder.py
module/plugins/crypter/DlProtectCom.py
module/plugins/crypter/DontKnowMe.py
module/plugins/crypter/EasybytezCom.py
module/plugins/crypter/FilecloudIo.py
module/plugins/crypter/FilecryptCc.py
module/plugins/crypter/FilefactoryCom.py
module/plugins/crypter/FilerNet.py
module/plugins/crypter/FilestubeCom.py
module/plugins/crypter/FiletramCom.py
module/plugins/crypter/FreakhareCom.py
module/plugins/crypter/FreetexthostCom.py
module/plugins/crypter/FshareVn.py
module/plugins/crypter/ImgurComAlbum.py
module/plugins/crypter/JunocloudMe.py
module/plugins/crypter/LinkSaveIn.py
module/plugins/crypter/MegaRapidCz.py
module/plugins/crypter/MultiUpOrg.py
module/plugins/crypter/NetfolderIn.py
module/plugins/crypter/NosvideoCom.py
module/plugins/crypter/OneKhDe.py
module/plugins/crypter/PastebinCom.py
module/plugins/crypter/RapidfileshareNet.py
module/plugins/crypter/RelinkUs.py
module/plugins/crypter/TnyCz.py
module/plugins/crypter/TurbobitNet.py
module/plugins/crypter/TusfilesNet.py
module/plugins/crypter/UploadableCh.py
module/plugins/crypter/UploadedTo.py
module/plugins/crypter/XFileSharingPro.py
module/plugins/hooks/AlldebridCom.py
module/plugins/hooks/BypassCaptcha.py
module/plugins/hooks/Captcha9Kw.py
module/plugins/hooks/CaptchaBrotherhood.py
module/plugins/hooks/ClickAndLoad.py
module/plugins/hooks/DeathByCaptcha.py
module/plugins/hooks/DebridItaliaCom.py
module/plugins/hooks/EasybytezCom.py
module/plugins/hooks/ExpertDecoders.py
module/plugins/hooks/FastixRu.py
module/plugins/hooks/FreeWayMe.py
module/plugins/hooks/ImageTyperz.py
module/plugins/hooks/LinkdecrypterCom.py
module/plugins/hooks/LinksnappyCom.py
module/plugins/hooks/MegaDebridEu.py
module/plugins/hooks/MultishareCz.py
module/plugins/hooks/MyfastfileCom.py
module/plugins/hooks/OverLoadMe.py
module/plugins/hooks/PremiumTo.py
module/plugins/hooks/PremiumizeMe.py
module/plugins/hooks/RPNetBiz.py
module/plugins/hooks/RealdebridCom.py
module/plugins/hooks/RehostTo.py
module/plugins/hooks/SimplyPremiumCom.py
module/plugins/hooks/SimplydebridCom.py
module/plugins/hooks/UnrestrictLi.py
module/plugins/hooks/XFileSharingPro.py
module/plugins/hooks/ZeveraCom.py
module/plugins/hoster/AlldebridCom.py
module/plugins/hoster/BayfilesCom.py
module/plugins/hoster/DebridItaliaCom.py
module/plugins/hoster/DepositfilesCom.py
module/plugins/hoster/DodanePl.py
module/plugins/hoster/ExtabitCom.py
module/plugins/hoster/FastixRu.py
module/plugins/hoster/FastshareCz.py
module/plugins/hoster/FileParadoxIn.py
module/plugins/hoster/FileSharkPl.py
module/plugins/hoster/FilerNet.py
module/plugins/hoster/FileserveCom.py
module/plugins/hoster/FreakshareCom.py
module/plugins/hoster/FreeWayMe.py
module/plugins/hoster/GigapetaCom.py
module/plugins/hoster/IfileIt.py
module/plugins/hoster/Keep2ShareCc.py
module/plugins/hoster/LetitbitNet.py
module/plugins/hoster/LinksnappyCom.py
module/plugins/hoster/LomafileCom.py
module/plugins/hoster/MegaCoNz.py
module/plugins/hoster/MegaDebridEu.py
module/plugins/hoster/MegaRapidCz.py
module/plugins/hoster/MyfastfileCom.py
module/plugins/hoster/OverLoadMe.py
module/plugins/hoster/PremiumTo.py
module/plugins/hoster/PremiumizeMe.py
module/plugins/hoster/RPNetBiz.py
module/plugins/hoster/RapidgatorNet.py
module/plugins/hoster/RealdebridCom.py
module/plugins/hoster/RehostTo.py
module/plugins/hoster/RyushareCom.py
module/plugins/hoster/SendmywayCom.py
module/plugins/hoster/ShareonlineBiz.py
module/plugins/hoster/SimplyPremiumCom.py
module/plugins/hoster/SimplydebridCom.py
module/plugins/hoster/TusfilesNet.py
module/plugins/hoster/UnibytesCom.py
module/plugins/hoster/UnrestrictLi.py
module/plugins/hoster/UploadedTo.py
module/plugins/hoster/WebshareCz.py
module/plugins/hoster/XFileSharingPro.py
module/plugins/hoster/YoutubeCom.py
module/plugins/hoster/ZeveraCom.py
module/plugins/hoster/ZippyshareCom.py
module/plugins/internal/AbstractExtractor.py
module/plugins/internal/BasePlugin.py
module/plugins/internal/CaptchaService.py
module/plugins/internal/DeadCrypter.py
module/plugins/internal/DeadHoster.py
module/plugins/internal/MultiHoster.py
module/plugins/internal/SimpleCrypter.py
module/plugins/internal/SimpleHoster.py
module/plugins/internal/UnRar.py
module/plugins/internal/UnZip.py
module/plugins/internal/XFSCrypter.py
module/plugins/internal/XFSHoster.py
Diffstat (limited to 'module/plugins/crypter')
58 files changed, 396 insertions, 538 deletions
diff --git a/module/plugins/crypter/BitshareCom.py b/module/plugins/crypter/BitshareCom.py index 524307127..2960243fc 100644 --- a/module/plugins/crypter/BitshareCom.py +++ b/module/plugins/crypter/BitshareCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter class BitshareCom(SimpleCrypter): @@ -19,3 +19,6 @@ class BitshareCom(SimpleCrypter): LINK_PATTERN = r'<a href="(http://bitshare\.com/files/.+)">.+</a></td>' NAME_PATTERN = r'View public folder "(?P<N>.+)"</h1>' + + +getInfo = create_getInfo(BitshareComFolder) diff --git a/module/plugins/crypter/C1NeonCom.py b/module/plugins/crypter/C1NeonCom.py index a7973b041..eaccb471f 100644 --- a/module/plugins/crypter/C1NeonCom.py +++ b/module/plugins/crypter/C1NeonCom.py @@ -3,12 +3,12 @@ from pyload.plugin.internal.DeadCrypter import DeadCrypter, create_getInfo -class C1neonCom(DeadCrypter): - __name__ = "C1neonCom" +class C1NeonCom(DeadCrypter): + __name__ = "C1NeonCom" __type__ = "crypter" __version__ = "0.05" - __pattern__ = r'http://(?:www\.)?c1neon\.com/.*?' + __pattern__ = r'http://(?:www\.)?c1neon\.com/.+' __config__ = [] __description__ = """C1neon.com decrypter plugin""" @@ -16,4 +16,4 @@ class C1neonCom(DeadCrypter): __authors__ = [("godofdream", "soilfiction@gmail.com")] -getInfo = create_getInfo(C1neonCom) +getInfo = create_getInfo(C1NeonCom) diff --git a/module/plugins/crypter/ChipDe.py b/module/plugins/crypter/ChipDe.py index 3e00a7f66..2f47236e8 100644 --- a/module/plugins/crypter/ChipDe.py +++ b/module/plugins/crypter/ChipDe.py @@ -9,7 +9,7 @@ class ChipDe(Crypter): __type__ = "crypter" __version__ = "0.10" - __pattern__ = r'http://(?:www\.)?chip\.de/video/.*\.html' + __pattern__ = r'http://(?:www\.)?chip\.de/video/.+\.html' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] diff --git a/module/plugins/crypter/CloudzillaToFolder.py b/module/plugins/crypter/CloudzillaToFolder.py new file mode 100644 index 000000000..76019d928 --- /dev/null +++ b/module/plugins/crypter/CloudzillaToFolder.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- + +import re + +from urlparse import urljoin + +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo + + +class CloudzillaToFolder(SimpleHoster): + __name__ = "CloudzillaToFolder" + __type__ = "crypter" + __version__ = "0.02" + + __pattern__ = r'http://(?:www\.)?cloudzilla\.to/share/folder/(?P<ID>[\w^_]+)' + + __description__ = """Cloudzilla.to folder decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + INFO_PATTERN = r'<span class="name" title="(?P<N>.+?)"' + OFFLINE_PATTERN = r'>File not found...<' + + LINK_PATTERN = r'<a href="(.+?)" class="item_href">' + + PASSWORD_PATTERN = r'<div id="pwd_protected">' + + + def checkErrors(self): + m = re.search(self.PASSWORD_PATTERN, self.html) + if m: + self.html = self.load(self.pyfile.url, get={'key': self.getPassword()}) + + if re.search(self.PASSWORD_PATTERN, self.html): + self.retry(reason="Wrong password") + + +getInfo = create_getInfo(CloudzillaToFolder) diff --git a/module/plugins/crypter/CrockoCom.py b/module/plugins/crypter/CrockoCom.py index 577433510..9fad661d2 100644 --- a/module/plugins/crypter/CrockoCom.py +++ b/module/plugins/crypter/CrockoCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter class CrockoCom(SimpleCrypter): @@ -8,7 +8,7 @@ class CrockoCom(SimpleCrypter): __type__ = "crypter" __version__ = "0.01" - __pattern__ = r'http://(?:www\.)?crocko\.com/f/.*' + __pattern__ = r'http://(?:www\.)?crocko\.com/f/.+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] @@ -18,3 +18,6 @@ class CrockoCom(SimpleCrypter): LINK_PATTERN = r'<td class="last"><a href="([^"]+)">download</a>' + + +getInfo = create_getInfo(CrockoComFolder) diff --git a/module/plugins/crypter/CzshareCom.py b/module/plugins/crypter/CzshareCom.py index 71847ab48..e527d683f 100644 --- a/module/plugins/crypter/CzshareCom.py +++ b/module/plugins/crypter/CzshareCom.py @@ -9,7 +9,7 @@ class CzshareCom(Crypter): __type__ = "crypter" __version__ = "0.20" - __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' + __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] diff --git a/module/plugins/crypter/DailymotionBatch.py b/module/plugins/crypter/DailymotionBatch.py index a056c73a4..c66c7c829 100644 --- a/module/plugins/crypter/DailymotionBatch.py +++ b/module/plugins/crypter/DailymotionBatch.py @@ -24,9 +24,9 @@ class DailymotionBatch(Crypter): def api_response(self, ref, req=None): - url = urljoin("https://api.dailymotion.com/", ref) - page = self.load(url, get=req) - return json_loads(page) + url = urljoin("https://api.dailymotion.com/", ref) + html = self.load(url, get=req) + return json_loads(html) def getPlaylistInfo(self, id): @@ -84,8 +84,8 @@ class DailymotionBatch(Crypter): def decrypt(self, pyfile): m = re.match(self.__pattern__, pyfile.url) - m_id = m.group("ID") - m_type = m.group("TYPE") + m_id = m.group('ID') + m_type = m.group('TYPE') if m_type == "playlist": self.logDebug("Url recognized as Playlist") diff --git a/module/plugins/crypter/DataHu.py b/module/plugins/crypter/DataHu.py index f69d6ee3e..e8b3acbb7 100644 --- a/module/plugins/crypter/DataHu.py +++ b/module/plugins/crypter/DataHu.py @@ -2,7 +2,7 @@ import re -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter class DataHu(SimpleCrypter): @@ -38,3 +38,6 @@ class DataHu(SimpleCrypter): if u'Hib\xe1s jelsz\xf3' in self.html: # Wrong password self.fail(_("Wrong password")) + + +getInfo = create_getInfo(DataHuFolder) diff --git a/module/plugins/crypter/DepositfilesCom.py b/module/plugins/crypter/DepositfilesCom.py index 24fa9134a..ba578a4ed 100644 --- a/module/plugins/crypter/DepositfilesCom.py +++ b/module/plugins/crypter/DepositfilesCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter class DepositfilesCom(SimpleCrypter): @@ -18,3 +18,6 @@ class DepositfilesCom(SimpleCrypter): LINK_PATTERN = r'<div class="progressName"[^>]*>\s*<a href="([^"]+)" title="[^"]*" target="_blank">' + + +getInfo = create_getInfo(DepositfilesComFolder) diff --git a/module/plugins/crypter/Dereferer.py b/module/plugins/crypter/Dereferer.py index 598cba8bd..d52bb1094 100644 --- a/module/plugins/crypter/Dereferer.py +++ b/module/plugins/crypter/Dereferer.py @@ -1,26 +1,17 @@ # -*- coding: utf-8 -*- -import re +from module.plugins.Crypter import Crypter -from urllib import unquote -from pyload.plugin.Crypter import Crypter - - -class Dereferer(Crypter): +class Dereferer(SimpleDereferer): __name__ = "Dereferer" __type__ = "crypter" - __version__ = "0.10" + __version__ = "0.11" - __pattern__ = r'https?://([^/]+)/.*?(?P<url>(ht|f)tps?(://|%3A%2F%2F).*)' + __pattern__ = r'https?://([^/]+)/.*?(?P<LINK>(ht|f)tps?(://|%3A%2F%2F).+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Crypter for dereferers""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - - - def decrypt(self, pyfile): - link = re.match(self.__pattern__, pyfile.url).group('url') - self.urls = [unquote(link).rstrip('+')] diff --git a/module/plugins/crypter/DevhostStFolder.py b/module/plugins/crypter/DevhostStFolder.py index 9c81879c6..2fbc90ba8 100644 --- a/module/plugins/crypter/DevhostStFolder.py +++ b/module/plugins/crypter/DevhostStFolder.py @@ -7,13 +7,13 @@ import re from urlparse import urljoin -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter class DevhostStFolder(SimpleCrypter): __name__ = "DevhostStFolder" __type__ = "crypter" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'http://(?:www\.)?d-h\.st/users/(?P<USER>\w+)(/\?fld_id=(?P<ID>\d+))?' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -54,5 +54,4 @@ class DevhostStFolder(SimpleCrypter): return {'name': name, 'folder': folder} - def getLinks(self): - return [urljoin("http://d-h.st", link) for link in re.findall(self.LINK_PATTERN, self.html)] +getInfo = create_getInfo(DevhostStFolder) diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index 539cdc21c..1cfe7639a 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -5,15 +5,15 @@ import re from base64 import urlsafe_b64encode from time import time -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter class DlProtectCom(SimpleCrypter): __name__ = "DlProtectCom" __type__ = "crypter" - __version__ = "0.01" + __version__ = "0.03" - __pattern__ = r'http://(?:www\.)?dl-protect\.com/((en|fr)/)?(?P<ID>\w+)' + __pattern__ = r'https?://(?:www\.)?dl-protect\.com/((en|fr)/)?\w+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] @@ -22,44 +22,47 @@ class DlProtectCom(SimpleCrypter): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - OFFLINE_PATTERN = r'>Unfortunately, the link you are looking for is not found' + COOKIES = [("dl-protect.com", "l", "en")] + + OFFLINE_PATTERN = r'Unfortunately, the link you are looking for is not found' def getLinks(self): # Direct link with redirect - if not re.match(r"http://(?:www\.)?dl-protect\.com", self.req.http.lastEffectiveURL): + if not re.match(r"https?://(?:www\.)?dl-protect\.com/.+", self.req.http.lastEffectiveURL): return [self.req.http.lastEffectiveURL] - #id = re.match(self.__pattern__, self.pyfile.url).group("ID") - key = re.search(r'name="id_key" value="(.+?)"', self.html).group(1) + post_req = {'key' : re.search(r'name="key" value="(.+?)"', self.html).group(1), + 'submitform': ""} - post_req = {"id_key": key, "submitform": ""} + if "Please click on continue to see the content" in self.html: + post_req['submitform'] = "Continue" + self.wait(2) - if self.OFFLINE_PATTERN in self.html: - self.offline() - elif ">Please click on continue to see the content" in self.html: - post_req.update({"submitform": "Continue"}) else: - mstime = int(round(time() * 1000)) + mstime = int(round(time() * 1000)) b64time = "_" + urlsafe_b64encode(str(mstime)).replace("=", "%3D") - post_req.update({"i": b64time, "submitform": "Decrypt+link"}) + post_req.update({'i' : b64time, + 'submitform': "Decrypt+link"}) - if ">Password :" in self.html: + if "Password :" in self.html: 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 + 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 self.html = self.load(self.pyfile.url, post=post_req) - for errmsg in (">The password is incorrect", ">The security code is incorrect"): + for errmsg in ("The password is incorrect", "The security code is incorrect"): if errmsg in self.html: self.fail(_(errmsg[1:])) - pattern = r'<a href="([^/].+?)" target="_blank">' - return re.findall(pattern, self.html) + return re.findall(r'<a href="([^/].+?)" target="_blank">', self.html) + + +getInfo = create_getInfo(DlProtectCom) diff --git a/module/plugins/crypter/DontKnowMe.py b/module/plugins/crypter/DontKnowMe.py index c2b9649ed..7a4b85b2d 100644 --- a/module/plugins/crypter/DontKnowMe.py +++ b/module/plugins/crypter/DontKnowMe.py @@ -1,29 +1,17 @@ # -*- coding: utf-8 -*- -import re +from module.plugins.Crypter import Crypter -from urllib import unquote -from pyload.plugin.Crypter import Crypter - - -class DontKnowMe(Crypter): +class DontKnowMe(SimpleDereferer): __name__ = "DontKnowMe" __type__ = "crypter" - __version__ = "0.10" + __version__ = "0.11" - __pattern__ = r'http://(?:www\.)?dontknow\.me/at/\?.+$' + __pattern__ = r'http://(?:www\.)?dontknow\.me/at/\?(?P<LINK>.+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """DontKnow.me decrypter plugin""" __license__ = "GPLv3" __authors__ = [("selaux", "")] - - - LINK_PATTERN = r'http://dontknow\.me/at/\?(.+)$' - - - def decrypt(self, pyfile): - link = re.findall(self.LINK_PATTERN, pyfile.url)[0] - self.urls = [unquote(link)] diff --git a/module/plugins/crypter/EasybytezCom.py b/module/plugins/crypter/EasybytezCom.py index 9a4fca74a..d9685e2f1 100644 --- a/module/plugins/crypter/EasybytezCom.py +++ b/module/plugins/crypter/EasybytezCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.XFSCrypter import XFSCrypter +from module.plugins.internal.XFSCrypter import XFSCrypter class EasybytezCom(XFSCrypter): @@ -17,6 +17,7 @@ class EasybytezCom(XFSCrypter): __authors__ = [("stickell", "l.stickell@yahoo.it")] - HOSTER_DOMAIN = "easybytez.com" - LOGIN_ACCOUNT = True + + +getInfo = create_getInfo(EasybytezComFolder) diff --git a/module/plugins/crypter/EmbeduploadCom.py b/module/plugins/crypter/EmbeduploadCom.py index 3265a939e..c94e7e106 100644 --- a/module/plugins/crypter/EmbeduploadCom.py +++ b/module/plugins/crypter/EmbeduploadCom.py @@ -10,7 +10,7 @@ class EmbeduploadCom(Crypter): __type__ = "crypter" __version__ = "0.02" - __pattern__ = r'http://(?:www\.)?embedupload\.com/\?d=.*' + __pattern__ = r'http://(?:www\.)?embedupload\.com/\?d=.+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True), ("preferedHoster", "str", "Prefered hoster list (bar-separated)", "embedupload"), @@ -35,7 +35,7 @@ class EmbeduploadCom(Crypter): self.logDebug("PF: %s" % prefered_set) - tmp_links.extend([x[1] for x in m if x[0] in prefered_set]) + tmp_links.extend(x[1] for x in m if x[0] in prefered_set) self.urls = self.getLocation(tmp_links) if not self.urls: @@ -44,7 +44,7 @@ class EmbeduploadCom(Crypter): self.logDebug("IG: %s" % ignored_set) - tmp_links.extend([x[1] for x in m if x[0] not in ignored_set]) + tmp_links.extend(x[1] for x in m if x[0] not in ignored_set) self.urls = self.getLocation(tmp_links) diff --git a/module/plugins/crypter/FilebeerInfo.py b/module/plugins/crypter/FilebeerInfo.py index a6faa5cab..4e8ab1259 100644 --- a/module/plugins/crypter/FilebeerInfo.py +++ b/module/plugins/crypter/FilebeerInfo.py @@ -8,7 +8,7 @@ class FilebeerInfo(DeadCrypter): __type__ = "crypter" __version__ = "0.02" - __pattern__ = r'http://(?:www\.)?filebeer\.info/(\d+~f).*' + __pattern__ = r'http://(?:www\.)?filebeer\.info/\d*~f\w+' __config__ = [] __description__ = """Filebeer.info folder decrypter plugin""" diff --git a/module/plugins/crypter/FilecloudIo.py b/module/plugins/crypter/FilecloudIo.py index f4c967a07..d0ca619de 100644 --- a/module/plugins/crypter/FilecloudIo.py +++ b/module/plugins/crypter/FilecloudIo.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter class FilecloudIo(SimpleCrypter): @@ -19,3 +19,6 @@ class FilecloudIo(SimpleCrypter): LINK_PATTERN = r'href="(http://filecloud\.io/\w+)" title' NAME_PATTERN = r'>(?P<N>.+?) - filecloud\.io<' + + +getInfo = create_getInfo(FilecloudIoFolder) diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index 475c1503f..938ceafa9 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -1,18 +1,22 @@ # -*- coding: utf-8 -*- +# +# Test links: +# http://filecrypt.cc/Container/64E039F859.html -import base64 import binascii import re from Crypto.Cipher import AES +from urlparse import urljoin from pyload.plugin.Crypter import Crypter +from module.plugins.internal.CaptchaService import ReCaptcha class FilecryptCc(Crypter): __name__ = "FilecryptCc" __type__ = "crypter" - __version__ = "0.05" + __version__ = "0.11" __pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\w+' @@ -24,9 +28,10 @@ class FilecryptCc(Crypter): # URL_REPLACEMENTS = [(r'.html$', ""), (r'$', ".html")] #@TODO: Extend SimpleCrypter DLC_LINK_PATTERN = r'<button class="dlcdownload" type="button" title="Download \*.dlc" onclick="DownloadDLC\(\'(.+)\'\);"><i></i><span>dlc<' - WEBLINK_PATTERN = r"openLink.?'([\w_-]*)'," + WEBLINK_PATTERN = r"openLink.?'([\w_-]*)'," - CAPTCHA_PATTERN = r'<img id="nc" src="(.+?)"' + CAPTCHA_PATTERN = r'<img id="nc" src="(.+?)"' + CIRCLE_CAPTCHA_PATTERN = r'<input type="image" src="(.+?)"' MIRROR_PAGE_PATTERN = r'"[\w]*" href="(http://filecrypt.cc/Container/\w+\.html\?mirror=\d+)">' @@ -38,7 +43,7 @@ class FilecryptCc(Crypter): def decrypt(self, pyfile): self.html = self.load(pyfile.url, cookies=True) - if "content not found" in self.html: + if "content notfound" in self.html: #@NOTE: "content notfound" is NOT a typo self.offline() self.handlePasswordProtection() @@ -70,24 +75,56 @@ class FilecryptCc(Crypter): self.logInfo(_("Folder is password protected")) - if not self.pyfile.package().password: + password = self.getPassword() + + if not password: self.fail(_("Please enter the password in package section and try again")) - self.html = self.load(self.pyfile.url, post={"password": self.password}, cookies=True) + self.html = self.load(self.pyfile.url, post={"password": password}, cookies=True) def handleCaptcha(self): - m = re.search(self.CAPTCHA_PATTERN, self.html) + m = re.search(self.CAPTCHA_PATTERN, self.html) + m2 = re.search(self.CIRCLE_CAPTCHA_PATTERN, self.html) - if m: + if m: #: normal captcha self.logDebug("Captcha-URL: %s" % m.group(1)) - captcha_code = self.decryptCaptcha("http://filecrypt.cc" + m.group(1), forceUser=True, imgtype="gif") - self.siteWithLinks = self.load(self.pyfile.url, post={"recaptcha_response_field":captcha_code}, decode=True, cookies=True) - else: - self.logDebug("No captcha found") - self.siteWithLinks = self.html - if "recaptcha_response_field" in self.siteWithLinks: + captcha_code = self.decryptCaptcha(urljoin("http://filecrypt.cc", m.group(1)), + forceUser=True, + imgtype="gif") + + self.siteWithLinks = self.load(self.pyfile.url, + post={'recaptcha_response_field': captcha_code}, + cookies=True, + decode=True) + elif m2: #: circle captcha + self.logDebug("Captcha-URL: %s" % m2.group(1)) + + captcha_code = self.decryptCaptcha(urljoin("http://filecrypt.cc", m2.group(1)), + forceUser=True, + imgtype="gif", + result_type='positional') + + self.siteWithLinks = self.load(self.pyfile.url, + post={'button.x': captcha_code[0], 'button.y': captcha_code[1]}, + cookies=True, + decode=True) + + else: + recaptcha = ReCaptcha(self) + captcha_key = recaptcha.detect_key() + + if captcha_key: + response, challenge = recaptcha.challenge(captcha_key) + self.siteWithLinks = self.load(self.pyfile.url, + post={'g-recaptcha-response': response}, + decode=True) + else: + self.logInfo(_("No captcha found")) + self.siteWithLinks = self.html + + if "recaptcha_image" in self.siteWithLinks or "data-sitekey" in self.siteWithLinks: self.invalidCaptcha() self.retry() @@ -132,17 +169,14 @@ class FilecryptCc(Crypter): # Get key key = binascii.unhexlify(str(jk)) - # Decode crypted - crypted = base64.standard_b64decode(crypted) - # Decrypt Key = key IV = key obj = AES.new(Key, AES.MODE_CBC, IV) - text = obj.decrypt(crypted) + text = obj.decrypt(crypted.decode('base64')) # Extract links - links = filter(lambda x: x != "", - text.replace("\x00", "").replace("\r", "").split("\n")) + text = text.replace("\x00", "").replace("\r", "") + links = filter(bool, text.split('\n')) return links diff --git a/module/plugins/crypter/FilefactoryCom.py b/module/plugins/crypter/FilefactoryCom.py index bdfeec46f..c6bdb81eb 100644 --- a/module/plugins/crypter/FilefactoryCom.py +++ b/module/plugins/crypter/FilefactoryCom.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter class FilefactoryCom(SimpleCrypter): __name__ = "FilefactoryCom" __type__ = "crypter" - __version__ = "0.31" + __version__ = "0.32" __pattern__ = r'https?://(?:www\.)?filefactory\.com/(?:f|folder)/\w+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -17,12 +17,15 @@ class FilefactoryCom(SimpleCrypter): __authors__ = [("stickell", "l.stickell@yahoo.it")] - LINK_PATTERN = r'<td><a href="([^"]+)">' - NAME_PATTERN = r'<h1>Files in <span>(?P<N>.+)</span></h1>' - PAGES_PATTERN = r'data-paginator-totalPages="(\d+)"' - COOKIES = [("filefactory.com", "locale", "en_US.utf8")] + LINK_PATTERN = r'<td>\s*<a href="(.+?)"' + NAME_PATTERN = r'<h1>Files in <span>(?P<N>.+?)<' + PAGES_PATTERN = r'data-paginator-totalPages="(\d+)' + def loadPage(self, page_n): - return self.load(self.pyfile.url, get={'page': page_n}) + return self.load(self.pyfile.url, get={'page': page_n, 'show': 100}) + + +getInfo = create_getInfo(FilefactoryComFolder) diff --git a/module/plugins/crypter/FilerNet.py b/module/plugins/crypter/FilerNet.py index 069698bf1..054c8d3a7 100644 --- a/module/plugins/crypter/FilerNet.py +++ b/module/plugins/crypter/FilerNet.py @@ -1,12 +1,12 @@ import re -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter class FilerNet(SimpleCrypter): __name__ = "FilerNet" __type__ = "crypter" - __version__ = "0.41" + __version__ = "0.42" __pattern__ = r'https?://filer\.net/folder/\w{16}' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -19,8 +19,9 @@ class FilerNet(SimpleCrypter): LINK_PATTERN = r'href="(/get/\w{16})">(?!<)' - NAME_PATTERN = r'<h3>(?P<N>.+?) - <small' + NAME_PATTERN = r'<h3>(?P<N>.+?) - <small' + OFFLINE_PATTERN = r'Nicht gefunden' - def getLinks(self): - return ['http://filer.net%s' % link for link in re.findall(self.LINK_PATTERN, self.html)] + +getInfo = create_getInfo(FilerNetFolder) diff --git a/module/plugins/crypter/FilestubeCom.py b/module/plugins/crypter/FilestubeCom.py index 36e4a4caf..befe6f9a7 100644 --- a/module/plugins/crypter/FilestubeCom.py +++ b/module/plugins/crypter/FilestubeCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter class FilestubeCom(SimpleCrypter): @@ -19,3 +19,6 @@ class FilestubeCom(SimpleCrypter): LINK_PATTERN = r'<a class=\"file-link-main(?: noref)?\" [^>]* href=\"(http://[^\"]+)' NAME_PATTERN = r'<h1\s*> (?P<N>.+) download\s*</h1>' + + +getInfo = create_getInfo(FilestubeCom) diff --git a/module/plugins/crypter/FiletramCom.py b/module/plugins/crypter/FiletramCom.py index 700050a4b..6c3c071ec 100644 --- a/module/plugins/crypter/FiletramCom.py +++ b/module/plugins/crypter/FiletramCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter class FiletramCom(SimpleCrypter): @@ -20,3 +20,6 @@ class FiletramCom(SimpleCrypter): LINK_PATTERN = r'\s+(http://.+)' NAME_PATTERN = r'<title>(?P<N>.+?) - Free Download' + + +getInfo = create_getInfo(FiletramCom) diff --git a/module/plugins/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py index e5f6cc0cf..62fb9d3fe 100644 --- a/module/plugins/crypter/FourChanOrg.py +++ b/module/plugins/crypter/FourChanOrg.py @@ -10,7 +10,7 @@ from pyload.plugin.Crypter import Crypter class FourChanOrg(Crypter): __name__ = "FourChanOrg" __type__ = "crypter" - __version__ = "0.30" + __version__ = "0.31" __pattern__ = r'http://(?:www\.)?boards\.4chan\.org/\w+/res/(\d+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/FreakhareCom.py b/module/plugins/crypter/FreakhareCom.py index cb766361c..c5fd2ee29 100644 --- a/module/plugins/crypter/FreakhareCom.py +++ b/module/plugins/crypter/FreakhareCom.py @@ -36,3 +36,6 @@ class FreakhareCom(SimpleCrypter): 'entrys': '20', 'page': page_n - 1, 'order': ''}, decode=True) + + +getInfo = create_getInfo(FreakhareComFolder) diff --git a/module/plugins/crypter/FreetexthostCom.py b/module/plugins/crypter/FreetexthostCom.py index 3b082ef7d..4634455b6 100644 --- a/module/plugins/crypter/FreetexthostCom.py +++ b/module/plugins/crypter/FreetexthostCom.py @@ -25,3 +25,6 @@ class FreetexthostCom(SimpleCrypter): self.error(_("Unable to extract links")) links = m.group(1) return links.strip().split("<br />\r\n") + + +getInfo = create_getInfo(FreetexthostCom) diff --git a/module/plugins/crypter/FshareVn.py b/module/plugins/crypter/FshareVn.py index 9b552a957..e85085cf1 100644 --- a/module/plugins/crypter/FshareVn.py +++ b/module/plugins/crypter/FshareVn.py @@ -8,7 +8,7 @@ class FshareVn(SimpleCrypter): __type__ = "crypter" __version__ = "0.01" - __pattern__ = r'http://(?:www\.)?fshare\.vn/folder/.*' + __pattern__ = r'http://(?:www\.)?fshare\.vn/folder/.+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] @@ -18,3 +18,6 @@ class FshareVn(SimpleCrypter): LINK_PATTERN = r'<li class="w_80pc"><a href="([^"]+)" target="_blank">' + + +getInfo = create_getInfo(FshareVnFolder) diff --git a/module/plugins/crypter/ImgurComAlbum.py b/module/plugins/crypter/ImgurComAlbum.py index d2ca38d40..6c074f5f1 100644 --- a/module/plugins/crypter/ImgurComAlbum.py +++ b/module/plugins/crypter/ImgurComAlbum.py @@ -1,7 +1,7 @@ import re -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter -from pyload.utils import uniqify +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo +from module.utils import uniqify class ImgurComAlbum(SimpleCrypter): @@ -25,3 +25,6 @@ class ImgurComAlbum(SimpleCrypter): 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))) + + +getInfo = create_getInfo(ImgurComAlbum) diff --git a/module/plugins/crypter/JunocloudMe.py b/module/plugins/crypter/JunocloudMe.py deleted file mode 100644 index 97b3c7e39..000000000 --- a/module/plugins/crypter/JunocloudMe.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.plugin.internal.XFSCrypter import XFSCrypter - - -class JunocloudMe(XFSCrypter): - __name__ = "JunocloudMe" - __type__ = "crypter" - __version__ = "0.03" - - __pattern__ = r'http://(?:www\.)?junocloud\.me/folders/(?P<ID>\d+/\w+)' - __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), - ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] - - __description__ = """Junocloud.me folder decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("guidobelix", "guidobelix@hotmail.it")] - - - HOSTER_DOMAIN = "junocloud.me" diff --git a/module/plugins/crypter/LinkCryptWs.py b/module/plugins/crypter/LinkCryptWs.py index 1173d84cd..a3eb4f179 100644 --- a/module/plugins/crypter/LinkCryptWs.py +++ b/module/plugins/crypter/LinkCryptWs.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -import base64 import binascii import re @@ -15,7 +14,7 @@ from pyload.utils import html_unescape class LinkCryptWs(Crypter): __name__ = "LinkCryptWs" __type__ = "crypter" - __version__ = "0.07" + __version__ = "0.08" __pattern__ = r'http://(?:www\.)?linkcrypt\.ws/(dir|container)/(?P<ID>\w+)' @@ -57,7 +56,7 @@ class LinkCryptWs(Crypter): self.offline() if self.isKeyCaptchaProtected(): - self.retry(4, 30, _("Can't handle Key-Captcha")) + self.retry(8, 15, _("Can't handle Key-Captcha")) if self.isCaptchaProtected(): self.captcha = True @@ -115,7 +114,7 @@ class LinkCryptWs(Crypter): def isKeyCaptchaProtected(self): - if re.search(r'Key[ -]', self.html, re.I): + if re.search(r'>If the folder does not open after klick on <', self.html, re.I): return True else: return False @@ -307,19 +306,15 @@ class LinkCryptWs(Crypter): self.logDebug("JsEngine returns value [%s]" % jreturn) - # Decode crypted - crypted = base64.standard_b64decode(crypted) - # Decrypt Key = key IV = key obj = AES.new(Key, AES.MODE_CBC, IV) - text = obj.decrypt(crypted) + text = obj.decrypt(crypted.decode('base64')) # Extract links text = text.replace("\x00", "").replace("\r", "") - links = text.split("\n") - links = filter(lambda x: x != "", links) + links = filter(bool, text.split('\n')) # Log and return self.logDebug("Package has %d links" % len(links)) diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 9b4af05f2..e96d0438e 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -1,246 +1,22 @@ # -*- coding: utf-8 -*- -# -# * 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 -import re +from module.plugins.internal.SimpleDereferer import SimpleDereferer -from Crypto.Cipher import AES -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter -from pyload.utils import html_unescape - - -class LinkSaveIn(SimpleCrypter): +class LinkSaveIn(SimpleDereferer): __name__ = "LinkSaveIn" __type__ = "crypter" - __version__ = "2.02" + __version__ = "2.03" - __pattern__ = r'http://(?:www\.)?linksave\.in/(?P<id>\w+)$' + __pattern__ = r'https?://(?:www\.)?linksave\.in/\w+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """LinkSave.in decrypter plugin""" __license__ = "GPLv3" - __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es")] + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] COOKIES = [("linksave.in", "Linksave_Language", "english")] - # Constants - _JK_KEY_ = "jk" - _CRYPTED_KEY_ = "crypted" - - - def setup(self): - self.fileid = None - self.captcha = False - self.package = None - 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') - - # Request package - self.html = self.load(pyfile.url) - if not self.isOnline(): - self.offline() - - # Check for protection - if self.isPasswordProtected(): - self.unlockPasswordProtection() - self.handleErrors() - - if self.isCaptchaProtected(): - self.captcha = True - self.unlockCaptchaProtection() - self.handleErrors() - - # Get package name and folder - (package_name, folder_name) = self.getPackageInfo() - - # Extract package links - package_links = [] - for type_ in self.preferred_sources: - package_links.extend(self.handleLinkSource(type_)) - if package_links: # use only first source which provides links - break - package_links = set(package_links) - - # Pack - if package_links: - self.packages = [(package_name, package_links, folder_name)] - - - def isOnline(self): - if "<big>Error 404 - Folder not found!</big>" in self.html: - self.logDebug("File not found") - return False - return True - - - def isPasswordProtected(self): - if re.search(r'''<input.*?type="password"''', self.html): - self.logDebug("Links are password protected") - return True - - - def isCaptchaProtected(self): - if "<b>Captcha:</b>" in self.html: - self.logDebug("Links are captcha protected") - return True - return False - - - def unlockPasswordProtection(self): - password = self.getPassword() - self.logDebug("Submitting password [%s] for protected links" % password) - post = {"id": self.fileid, "besucherpasswort": password, 'login': 'submit'} - self.html = self.load(self.pyfile.url, post=post) - - - def unlockCaptchaProtection(self): - captcha_hash = re.search(r'name="hash" value="([^"]+)', self.html).group(1) - captcha_url = re.search(r'src=".(/captcha/cap.php\?hsh=[^"]+)', self.html).group(1) - captcha_code = self.decryptCaptcha("http://linksave.in" + captcha_url, forceUser=True) - self.html = self.load(self.pyfile.url, post={"id": self.fileid, "hash": captcha_hash, "code": captcha_code}) - - - def getPackageInfo(self): - name = self.pyfile.package().name - folder = self.pyfile.package().folder - self.logDebug("Defaulting to pyfile name [%s] and folder [%s] for package" % (name, folder)) - return name, folder - - - def handleErrors(self): - if "The visitorpassword you have entered is wrong" in self.html: - self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") - self.fail(_("Incorrect password, please set right password on 'Edit package' form and retry")) - - if self.captcha: - if "Wrong code. Please retry" in self.html: - self.invalidCaptcha() - self.retry() - else: - self.correctCaptcha() - - - def handleLinkSource(self, type_): - if type_ == "cnl2": - return self.handleCNL2() - elif type_ in ("rsdf", "ccf", "dlc"): - return self.handleContainer(type_) - elif type_ == "web": - return self.handleWebLinks() - else: - self.error('Unknown source type "%s" (this is probably a bug)' % type_) - - - def handleWebLinks(self): - package_links = [] - self.logDebug("Search for Web links") - if not self.js: - self.logDebug("No JS -> skip Web links") - else: - #@TODO: Gather paginated web links - pattern = r'<a href="http://linksave\.in/(\w{43})"' - ids = re.findall(pattern, self.html) - self.logDebug("Decrypting %d Web links" % len(ids)) - for i, weblink_id in enumerate(ids): - try: - webLink = "http://linksave.in/%s" % weblink_id - - self.logDebug("Decrypting Web link %d, %s" % (i + 1, webLink)) - - fwLink = "http://linksave.in/fw-%s" % weblink_id - res = self.load(fwLink) - - jscode = re.findall(r'<script type="text/javascript">(.*)</script>', res)[-1] - jseval = self.js.eval("document = { write: function(e) { return e; } }; %s" % jscode) - dlLink = re.search(r'http://linksave\.in/dl-\w+', jseval).group(0) - self.logDebug("JsEngine returns value [%s] for redirection link" % dlLink) - - res = self.load(dlLink) - link = html_unescape(re.search(r'<iframe src="(.+?)"', res).group(1)) - - package_links.append(link) - - except Exception, detail: - self.logDebug("Error decrypting Web link %s, %s" % (webLink, detail)) - - return package_links - - - def handleContainer(self, type_): - package_links = [] - type_ = type_.lower() - self.logDebug("Seach for %s Container links" % type_.upper()) - if not type_.isalnum(): # check to prevent broken re-pattern (cnl2,rsdf,ccf,dlc,web are all alpha-numeric) - self.error('Unknown container type "%s" (this is probably a bug)' % type_) - pattern = r'\(\'%s_link\'\).href=unescape\(\'(.*?\.%s)\'\)' % (type_, type_) - containersLinks = re.findall(pattern, self.html) - self.logDebug("Found %d %s Container links" % (len(containersLinks), type_.upper())) - for containerLink in containersLinks: - link = "http://linksave.in/%s" % html_unescape(containerLink) - package_links.append(link) - return package_links - - - def handleCNL2(self): - package_links = [] - self.logDebug("Search for CNL2 links") - if not self.js: - self.logDebug("No JS -> skip CNL2 links") - elif 'cnl2_load' in self.html: - try: - (vcrypted, vjk) = self._getCipherParams() - for (crypted, jk) in zip(vcrypted, vjk): - package_links.extend(self._getLinks(crypted, jk)) - except Exception: - self.fail(_("Unable to decrypt CNL2 links")) - 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) - - # Get crypted - crypted_re = r'<INPUT.*?NAME="%s".*?VALUE="(.*?)"' % LinkSaveIn._CRYPTED_KEY_ - vcrypted = re.findall(crypted_re, self.html) - - # Log and return - self.logDebug("Detected %d crypted blocks" % len(vcrypted)) - return vcrypted, vjk - - - def _getLinks(self, crypted, jk): - # Get key - jreturn = self.js.eval("%s f()" % jk) - self.logDebug("JsEngine returns value [%s]" % jreturn) - key = binascii.unhexlify(jreturn) - - # Decode crypted - crypted = base64.standard_b64decode(crypted) - - # Decrypt - Key = key - IV = key - obj = AES.new(Key, AES.MODE_CBC, IV) - text = obj.decrypt(crypted) - - # Extract links - text = text.replace("\x00", "").replace("\r", "") - links = text.split("\n") - links = filter(lambda x: x != "", links) - - # Log and return - self.logDebug("Package has %d links" % len(links)) - return links + OFFLINE_PATTERN = r'>(Error )?404 -' diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py index ab9bdbdc7..facec37d5 100644 --- a/module/plugins/crypter/LinkdecrypterCom.py +++ b/module/plugins/crypter/LinkdecrypterCom.py @@ -7,13 +7,13 @@ from pyload.plugin.Crypter import Crypter class LinkdecrypterCom(Crypter): __name__ = "LinkdecrypterCom" __type__ = "crypter" - __version__ = "0.27" + __version__ = "0.29" __pattern__ = r'^unmatchable$' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] - __description__ = """Linkdecrypter.com""" + __description__ = """Linkdecrypter.com decrypter plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), ("flowlee", "")] @@ -21,46 +21,25 @@ class LinkdecrypterCom(Crypter): TEXTAREA_PATTERN = r'<textarea name="links" wrap="off" readonly="1" class="caja_des">(.+)</textarea>' PASSWORD_PATTERN = r'<input type="text" name="password"' - CAPTCHA_PATTERN = r'<img class="captcha" src="(.+?)"(.*?)>' - REDIR_PATTERN = r'<i>(Click <a href="./">here</a> if your browser does not redirect you).</i>' + 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 - self.urls = self.decryptHTML() - - - def decryptAPI(self): - get_dict = {"t": "link", "url": self.pyfile.url, "lcache": "1"} - self.html = self.load('http://linkdecrypter.com/api', get=get_dict) - if self.html.startswith('http://'): - return self.html.splitlines() - - if self.html == 'INTERRUPTION(PASSWORD)': - for get_dict['pass'] in self.passwords: - self.html = self.load('http://linkdecrypter.com/api', get=get_dict) - if self.html.startswith('http://'): - return self.html.splitlines() + def setup(self): + self.password = self.getPassword() + self.req.setOption("timeout", 300) - self.logError("API", self.html) - if self.html == 'INTERRUPTION(PASSWORD)': - self.fail(_("No or incorrect password")) - return None - - - def decryptHTML(self): + def decrypt(self, pyfile): retries = 5 - post_dict = {"link_cache": "on", "pro_links": self.pyfile.url, "modo_links": "text"} + post_dict = {"link_cache": "on", "pro_links": pyfile.url, "modo_links": "text"} self.html = self.load('http://linkdecrypter.com/', post=post_dict, cookies=True, decode=True) - while self.passwords or retries: + while retries: m = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.S) if m: - return [x for x in m.group(1).splitlines() if '[LINK-ERROR]' not in x] + self.urls = [x for x in m.group(1).splitlines() if '[LINK-ERROR]' not in x] m = re.search(self.CAPTCHA_PATTERN, self.html) if m: @@ -78,15 +57,12 @@ class LinkdecrypterCom(Crypter): retries -= 1 elif self.PASSWORD_PATTERN in self.html: - if self.passwords: - password = self.passwords.pop(0) - self.logInfo(_("Password protected link, trying ") + password) - self.html = self.load('http://linkdecrypter.com/', post={'password': password}, decode=True) + if self.password: + self.logInfo(_("Password protected link")) + self.html = self.load('http://linkdecrypter.com/', post={'password': self.password}, decode=True) else: - self.fail(_("No or incorrect password")) + self.fail(_("Missing password")) else: retries -= 1 self.html = self.load('http://linkdecrypter.com/', cookies=True, decode=True) - - return None diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 0b4329d35..4b978723f 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -19,9 +19,9 @@ class LixIn(Crypter): __authors__ = [("spoob", "spoob@pyload.org")] - CAPTCHA_PATTERN = r'<img src="(?P<image>captcha_img\.php\?.*?)"' + CAPTCHA_PATTERN = r'<img src="(captcha_img\.php\?.*?)"' SUBMIT_PATTERN = r'value=\'continue.*?\'' - LINK_PATTERN = r'name="ifram" src="(?P<link>.*?)"' + LINK_PATTERN = r'name="ifram" src="(.*?)"' def decrypt(self, pyfile): @@ -31,7 +31,7 @@ class LixIn(Crypter): if m is None: self.error(_("Unable to identify file ID")) - id = m.group("ID") + id = m.group('ID') self.logDebug("File id is %s" % id) self.html = self.load(url, decode=True) @@ -46,7 +46,7 @@ class LixIn(Crypter): m = re.search(self.CAPTCHA_PATTERN, self.html) if m: self.logDebug("Trying captcha") - captcharesult = self.decryptCaptcha("http://lix.in/" + m.group("image")) + captcharesult = self.decryptCaptcha("http://lix.in/" + m.group(1)) self.html = self.load(url, decode=True, post={"capt": captcharesult, "submit": "submit", "tiny": id}) else: @@ -58,5 +58,5 @@ class LixIn(Crypter): if m is None: self.error(_("Unable to find destination url")) else: - self.urls = [m.group("link")] + self.urls = [m.group(1)] 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 05917b522..e18349877 100644 --- a/module/plugins/crypter/LofCc.py +++ b/module/plugins/crypter/LofCc.py @@ -8,7 +8,7 @@ class LofCc(DeadCrypter): __type__ = "crypter" __version__ = "0.21" - __pattern__ = r'http://(?:www\.)?lof\.cc/(.*)' + __pattern__ = r'http://(?:www\.)?lof\.cc/(.+)' __config__ = [] __description__ = """Lof.cc decrypter plugin""" diff --git a/module/plugins/crypter/MegaCoNzFolder.py b/module/plugins/crypter/MegaCoNzFolder.py new file mode 100644 index 000000000..4bef61f67 --- /dev/null +++ b/module/plugins/crypter/MegaCoNzFolder.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.Crypter import Crypter + + +class MegaCoNzFolder(Crypter): + __name__ = "MegaCoNzFolder" + __type__ = "crypter" + __version__ = "0.04" + + __pattern__ = r'(?:https?://(?:www\.)?mega\.co\.nz/|mega:|chrome:.+?)#F!(?P<ID>[\w^_]+)!(?P<KEY>[\w,\\-]+)' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] + + __description__ = """Mega.co.nz folder decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + def setup(self): + self.req.setOption("timeout", 300) + + + def decrypt(self, pyfile): + url = "https://mega.co.nz/#F!%s!%s" % re.match(self.__pattern__, pyfile.url).groups() + self.html = self.load("http://rapidgen.org/linkfinder", post={'linklisturl': url}) + self.urls = re.findall(r'(https://mega.co.nz/#N!.+?)<', self.html) + + if not self.urls: #@TODO: Remove in 0.4.10 + self.fail(_("No link grabbed")) diff --git a/module/plugins/crypter/MegaRapidCz.py b/module/plugins/crypter/MegaRapidCz.py index 79900c08a..86235444b 100644 --- a/module/plugins/crypter/MegaRapidCz.py +++ b/module/plugins/crypter/MegaRapidCz.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class MegaRapidCz(SimpleCrypter): @@ -18,3 +18,6 @@ class MegaRapidCz(SimpleCrypter): LINK_PATTERN = r'<td class="soubor"[^>]*><a href="([^"]+)">' + + +getInfo = create_getInfo(MegaRapidCzFolder) diff --git a/module/plugins/crypter/Movie2KTo.py b/module/plugins/crypter/Movie2KTo.py index 16a9850d9..92bc128c7 100644 --- a/module/plugins/crypter/Movie2KTo.py +++ b/module/plugins/crypter/Movie2KTo.py @@ -3,12 +3,12 @@ from pyload.plugin.internal.DeadCrypter import DeadCrypter, create_getInfo -class Movie2kTo(DeadCrypter): - __name__ = "Movie2kTo" +class Movie2KTo(DeadCrypter): + __name__ = "Movie2KTo" __type__ = "crypter" __version__ = "0.51" - __pattern__ = r'http://(?:www\.)?movie2k\.to/(.*)\.html' + __pattern__ = r'http://(?:www\.)?movie2k\.to/(.+)\.html' __config__ = [] __description__ = """Movie2k.to decrypter plugin""" @@ -16,4 +16,4 @@ class Movie2kTo(DeadCrypter): __authors__ = [("4Christopher", "4Christopher@gmx.de")] -getInfo = create_getInfo(Movie2kTo) +getInfo = create_getInfo(Movie2KTo) diff --git a/module/plugins/crypter/MultiUpOrg.py b/module/plugins/crypter/MultiUpOrg.py index 9ecbf6d53..7955fca6c 100644 --- a/module/plugins/crypter/MultiUpOrg.py +++ b/module/plugins/crypter/MultiUpOrg.py @@ -3,7 +3,7 @@ import re from urlparse import urljoin -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class MultiUpOrg(SimpleCrypter): @@ -24,7 +24,7 @@ class MultiUpOrg(SimpleCrypter): def getLinks(self): - m_type = re.match(self.__pattern__, self.pyfile.url).group("TYPE") + m_type = re.match(self.__pattern__, self.pyfile.url).group('TYPE') if m_type == "project": pattern = r'\n(http://www\.multiup\.org/(?:en|fr)/download/.*)' @@ -36,3 +36,6 @@ class MultiUpOrg(SimpleCrypter): self.html = self.load(miror_page) return re.findall(pattern, self.html) + + +getInfo = create_getInfo(MultiUpOrg) diff --git a/module/plugins/crypter/MultiloadCz.py b/module/plugins/crypter/MultiloadCz.py index 4229caa6e..856a94a25 100644 --- a/module/plugins/crypter/MultiloadCz.py +++ b/module/plugins/crypter/MultiloadCz.py @@ -9,7 +9,7 @@ class MultiloadCz(Crypter): __type__ = "crypter" __version__ = "0.40" - __pattern__ = r'http://(?:[^/]*\.)?multiload\.cz/(stahnout|slozka)/.*' + __pattern__ = r'http://(?:[^/]*\.)?multiload\.cz/(stahnout|slozka)/.+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True), ("usedHoster", "str", "Prefered hoster list (bar-separated)", ""), @@ -35,8 +35,8 @@ class MultiloadCz(Crypter): m = re.findall(self.LINK_PATTERN, self.html) if m: prefered_set = set(self.getConfig("usedHoster").split('|')) - self.urls.extend([x[1] for x in m if x[0] in prefered_set]) + self.urls.extend(x[1] for x in m if x[0] in prefered_set) if not self.urls: ignored_set = set(self.getConfig("ignoredHoster").split('|')) - self.urls.extend([x[1] for x in m if x[0] not in ignored_set]) + self.urls.extend(x[1] for x in m if x[0] not in ignored_set) diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 415e2785a..29b45b11a 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -import base64 import binascii import re @@ -13,9 +12,9 @@ from pyload.plugin.internal.captcha import ReCaptcha class NCryptIn(Crypter): __name__ = "NCryptIn" __type__ = "crypter" - __version__ = "1.33" + __version__ = "1.34" - __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?P<type>folder|link|frame)-([^/\?]+)' + __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?P<TYPE>folder|link|frame)-([^/\?]+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] @@ -80,7 +79,7 @@ class NCryptIn(Crypter): def isSingleLink(self): - link_type = re.match(self.__pattern__, self.pyfile.url).group('type') + link_type = re.match(self.__pattern__, self.pyfile.url).group('TYPE') return link_type in ("link", "frame") @@ -156,7 +155,7 @@ class NCryptIn(Crypter): captcha_key = re.search(r'\?k=(.*?)"', form).group(1) self.logDebug("Resolving ReCaptcha with key [%s]" % captcha_key) recaptcha = ReCaptcha(self) - challenge, response = recaptcha.challenge(captcha_key) + response, challenge = recaptcha.challenge(captcha_key) postData['recaptcha_challenge_field'] = challenge postData['recaptcha_response_field'] = response @@ -205,7 +204,7 @@ class NCryptIn(Crypter): elif link_source_type == "web": return self.handleWebLinks() else: - self.error('Unknown source type "%s" (this is probably a bug)' % link_source_type) + self.error(_('Unknown source type "%s"') % link_source_type) def handleSingleLink(self): @@ -296,19 +295,15 @@ class NCryptIn(Crypter): self.logDebug("JsEngine returns value [%s]" % jreturn) key = binascii.unhexlify(jreturn) - # Decode crypted - crypted = base64.standard_b64decode(crypted) - # Decrypt Key = key IV = key obj = AES.new(Key, AES.MODE_CBC, IV) - text = obj.decrypt(crypted) + text = obj.decrypt(crypted.decode('base64')) # Extract links text = text.replace("\x00", "").replace("\r", "") - links = text.split("\n") - links = filter(lambda x: x != "", links) + links = filter(bool, text.split('\n')) # Log and return self.logDebug("Block has %d links" % len(links)) diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 876b2093f..62dc5c914 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -2,7 +2,7 @@ import re -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class NetfolderIn(SimpleCrypter): @@ -10,7 +10,7 @@ class NetfolderIn(SimpleCrypter): __type__ = "crypter" __version__ = "0.72" - __pattern__ = r'http://(?:www\.)?netfolder\.in/((?P<id1>\w+)/\w+|folder\.php\?folder_id=(?P<id2>\w+))' + __pattern__ = r'http://(?:www\.)?netfolder\.in/(folder\.php\?folder_id=)?(?P<ID>\w+)(?(1)|/\w+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] @@ -43,8 +43,8 @@ class NetfolderIn(SimpleCrypter): def submitPassword(self): # Gather data try: - m = re.match(self.__pattern__, self.pyfile.url) - id = max(m.group('id1'), m.group('id2')) + m = re.match(self.__pattern__, self.pyfile.url) + id = m.group('ID') except AttributeError: self.logDebug("Unable to get package id from url [%s]" % self.pyfile.url) return @@ -68,3 +68,6 @@ class NetfolderIn(SimpleCrypter): links = re.search(r'name="list" value="(.*?)"', self.html).group(1).split(",") self.logDebug("Package has %d links" % len(links)) return links + + +getInfo = create_getInfo(NetfolderIn) diff --git a/module/plugins/crypter/NosvideoCom.py b/module/plugins/crypter/NosvideoCom.py index d048ec956..1e280abd2 100644 --- a/module/plugins/crypter/NosvideoCom.py +++ b/module/plugins/crypter/NosvideoCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class NosvideoCom(SimpleCrypter): @@ -19,3 +19,6 @@ class NosvideoCom(SimpleCrypter): LINK_PATTERN = r'href="(http://(?:w{3}\.)?nosupload\.com/\?d=\w+)"' NAME_PATTERN = r'<[tT]itle>Watch (?P<N>.+?)<' + + +getInfo = create_getInfo(NosvideoCom) diff --git a/module/plugins/crypter/OneKhDe.py b/module/plugins/crypter/OneKhDe.py index aad7901aa..323214df8 100644 --- a/module/plugins/crypter/OneKhDe.py +++ b/module/plugins/crypter/OneKhDe.py @@ -3,13 +3,14 @@ import re from pyload.utils import html_unescape + from pyload.plugin.Crypter import Crypter class OneKhDe(Crypter): __name__ = "OneKhDe" __type__ = "crypter" - __version__ = "0.10" + __version__ = "0.11" __pattern__ = r'http://(?:www\.)?1kh\.de/f/' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/PastebinCom.py b/module/plugins/crypter/PastebinCom.py index 43a818cf1..b3d5a4bea 100644 --- a/module/plugins/crypter/PastebinCom.py +++ b/module/plugins/crypter/PastebinCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class PastebinCom(SimpleCrypter): @@ -19,3 +19,6 @@ class PastebinCom(SimpleCrypter): LINK_PATTERN = r'<div class="de\d+">(https?://[^ <]+)(?:[^<]*)</div>' NAME_PATTERN = r'<div class="paste_box_line1" title="(?P<N>[^"]+)">' + + +getInfo = create_getInfo(PastebinCom) diff --git a/module/plugins/crypter/QuickshareCz.py b/module/plugins/crypter/QuickshareCz.py index 05a85a29c..8cd4b9c02 100644 --- a/module/plugins/crypter/QuickshareCz.py +++ b/module/plugins/crypter/QuickshareCz.py @@ -9,7 +9,7 @@ class QuickshareCz(Crypter): __type__ = "crypter" __version__ = "0.10" - __pattern__ = r'http://(?:www\.)?quickshare\.cz/slozka-\d+.*' + __pattern__ = r'http://(?:www\.)?quickshare\.cz/slozka-\d+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] diff --git a/module/plugins/crypter/RapidfileshareNet.py b/module/plugins/crypter/RapidfileshareNet.py deleted file mode 100644 index 1d149dae9..000000000 --- a/module/plugins/crypter/RapidfileshareNet.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.plugin.internal.XFSCrypter import XFSCrypter - - -class RapidfileshareNet(XFSCrypter): - __name__ = "RapidfileshareNet" - __type__ = "crypter" - __version__ = "0.03" - - __pattern__ = r'http://(?:www\.)?rapidfileshare\.net/users/\w+/\d+/\w+' - __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), - ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] - - __description__ = """Rapidfileshare.net folder decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("guidobelix", "guidobelix@hotmail.it")] - - - HOSTER_DOMAIN = "rapidfileshare.net" diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 1e0f8e371..b361f87d8 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -2,21 +2,21 @@ from __future__ import with_statement -import base64 import binascii import re import os from Crypto.Cipher import AES from pyload.plugin.Crypter import Crypter +from module.utils import safe_join class RelinkUs(Crypter): __name__ = "RelinkUs" __type__ = "crypter" - __version__ = "3.11" + __version__ = "3.12" - __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<id>.+)' + __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<ID>.+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] @@ -50,15 +50,14 @@ class RelinkUs(Crypter): DLC_LINK_REGEX = r'<a href=".*?" class="dlc_button" target="_blank">' DLC_DOWNLOAD_URL = r'http://www.relink.us/download.php' - WEB_FORWARD_REGEX = r'getFile\(\'(?P<link>.+)\'\)' + WEB_FORWARD_REGEX = r'getFile\(\'(.+)\'\)' 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>' + WEB_LINK_REGEX = r'<iframe name="Container" height="100%" frameborder="no" width="100%" src="(.+)"></iframe>' def setup(self): - self.fileid = None + self.fileid = None self.package = None - self.password = None self.captcha = False @@ -100,9 +99,8 @@ class RelinkUs(Crypter): def initPackage(self, pyfile): - self.fileid = re.match(self.__pattern__, pyfile.url).group('id') + self.fileid = re.match(self.__pattern__, pyfile.url).group('ID') self.package = pyfile.package() - self.password = self.getPassword() def requestPackage(self): @@ -130,10 +128,14 @@ class RelinkUs(Crypter): def unlockPasswordProtection(self): - self.logDebug("Submitting password [%s] for protected links" % self.password) - passwd_url = self.PASSWORD_SUBMIT_URL + "?id=%s" % self.fileid - passwd_data = {'id': self.fileid, 'password': self.password, 'pw': 'submit'} - self.html = self.load(passwd_url, post=passwd_data, decode=True) + password = self.getPassword() + + self.logDebug("Submitting password [%s] for protected links" % password) + + if password: + passwd_url = self.PASSWORD_SUBMIT_URL + "?id=%s" % self.fileid + passwd_data = {'id': self.fileid, 'password': password, 'pw': 'submit'} + self.html = self.load(passwd_url, post=passwd_data, decode=True) def unlockCaptchaProtection(self): @@ -189,7 +191,7 @@ class RelinkUs(Crypter): elif source == 'web': return self.handleWEBLinks() else: - self.error('Unknown source type "%s" (this is probably a bug)' % source) + self.error(_('Unknown source type "%s"') % source) def handleCNL2Links(self): @@ -217,12 +219,14 @@ 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 = save_join(self.config['general']['download_folder'], dlc_filename) with open(dlc_filepath, "wb") as f: f.write(dlc) package_links.append(dlc_filepath) + except Exception: - self.fail("Unable to download DLC container") + self.fail(_("Unable to download DLC container")) + return package_links @@ -241,7 +245,7 @@ class RelinkUs(Crypter): self.logDebug("Decrypting Web link %d, %s" % (index + 1, url)) res = self.load(url, decode=True) - link = re.search(self.WEB_LINK_REGEX, res).group('link') + link = re.search(self.WEB_LINK_REGEX, res).group(1) package_links.append(link) @@ -274,19 +278,15 @@ class RelinkUs(Crypter): self.logDebug("JsEngine returns value [%s]" % jreturn) key = binascii.unhexlify(jreturn) - # Decode crypted - crypted = base64.standard_b64decode(crypted) - # Decrypt Key = key IV = key obj = AES.new(Key, AES.MODE_CBC, IV) - text = obj.decrypt(crypted) + text = obj.decrypt(crypted.decode('base64')) # Extract links text = text.replace("\x00", "").replace("\r", "") - links = text.split("\n") - links = filter(lambda x: x != "", links) + links = filter(bool, text.split('\n')) # Log and return self.logDebug("Package has %d links" % len(links)) diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index c466d8bb6..2d5d273ed 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -12,7 +12,7 @@ from pyload.plugin.internal.captcha import SolveMedia class SafelinkingNet(Crypter): __name__ = "SafelinkingNet" __type__ = "crypter" - __version__ = "0.11" + __version__ = "0.14" __pattern__ = r'https?://(?:www\.)?safelinking\.net/([pd])/\w+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -40,6 +40,8 @@ class SafelinkingNet(Crypter): else: postData = {"post-protect": "1"} + self.html = self.load(url) + if "link-password" in self.html: postData['link-password'] = self.getPassword() @@ -53,7 +55,7 @@ class SafelinkingNet(Crypter): else: self.fail(_("Error parsing captcha")) - challenge, response = captcha.challenge(captchaKey) + response, challenge = captcha.challenge(captchaKey) postData['adcopy_challenge'] = challenge postData['adcopy_response'] = response diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 333e2d8d8..1328e86aa 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -import base64 import binascii import re @@ -248,14 +247,12 @@ class ShareLinksBiz(Crypter): params = res.split(";;") # Get jk - strlist = list(base64.standard_b64decode(params[1])) - strlist.reverse() - jk = ''.join(strlist) + strlist = list(params[1].decode('base64')) + jk = ''.join(strlist[::-1]) # Get crypted - strlist = list(base64.standard_b64decode(params[2])) - strlist.reverse() - crypted = ''.join(strlist) + strlist = list(params[2].decode('base64')) + crypted = ''.join(strlist[::-1]) # Log and return return crypted, jk @@ -267,19 +264,15 @@ class ShareLinksBiz(Crypter): self.logDebug("JsEngine returns value [%s]" % jreturn) key = binascii.unhexlify(jreturn) - # Decode crypted - crypted = base64.standard_b64decode(crypted) - # Decrypt Key = key IV = key obj = AES.new(Key, AES.MODE_CBC, IV) - text = obj.decrypt(crypted) + text = obj.decrypt(crypted.decode('base64')) # Extract links text = text.replace("\x00", "").replace("\r", "") - links = text.split("\n") - links = filter(lambda x: x != "", links) + links = filter(bool, text.split('\n')) # Log and return self.logDebug("Block has %d links" % len(links)) diff --git a/module/plugins/crypter/TnyCz.py b/module/plugins/crypter/TnyCz.py index d73f6de63..d36128550 100644 --- a/module/plugins/crypter/TnyCz.py +++ b/module/plugins/crypter/TnyCz.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo import re @@ -25,3 +25,6 @@ class TnyCz(SimpleCrypter): 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 + + +getInfo = create_getInfo(TnyCz) diff --git a/module/plugins/crypter/TrailerzoneInfo.py b/module/plugins/crypter/TrailerzoneInfo.py index c19a5e693..ca14e6df5 100644 --- a/module/plugins/crypter/TrailerzoneInfo.py +++ b/module/plugins/crypter/TrailerzoneInfo.py @@ -8,7 +8,7 @@ class TrailerzoneInfo(DeadCrypter): __type__ = "crypter" __version__ = "0.03" - __pattern__ = r'http://(?:www\.)?trailerzone\.info/.*?' + __pattern__ = r'http://(?:www\.)?trailerzone\.info/.+' __config__ = [] __description__ = """TrailerZone.info decrypter plugin""" diff --git a/module/plugins/crypter/TurbobitNet.py b/module/plugins/crypter/TurbobitNet.py index a1309c083..67f7c74d4 100644 --- a/module/plugins/crypter/TurbobitNet.py +++ b/module/plugins/crypter/TurbobitNet.py @@ -2,7 +2,7 @@ import re -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo from pyload.utils import json_loads @@ -39,6 +39,9 @@ class TurbobitNet(SimpleCrypter): def getLinks(self): - id = re.match(self.__pattern__, self.pyfile.url).group("ID") + id = re.match(self.__pattern__, self.pyfile.url).group('ID') fixurl = lambda id: "http://turbobit.net/%s.html" % id return map(fixurl, self._getLinks(id)) + + +getInfo = create_getInfo(TurbobitNetFolder) diff --git a/module/plugins/crypter/TusfilesNet.py b/module/plugins/crypter/TusfilesNet.py index 88ff941b2..94b6bbb5d 100644 --- a/module/plugins/crypter/TusfilesNet.py +++ b/module/plugins/crypter/TusfilesNet.py @@ -4,13 +4,13 @@ import math import re from urlparse import urljoin -from pyload.plugin.internal.XFSCrypter import XFSCrypter +from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class TusfilesNet(XFSCrypter): __name__ = "TusfilesNet" __type__ = "crypter" - __version__ = "0.07" + __version__ = "0.08" __pattern__ = r'https?://(?:www\.)?tusfiles\.net/go/(?P<ID>\w+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -22,8 +22,6 @@ class TusfilesNet(XFSCrypter): ("stickell", "l.stickell@yahoo.it")] - HOSTER_DOMAIN = "tusfiles.net" - PAGES_PATTERN = r'>\((\d+) \w+\)<' URL_REPLACEMENTS = [(__pattern__ + ".*", r'https://www.tusfiles.net/go/\g<ID>/')] @@ -33,7 +31,7 @@ class TusfilesNet(XFSCrypter): return self.load(urljoin(self.pyfile.url, str(page_n)), decode=True) - def handleMultiPages(self): + def handlePages(self, pyfile): pages = re.search(self.PAGES_PATTERN, self.html) if pages: pages = int(math.ceil(int(pages.group('pages')) / 25.0)) @@ -43,3 +41,6 @@ class TusfilesNet(XFSCrypter): for p in xrange(2, pages + 1): self.html = self.loadPage(p) self.links += self.getLinks() + + +getInfo = create_getInfo(TusfilesNetFolder) diff --git a/module/plugins/crypter/UlozTo.py b/module/plugins/crypter/UlozTo.py index 99956ef41..81fbee172 100644 --- a/module/plugins/crypter/UlozTo.py +++ b/module/plugins/crypter/UlozTo.py @@ -9,7 +9,7 @@ class UlozTo(Crypter): __type__ = "crypter" __version__ = "0.20" - __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl)/(m|soubory)/.*' + __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl)/(m|soubory)/.+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] diff --git a/module/plugins/crypter/UploadableCh.py b/module/plugins/crypter/UploadableCh.py index f5fb0c3bc..8e4ff71c0 100644 --- a/module/plugins/crypter/UploadableCh.py +++ b/module/plugins/crypter/UploadableCh.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class UploadableCh(SimpleCrypter): @@ -22,3 +22,6 @@ class UploadableCh(SimpleCrypter): NAME_PATTERN = r'<div class="folder"><span> </span>(?P<N>.+?)</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">' + + +getInfo = create_getInfo(UploadableChFolder) diff --git a/module/plugins/crypter/UploadedTo.py b/module/plugins/crypter/UploadedTo.py index 1223d32fe..f6bc861de 100644 --- a/module/plugins/crypter/UploadedTo.py +++ b/module/plugins/crypter/UploadedTo.py @@ -4,7 +4,7 @@ import re from urlparse import urljoin -from pyload.plugin.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class UploadedTo(SimpleCrypter): @@ -12,7 +12,7 @@ class UploadedTo(SimpleCrypter): __type__ = "crypter" __version__ = "0.42" - __pattern__ = r'http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|folder|list)/(?P<id>\w+)' + __pattern__ = r'http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|folder|list)/(?P<ID>\w+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] @@ -21,7 +21,7 @@ class UploadedTo(SimpleCrypter): __authors__ = [("stickell", "l.stickell@yahoo.it")] - PLAIN_PATTERN = r'<small class="date"><a href="(?P<plain>[\w/]+)" onclick=' + PLAIN_PATTERN = r'<small class="date"><a href="([\w/]+)" onclick=' NAME_PATTERN = r'<title>(?P<N>.+?)<' @@ -30,5 +30,8 @@ class UploadedTo(SimpleCrypter): if m is None: self.error(_("PLAIN_PATTERN not found")) - plain_link = urljoin("http://uploaded.net/", m.group('plain')) + plain_link = urljoin("http://uploaded.net/", m.group(1)) return self.load(plain_link).split('\n')[:-1] + + +getInfo = create_getInfo(UploadedToFolder) diff --git a/module/plugins/crypter/XFileSharingPro.py b/module/plugins/crypter/XFileSharingPro.py index 7cf3cde57..a965f0c48 100644 --- a/module/plugins/crypter/XFileSharingPro.py +++ b/module/plugins/crypter/XFileSharingPro.py @@ -2,13 +2,13 @@ import re -from pyload.plugin.internal.XFSCrypter import XFSCrypter +from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class XFileSharingPro(XFSCrypter): __name__ = "XFileSharingPro" __type__ = "crypter" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'^unmatchable$' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -20,7 +20,7 @@ class XFileSharingPro(XFSCrypter): def _log(self, type, args): - msg = " | ".join([str(a).strip() for a in args if a]) + msg = " | ".join(str(a).strip() for a in args if a) logger = getattr(self.log, type) logger("%s: %s: %s" % (self.__name__, self.HOSTER_NAME, msg or _("%s MARK" % type.upper()))) @@ -30,18 +30,26 @@ class XFileSharingPro(XFSCrypter): self.__pattern__ = self.core.pluginManager.crypterPlugins[self.__name__]['pattern'] - self.HOSTER_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group(1).lower() - self.HOSTER_NAME = "".join([str.capitalize() for str in self.HOSTER_DOMAIN.split('.')]) + self.HOSTER_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group("DOMAIN").lower() + self.HOSTER_NAME = "".join(part.capitalize() for part in re.split(r'(\.|\d+)', self.HOSTER_DOMAIN) if part != '.') + + if self.HOSTER_NAME[0].isdigit(): + self.HOSTER_NAME = 'X' + self.HOSTER_NAME account = self.core.accountManager.getAccountPlugin(self.HOSTER_NAME) if account and account.canUse(): self.account = account + elif self.account: self.account.HOSTER_DOMAIN = self.HOSTER_DOMAIN + else: return self.user, data = self.account.selectAccount() - self.req = self.account.getAccountRequest(self.user) - self.premium = self.account.isPremium(self.user) + self.req = self.account.getAccountRequest(self.user) + self.premium = self.account.isPremium(self.user) + + +getInfo = create_getInfo(XFileSharingProFolder) diff --git a/module/plugins/crypter/XupPl.py b/module/plugins/crypter/XupPl.py index b5c8fd6e2..9d4d27b61 100644 --- a/module/plugins/crypter/XupPl.py +++ b/module/plugins/crypter/XupPl.py @@ -8,7 +8,7 @@ class XupPl(Crypter): __type__ = "crypter" __version__ = "0.10" - __pattern__ = r'https?://(?:[^/]*\.)?xup\.pl/.*' + __pattern__ = r'https?://(?:[^/]*\.)?xup\.pl/.+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] diff --git a/module/plugins/crypter/YoutubeBatch.py b/module/plugins/crypter/YoutubeBatch.py index 2bc1b799e..5e4269fd2 100644 --- a/module/plugins/crypter/YoutubeBatch.py +++ b/module/plugins/crypter/YoutubeBatch.py @@ -31,9 +31,9 @@ class YoutubeBatch(Crypter): def api_response(self, ref, req): req.update({"key": self.API_KEY}) - url = urljoin("https://www.googleapis.com/youtube/v3/", ref) - page = self.load(url, get=req) - return json_loads(page) + url = urljoin("https://www.googleapis.com/youtube/v3/", ref) + html = self.load(url, get=req) + return json_loads(html) def getChannel(self, user): @@ -96,8 +96,8 @@ class YoutubeBatch(Crypter): def decrypt(self, pyfile): m = re.match(self.__pattern__, pyfile.url) - m_id = m.group("ID") - m_type = m.group("TYPE") + m_id = m.group('ID') + m_type = m.group('TYPE') if m_type == "user": self.logDebug("Url recognized as Channel") |