From 68d662e689cd42687341c550fb6ebb74e6968d21 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Sep 2014 00:29:57 +0200 Subject: module -> pyload --- module/plugins/hoster/AlldebridCom.py | 87 ------- module/plugins/hoster/BasePlugin.py | 116 --------- module/plugins/hoster/BayfilesCom.py | 84 ------ module/plugins/hoster/BezvadataCz.py | 87 ------- module/plugins/hoster/BillionuploadsCom.py | 23 -- module/plugins/hoster/BitshareCom.py | 151 ----------- module/plugins/hoster/BoltsharingCom.py | 18 -- module/plugins/hoster/CatShareNet.py | 44 ---- module/plugins/hoster/CloudzerNet.py | 18 -- module/plugins/hoster/CramitIn.py | 27 -- module/plugins/hoster/CrockoCom.py | 75 ------ module/plugins/hoster/CyberlockerCh.py | 18 -- module/plugins/hoster/CzshareCom.py | 148 ----------- module/plugins/hoster/DailymotionCom.py | 111 -------- module/plugins/hoster/DataHu.py | 41 --- module/plugins/hoster/DataportCz.py | 56 ---- module/plugins/hoster/DateiTo.py | 83 ------ module/plugins/hoster/DdlstorageCom.py | 18 -- module/plugins/hoster/DebridItaliaCom.py | 49 ---- module/plugins/hoster/DepositfilesCom.py | 129 ---------- module/plugins/hoster/DlFreeFr.py | 205 --------------- module/plugins/hoster/DuploadOrg.py | 22 -- module/plugins/hoster/EasybytezCom.py | 31 --- module/plugins/hoster/EdiskCz.py | 54 ---- module/plugins/hoster/EgoFilesCom.py | 89 ------- module/plugins/hoster/EpicShareNet.py | 26 -- module/plugins/hoster/EuroshareEu.py | 64 ----- module/plugins/hoster/ExtabitCom.py | 77 ------ module/plugins/hoster/FastixRu.py | 71 ------ module/plugins/hoster/FastshareCz.py | 88 ------- module/plugins/hoster/File4safeCom.py | 40 --- module/plugins/hoster/FileApeCom.py | 18 -- module/plugins/hoster/FileParadoxIn.py | 25 -- module/plugins/hoster/FileStoreTo.py | 34 --- module/plugins/hoster/FilebeerInfo.py | 18 -- module/plugins/hoster/FilecloudIo.py | 115 --------- module/plugins/hoster/FilefactoryCom.py | 106 -------- module/plugins/hoster/FilejungleCom.py | 28 -- module/plugins/hoster/FileomCom.py | 39 --- module/plugins/hoster/FilepostCom.py | 129 ---------- module/plugins/hoster/FilerNet.py | 109 -------- module/plugins/hoster/FilerioCom.py | 27 -- module/plugins/hoster/FilesMailRu.py | 101 -------- module/plugins/hoster/FileserveCom.py | 209 --------------- module/plugins/hoster/FileshareInUa.py | 83 ------ module/plugins/hoster/FilezyNet.py | 42 --- module/plugins/hoster/FiredriveCom.py | 51 ---- module/plugins/hoster/FlyFilesNet.py | 46 ---- module/plugins/hoster/FourSharedCom.py | 59 ----- module/plugins/hoster/FreakshareCom.py | 173 ------------- module/plugins/hoster/FreeWayMe.py | 35 --- module/plugins/hoster/FreevideoCz.py | 18 -- module/plugins/hoster/FshareVn.py | 120 --------- module/plugins/hoster/Ftp.py | 74 ------ module/plugins/hoster/GamefrontCom.py | 84 ------ module/plugins/hoster/GigapetaCom.py | 64 ----- module/plugins/hoster/GooIm.py | 36 --- module/plugins/hoster/HellshareCz.py | 47 ---- module/plugins/hoster/HellspyCz.py | 18 -- module/plugins/hoster/HotfileCom.py | 18 -- module/plugins/hoster/HugefilesNet.py | 25 -- module/plugins/hoster/HundredEightyUploadCom.py | 26 -- module/plugins/hoster/IFileWs.py | 23 -- module/plugins/hoster/IcyFilesCom.py | 18 -- module/plugins/hoster/IfileIt.py | 62 ----- module/plugins/hoster/IfolderRu.py | 75 ------ module/plugins/hoster/JumbofilesCom.py | 36 --- module/plugins/hoster/Keep2shareCC.py | 110 -------- module/plugins/hoster/LemUploadsCom.py | 26 -- module/plugins/hoster/LetitbitNet.py | 160 ------------ module/plugins/hoster/LinksnappyCom.py | 72 ------ module/plugins/hoster/LoadTo.py | 69 ----- module/plugins/hoster/LomafileCom.py | 61 ----- module/plugins/hoster/LuckyShareNet.py | 75 ------ module/plugins/hoster/MediafireCom.py | 125 --------- module/plugins/hoster/MegaDebridEu.py | 89 ------- module/plugins/hoster/MegaFilesSe.py | 23 -- module/plugins/hoster/MegaNz.py | 132 ---------- module/plugins/hoster/MegacrypterCom.py | 53 ---- module/plugins/hoster/MegareleaseOrg.py | 22 -- module/plugins/hoster/MegasharesCom.py | 105 -------- module/plugins/hoster/MovReelCom.py | 24 -- module/plugins/hoster/MultiDebridCom.py | 45 ---- module/plugins/hoster/MultishareCz.py | 72 ------ module/plugins/hoster/MyvideoDe.py | 45 ---- module/plugins/hoster/NarodRu.py | 60 ----- module/plugins/hoster/NetloadIn.py | 258 ------------------- module/plugins/hoster/NosuploadCom.py | 42 --- module/plugins/hoster/NovafileCom.py | 33 --- module/plugins/hoster/NowDownloadEu.py | 60 ----- module/plugins/hoster/OboomCom.py | 132 ---------- module/plugins/hoster/OneFichierCom.py | 90 ------- module/plugins/hoster/OverLoadMe.py | 82 ------ module/plugins/hoster/PandaPlanet.py | 28 -- module/plugins/hoster/PornhostCom.py | 76 ------ module/plugins/hoster/PornhubCom.py | 85 ------- module/plugins/hoster/PotloadCom.py | 22 -- module/plugins/hoster/Premium4Me.py | 72 ------ module/plugins/hoster/PremiumizeMe.py | 55 ---- module/plugins/hoster/PromptfileCom.py | 45 ---- module/plugins/hoster/QuickshareCz.py | 92 ------- module/plugins/hoster/RPNetBiz.py | 80 ------ module/plugins/hoster/RapidgatorNet.py | 191 -------------- module/plugins/hoster/RapidshareCom.py | 223 ---------------- module/plugins/hoster/RarefileNet.py | 39 --- module/plugins/hoster/RealdebridCom.py | 91 ------- module/plugins/hoster/RedtubeCom.py | 58 ----- module/plugins/hoster/RehostTo.py | 41 --- module/plugins/hoster/RemixshareCom.py | 59 ----- module/plugins/hoster/RgHostNet.py | 32 --- module/plugins/hoster/RyushareCom.py | 85 ------- module/plugins/hoster/SecureUploadEu.py | 23 -- module/plugins/hoster/SendmywayCom.py | 23 -- module/plugins/hoster/SendspaceCom.py | 60 ----- module/plugins/hoster/Share4webCom.py | 21 -- module/plugins/hoster/Share76Com.py | 18 -- module/plugins/hoster/ShareFilesCo.py | 18 -- module/plugins/hoster/ShareRapidCom.py | 66 ----- module/plugins/hoster/SharebeesCom.py | 18 -- module/plugins/hoster/ShareonlineBiz.py | 199 --------------- module/plugins/hoster/ShareplaceCom.py | 84 ------ module/plugins/hoster/ShragleCom.py | 18 -- module/plugins/hoster/SimplyPremiumCom.py | 81 ------ module/plugins/hoster/SimplydebridCom.py | 62 ----- module/plugins/hoster/SockshareCom.py | 88 ------- module/plugins/hoster/SoundcloudCom.py | 57 ----- module/plugins/hoster/SpeedLoadOrg.py | 18 -- module/plugins/hoster/SpeedfileCz.py | 18 -- module/plugins/hoster/SpeedyshareCom.py | 43 ---- module/plugins/hoster/StreamCz.py | 70 ----- module/plugins/hoster/StreamcloudEu.py | 124 --------- module/plugins/hoster/TurbobitNet.py | 167 ------------ module/plugins/hoster/TurbouploadCom.py | 18 -- module/plugins/hoster/TusfilesNet.py | 31 --- module/plugins/hoster/TwoSharedCom.py | 39 --- module/plugins/hoster/UlozTo.py | 158 ------------ module/plugins/hoster/UloziskoSk.py | 70 ----- module/plugins/hoster/UnibytesCom.py | 71 ------ module/plugins/hoster/UnrestrictLi.py | 89 ------- module/plugins/hoster/UploadStationCom.py | 18 -- module/plugins/hoster/UploadedTo.py | 240 ------------------ module/plugins/hoster/UploadheroCom.py | 77 ------ module/plugins/hoster/UploadingCom.py | 99 -------- module/plugins/hoster/UpstoreNet.py | 75 ------ module/plugins/hoster/UptoboxCom.py | 69 ----- module/plugins/hoster/VeehdCom.py | 79 ------ module/plugins/hoster/VeohCom.py | 51 ---- module/plugins/hoster/VidPlayNet.py | 27 -- module/plugins/hoster/VimeoCom.py | 72 ------ module/plugins/hoster/Vipleech4uCom.py | 18 -- module/plugins/hoster/WarserverCz.py | 18 -- module/plugins/hoster/WebshareCz.py | 60 ----- module/plugins/hoster/WrzucTo.py | 51 ---- module/plugins/hoster/WuploadCom.py | 18 -- module/plugins/hoster/X7To.py | 18 -- module/plugins/hoster/XFileSharingPro.py | 324 ------------------------ module/plugins/hoster/XHamsterCom.py | 123 --------- module/plugins/hoster/XVideosCom.py | 28 -- module/plugins/hoster/Xdcc.py | 205 --------------- module/plugins/hoster/YibaishiwuCom.py | 54 ---- module/plugins/hoster/YoupornCom.py | 56 ---- module/plugins/hoster/YourfilesTo.py | 81 ------ module/plugins/hoster/YoutubeCom.py | 180 ------------- module/plugins/hoster/ZDF.py | 56 ---- module/plugins/hoster/ZeveraCom.py | 108 -------- module/plugins/hoster/ZippyshareCom.py | 74 ------ module/plugins/hoster/__init__.py | 0 167 files changed, 11811 deletions(-) delete mode 100644 module/plugins/hoster/AlldebridCom.py delete mode 100644 module/plugins/hoster/BasePlugin.py delete mode 100644 module/plugins/hoster/BayfilesCom.py delete mode 100644 module/plugins/hoster/BezvadataCz.py delete mode 100644 module/plugins/hoster/BillionuploadsCom.py delete mode 100644 module/plugins/hoster/BitshareCom.py delete mode 100644 module/plugins/hoster/BoltsharingCom.py delete mode 100644 module/plugins/hoster/CatShareNet.py delete mode 100644 module/plugins/hoster/CloudzerNet.py delete mode 100644 module/plugins/hoster/CramitIn.py delete mode 100644 module/plugins/hoster/CrockoCom.py delete mode 100644 module/plugins/hoster/CyberlockerCh.py delete mode 100644 module/plugins/hoster/CzshareCom.py delete mode 100644 module/plugins/hoster/DailymotionCom.py delete mode 100644 module/plugins/hoster/DataHu.py delete mode 100644 module/plugins/hoster/DataportCz.py delete mode 100644 module/plugins/hoster/DateiTo.py delete mode 100644 module/plugins/hoster/DdlstorageCom.py delete mode 100644 module/plugins/hoster/DebridItaliaCom.py delete mode 100644 module/plugins/hoster/DepositfilesCom.py delete mode 100644 module/plugins/hoster/DlFreeFr.py delete mode 100644 module/plugins/hoster/DuploadOrg.py delete mode 100644 module/plugins/hoster/EasybytezCom.py delete mode 100644 module/plugins/hoster/EdiskCz.py delete mode 100644 module/plugins/hoster/EgoFilesCom.py delete mode 100644 module/plugins/hoster/EpicShareNet.py delete mode 100644 module/plugins/hoster/EuroshareEu.py delete mode 100644 module/plugins/hoster/ExtabitCom.py delete mode 100644 module/plugins/hoster/FastixRu.py delete mode 100644 module/plugins/hoster/FastshareCz.py delete mode 100644 module/plugins/hoster/File4safeCom.py delete mode 100644 module/plugins/hoster/FileApeCom.py delete mode 100644 module/plugins/hoster/FileParadoxIn.py delete mode 100644 module/plugins/hoster/FileStoreTo.py delete mode 100644 module/plugins/hoster/FilebeerInfo.py delete mode 100644 module/plugins/hoster/FilecloudIo.py delete mode 100644 module/plugins/hoster/FilefactoryCom.py delete mode 100644 module/plugins/hoster/FilejungleCom.py delete mode 100644 module/plugins/hoster/FileomCom.py delete mode 100644 module/plugins/hoster/FilepostCom.py delete mode 100644 module/plugins/hoster/FilerNet.py delete mode 100644 module/plugins/hoster/FilerioCom.py delete mode 100644 module/plugins/hoster/FilesMailRu.py delete mode 100644 module/plugins/hoster/FileserveCom.py delete mode 100644 module/plugins/hoster/FileshareInUa.py delete mode 100644 module/plugins/hoster/FilezyNet.py delete mode 100644 module/plugins/hoster/FiredriveCom.py delete mode 100644 module/plugins/hoster/FlyFilesNet.py delete mode 100644 module/plugins/hoster/FourSharedCom.py delete mode 100644 module/plugins/hoster/FreakshareCom.py delete mode 100644 module/plugins/hoster/FreeWayMe.py delete mode 100644 module/plugins/hoster/FreevideoCz.py delete mode 100644 module/plugins/hoster/FshareVn.py delete mode 100644 module/plugins/hoster/Ftp.py delete mode 100644 module/plugins/hoster/GamefrontCom.py delete mode 100644 module/plugins/hoster/GigapetaCom.py delete mode 100644 module/plugins/hoster/GooIm.py delete mode 100644 module/plugins/hoster/HellshareCz.py delete mode 100644 module/plugins/hoster/HellspyCz.py delete mode 100644 module/plugins/hoster/HotfileCom.py delete mode 100644 module/plugins/hoster/HugefilesNet.py delete mode 100644 module/plugins/hoster/HundredEightyUploadCom.py delete mode 100644 module/plugins/hoster/IFileWs.py delete mode 100644 module/plugins/hoster/IcyFilesCom.py delete mode 100644 module/plugins/hoster/IfileIt.py delete mode 100644 module/plugins/hoster/IfolderRu.py delete mode 100644 module/plugins/hoster/JumbofilesCom.py delete mode 100644 module/plugins/hoster/Keep2shareCC.py delete mode 100644 module/plugins/hoster/LemUploadsCom.py delete mode 100644 module/plugins/hoster/LetitbitNet.py delete mode 100644 module/plugins/hoster/LinksnappyCom.py delete mode 100644 module/plugins/hoster/LoadTo.py delete mode 100644 module/plugins/hoster/LomafileCom.py delete mode 100644 module/plugins/hoster/LuckyShareNet.py delete mode 100644 module/plugins/hoster/MediafireCom.py delete mode 100644 module/plugins/hoster/MegaDebridEu.py delete mode 100644 module/plugins/hoster/MegaFilesSe.py delete mode 100644 module/plugins/hoster/MegaNz.py delete mode 100644 module/plugins/hoster/MegacrypterCom.py delete mode 100644 module/plugins/hoster/MegareleaseOrg.py delete mode 100644 module/plugins/hoster/MegasharesCom.py delete mode 100644 module/plugins/hoster/MovReelCom.py delete mode 100644 module/plugins/hoster/MultiDebridCom.py delete mode 100644 module/plugins/hoster/MultishareCz.py delete mode 100644 module/plugins/hoster/MyvideoDe.py delete mode 100644 module/plugins/hoster/NarodRu.py delete mode 100644 module/plugins/hoster/NetloadIn.py delete mode 100644 module/plugins/hoster/NosuploadCom.py delete mode 100644 module/plugins/hoster/NovafileCom.py delete mode 100644 module/plugins/hoster/NowDownloadEu.py delete mode 100644 module/plugins/hoster/OboomCom.py delete mode 100644 module/plugins/hoster/OneFichierCom.py delete mode 100644 module/plugins/hoster/OverLoadMe.py delete mode 100644 module/plugins/hoster/PandaPlanet.py delete mode 100644 module/plugins/hoster/PornhostCom.py delete mode 100644 module/plugins/hoster/PornhubCom.py delete mode 100644 module/plugins/hoster/PotloadCom.py delete mode 100644 module/plugins/hoster/Premium4Me.py delete mode 100644 module/plugins/hoster/PremiumizeMe.py delete mode 100644 module/plugins/hoster/PromptfileCom.py delete mode 100644 module/plugins/hoster/QuickshareCz.py delete mode 100644 module/plugins/hoster/RPNetBiz.py delete mode 100644 module/plugins/hoster/RapidgatorNet.py delete mode 100644 module/plugins/hoster/RapidshareCom.py delete mode 100644 module/plugins/hoster/RarefileNet.py delete mode 100644 module/plugins/hoster/RealdebridCom.py delete mode 100644 module/plugins/hoster/RedtubeCom.py delete mode 100644 module/plugins/hoster/RehostTo.py delete mode 100644 module/plugins/hoster/RemixshareCom.py delete mode 100644 module/plugins/hoster/RgHostNet.py delete mode 100644 module/plugins/hoster/RyushareCom.py delete mode 100644 module/plugins/hoster/SecureUploadEu.py delete mode 100644 module/plugins/hoster/SendmywayCom.py delete mode 100644 module/plugins/hoster/SendspaceCom.py delete mode 100644 module/plugins/hoster/Share4webCom.py delete mode 100644 module/plugins/hoster/Share76Com.py delete mode 100644 module/plugins/hoster/ShareFilesCo.py delete mode 100644 module/plugins/hoster/ShareRapidCom.py delete mode 100644 module/plugins/hoster/SharebeesCom.py delete mode 100644 module/plugins/hoster/ShareonlineBiz.py delete mode 100644 module/plugins/hoster/ShareplaceCom.py delete mode 100644 module/plugins/hoster/ShragleCom.py delete mode 100644 module/plugins/hoster/SimplyPremiumCom.py delete mode 100644 module/plugins/hoster/SimplydebridCom.py delete mode 100644 module/plugins/hoster/SockshareCom.py delete mode 100644 module/plugins/hoster/SoundcloudCom.py delete mode 100644 module/plugins/hoster/SpeedLoadOrg.py delete mode 100644 module/plugins/hoster/SpeedfileCz.py delete mode 100644 module/plugins/hoster/SpeedyshareCom.py delete mode 100644 module/plugins/hoster/StreamCz.py delete mode 100644 module/plugins/hoster/StreamcloudEu.py delete mode 100644 module/plugins/hoster/TurbobitNet.py delete mode 100644 module/plugins/hoster/TurbouploadCom.py delete mode 100644 module/plugins/hoster/TusfilesNet.py delete mode 100644 module/plugins/hoster/TwoSharedCom.py delete mode 100644 module/plugins/hoster/UlozTo.py delete mode 100644 module/plugins/hoster/UloziskoSk.py delete mode 100644 module/plugins/hoster/UnibytesCom.py delete mode 100644 module/plugins/hoster/UnrestrictLi.py delete mode 100644 module/plugins/hoster/UploadStationCom.py delete mode 100644 module/plugins/hoster/UploadedTo.py delete mode 100644 module/plugins/hoster/UploadheroCom.py delete mode 100644 module/plugins/hoster/UploadingCom.py delete mode 100644 module/plugins/hoster/UpstoreNet.py delete mode 100644 module/plugins/hoster/UptoboxCom.py delete mode 100644 module/plugins/hoster/VeehdCom.py delete mode 100644 module/plugins/hoster/VeohCom.py delete mode 100644 module/plugins/hoster/VidPlayNet.py delete mode 100644 module/plugins/hoster/VimeoCom.py delete mode 100644 module/plugins/hoster/Vipleech4uCom.py delete mode 100644 module/plugins/hoster/WarserverCz.py delete mode 100644 module/plugins/hoster/WebshareCz.py delete mode 100644 module/plugins/hoster/WrzucTo.py delete mode 100644 module/plugins/hoster/WuploadCom.py delete mode 100644 module/plugins/hoster/X7To.py delete mode 100644 module/plugins/hoster/XFileSharingPro.py delete mode 100644 module/plugins/hoster/XHamsterCom.py delete mode 100644 module/plugins/hoster/XVideosCom.py delete mode 100644 module/plugins/hoster/Xdcc.py delete mode 100644 module/plugins/hoster/YibaishiwuCom.py delete mode 100644 module/plugins/hoster/YoupornCom.py delete mode 100644 module/plugins/hoster/YourfilesTo.py delete mode 100644 module/plugins/hoster/YoutubeCom.py delete mode 100644 module/plugins/hoster/ZDF.py delete mode 100644 module/plugins/hoster/ZeveraCom.py delete mode 100644 module/plugins/hoster/ZippyshareCom.py delete mode 100644 module/plugins/hoster/__init__.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py deleted file mode 100644 index 7201f1929..000000000 --- a/module/plugins/hoster/AlldebridCom.py +++ /dev/null @@ -1,87 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from random import randrange -from urllib import unquote - -from module.common.json_layer import json_loads -from module.plugins.Hoster import Hoster -from module.utils import parseFileSize - - -class AlldebridCom(Hoster): - __name__ = "AlldebridCom" - __type__ = "hoster" - __version__ = "0.34" - - __pattern__ = r'https?://(?:[^/]*\.)?alldebrid\..*' - - __description__ = """Alldebrid.com hoster plugin""" - __author_name__ = "Andy Voigt" - __author_mail__ = "spamsales@online.de" - - - def getFilename(self, url): - try: - name = unquote(url.rsplit("/", 1)[1]) - except IndexError: - name = "Unknown_Filename..." - if name.endswith("..."): # incomplete filename, append random stuff - name += "%s.tmp" % randrange(100, 999) - return name - - def setup(self): - self.chunkLimit = 16 - self.resumeDownload = True - - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - elif not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "AllDebrid") - self.fail("No AllDebrid account provided") - else: - self.logDebug("Old URL: %s" % pyfile.url) - password = self.getPassword().splitlines() - password = "" if not password else password[0] - - url = "http://www.alldebrid.com/service.php?link=%s&json=true&pw=%s" % (pyfile.url, password) - page = self.load(url) - data = json_loads(page) - - self.logDebug("Json data: %s" % str(data)) - - if data['error']: - if data['error'] == "This link isn't available on the hoster website.": - self.offline() - else: - self.logWarning(data['error']) - self.tempOffline() - else: - if pyfile.name and not pyfile.name.endswith('.tmp'): - pyfile.name = data['filename'] - pyfile.size = parseFileSize(data['filesize']) - new_url = data['link'] - - if self.getConfig("https"): - new_url = new_url.replace("http://", "https://") - else: - new_url = new_url.replace("https://", "http://") - - if new_url != pyfile.url: - self.logDebug("New URL: %s" % new_url) - - if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): - #only use when name wasnt already set - pyfile.name = self.getFilename(new_url) - - self.download(new_url, disposition=True) - - check = self.checkDownload({"error": "An error occured while processing your request", - "empty": re.compile(r"^$")}) - - if check == "error": - self.retry(wait_time=60, reason="An error occured while generating link.") - elif check == "empty": - self.retry(wait_time=60, reason="Downloaded File was empty.") diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py deleted file mode 100644 index 54d789054..000000000 --- a/module/plugins/hoster/BasePlugin.py +++ /dev/null @@ -1,116 +0,0 @@ -# -*- coding: utf-8 -*- - -from re import match, search -from urllib import unquote -from urlparse import urlparse - -from module.network.HTTPRequest import BadHeader -from module.plugins.Hoster import Hoster -from module.utils import html_unescape, remove_chars - - -class BasePlugin(Hoster): - __name__ = "BasePlugin" - __type__ = "hoster" - __version__ = "0.20" - - __pattern__ = r'^unmatchable$' - - __description__ = """Base Plugin when any other didnt fit""" - __author_name__ = "RaNaN" - __author_mail__ = "RaNaN@pyload.org" - - - def setup(self): - self.chunkLimit = -1 - self.resumeDownload = True - - def process(self, pyfile): - """main function""" - - #debug part, for api exerciser - if pyfile.url.startswith("DEBUG_API"): - self.multiDL = False - return - - # self.__name__ = "NetloadIn" - # pyfile.name = "test" - # self.html = self.load("http://localhost:9000/short") - # self.download("http://localhost:9000/short") - # self.api = self.load("http://localhost:9000/short") - # self.decryptCaptcha("http://localhost:9000/captcha") - # - # if pyfile.url == "79": - # self.core.api.addPackage("test", [str(i) for i in xrange(80)], 1) - # - # return - if pyfile.url.startswith("http"): - - try: - self.downloadFile(pyfile) - except BadHeader, e: - if e.code in (401, 403): - self.logDebug("Auth required") - - account = self.core.accountManager.getAccountPlugin('Http') - servers = [x['login'] for x in account.getAllAccounts()] - server = urlparse(pyfile.url).netloc - - if server in servers: - self.logDebug("Logging on to %s" % server) - self.req.addAuth(account.accounts[server]['password']) - else: - for pwd in pyfile.package().password.splitlines(): - if ":" in pwd: - self.req.addAuth(pwd.strip()) - break - else: - self.fail(_("Authorization required (username:password)")) - - self.downloadFile(pyfile) - else: - raise - - else: - self.fail("No Plugin matched and not a downloadable url.") - - def downloadFile(self, pyfile): - url = pyfile.url - - for _ in xrange(5): - header = self.load(url, just_header=True) - - # self.load does not raise a BadHeader on 404 responses, do it here - if 'code' in header and header['code'] == 404: - raise BadHeader(404) - - if 'location' in header: - self.logDebug("Location: " + header['location']) - base = match(r'https?://[^/]+', url).group(0) - if header['location'].startswith("http"): - url = header['location'] - elif header['location'].startswith("/"): - url = base + unquote(header['location']) - else: - url = '%s/%s' % (base, unquote(header['location'])) - else: - break - - name = html_unescape(unquote(urlparse(url).path.split("/")[-1])) - - if 'content-disposition' in header: - self.logDebug("Content-Disposition: " + header['content-disposition']) - m = search("filename(?P=|\*=(?P.+)'')(?P.*)", header['content-disposition']) - if m: - disp = m.groupdict() - self.logDebug(disp) - if not disp['enc']: - disp['enc'] = 'utf-8' - name = remove_chars(disp['name'], "\"';").strip() - name = unicode(unquote(name), disp['enc']) - - if not name: - name = url - pyfile.name = name - self.logDebug("Filename: %s" % pyfile.name) - self.download(url, disposition=True) diff --git a/module/plugins/hoster/BayfilesCom.py b/module/plugins/hoster/BayfilesCom.py deleted file mode 100644 index dc7e8cbf0..000000000 --- a/module/plugins/hoster/BayfilesCom.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import time - -from module.common.json_layer import json_loads -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class BayfilesCom(SimpleHoster): - __name__ = "BayfilesCom" - __type__ = "hoster" - __version__ = "0.07" - - __pattern__ = r'https?://(?:www\.)?bayfiles\.(com|net)/file/(?P[a-zA-Z0-9]+/[a-zA-Z0-9]+/[^/]+)' - - __description__ = """Bayfiles.com hoster plugin""" - __author_name__ = ("zoidberg", "Walter Purcaro") - __author_mail__ = ("zoidberg@mujmail.cz", "vuolter@gmail.com") - - FILE_INFO_PATTERN = r'

[^<]*(?P[0-9., ]+)(?P[kKMG])i?B

' - OFFLINE_PATTERN = r'(

The requested file could not be found.

|404 Not Found)' - - WAIT_PATTERN = r'>Your IP [0-9.]* has recently downloaded a file\. Upgrade to premium or wait (\d+) minutes\.<' - VARS_PATTERN = r'var vfid = (\d+);\s*var delay = (\d+);' - FREE_LINK_PATTERN = r"javascript:window.location.href = '([^']+)';" - PREMIUM_LINK_PATTERN = r'(?:BayFiles"), - "notfound": re.compile(r"404 Not Found") - }) - if check == "waitforfreeslots": - self.retry(30, 5 * 60, "Wait for free slot") - elif check == "notfound": - self.retry(30, 5 * 60, "404 Not found") - - -getInfo = create_getInfo(BayfilesCom) diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py deleted file mode 100644 index 7156db473..000000000 --- a/module/plugins/hoster/BezvadataCz.py +++ /dev/null @@ -1,87 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class BezvadataCz(SimpleHoster): - __name__ = "BezvadataCz" - __type__ = "hoster" - __version__ = "0.24" - - __pattern__ = r'http://(?:www\.)?bezvadata.cz/stahnout/.*' - - __description__ = """BezvaData.cz hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - FILE_NAME_PATTERN = r'

Soubor: (?P[^<]+)

' - FILE_SIZE_PATTERN = r'
  • Velikost: (?P[^<]+)
  • ' - OFFLINE_PATTERN = r'BezvaData \| Soubor nenalezen' - - - def setup(self): - self.multiDL = self.resumeDownload = True - - def handleFree(self): - #download button - m = re.search(r'
    ', self.html) - if m is None: - self.parseError("page2 URL") - url = "http://bezvadata.cz%s" % m.group(1) - self.logDebug("DL URL %s" % url) - - #countdown - m = re.search(r'id="countdown">(\d\d):(\d\d)<', self.html) - wait_time = (int(m.group(1)) * 60 + int(m.group(2)) + 1) if m else 120 - self.wait(wait_time, False) - - self.download(url) - - def checkErrors(self): - if 'images/button-download-disable.png' in self.html: - self.longWait(5 * 60, 24) # parallel dl limit - elif '
    Filename:(?P.*?)
    ' - FILE_SIZE_PATTERN = r'Size:(?P.*?)
    ' - - -getInfo = create_getInfo(BillionuploadsCom) diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py deleted file mode 100644 index 3c84ce5da..000000000 --- a/module/plugins/hoster/BitshareCom.py +++ /dev/null @@ -1,151 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import with_statement - -import re - -from module.plugins.internal.CaptchaService import ReCaptcha -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class BitshareCom(SimpleHoster): - __name__ = "BitshareCom" - __type__ = "hoster" - __version__ = "0.50" - - __pattern__ = r'http://(?:www\.)?bitshare\.com/(files/(?P[a-zA-Z0-9]+)(/(?P.*?)\.html)?|\?f=(?P[a-zA-Z0-9]+))' - - __description__ = """Bitshare.com hoster plugin""" - __author_name__ = ("Paul King", "fragonib") - __author_mail__ = ("", "fragonib[AT]yahoo[DOT]es") - - FILE_INFO_PATTERN = r'Downloading (?P.+) - (?P[\d.]+) (?P\w+)' - OFFLINE_PATTERN = r'(>We are sorry, but the requested file was not found in our database|>Error - File not available<|The file was deleted either by the uploader, inactivity or due to copyright claim)' - - FILE_AJAXID_PATTERN = r'var ajaxdl = "(.*?)";' - CAPTCHA_KEY_PATTERN = r'http://api\.recaptcha\.net/challenge\?k=(.*?) ' - TRAFFIC_USED_UP = r'Your Traffic is used up for today. Upgrade to premium to continue!' - - - def setup(self): - self.req.cj.setCookie(".bitshare.com", "language_selection", "EN") - self.multiDL = self.premium - self.chunkLimit = 1 - - def process(self, pyfile): - if self.premium: - self.account.relogin(self.user) - - self.pyfile = pyfile - - # File id - m = re.match(self.__pattern__, pyfile.url) - self.file_id = max(m.group('id1'), m.group('id2')) - self.logDebug("File id is [%s]" % self.file_id) - - # Load main page - self.html = self.load(pyfile.url, ref=False, decode=True) - - # Check offline - if re.search(self.OFFLINE_PATTERN, self.html): - self.offline() - - # Check Traffic used up - if re.search(self.TRAFFIC_USED_UP, self.html): - self.logInfo("Your Traffic is used up for today") - self.wait(30 * 60, True) - self.retry() - - # File name - m = re.match(self.__pattern__, pyfile.url) - name1 = m.group('name') if m else None - m = re.search(self.FILE_INFO_PATTERN, self.html) - name2 = m.group('N') if m else None - pyfile.name = max(name1, name2) - - # Ajax file id - self.ajaxid = re.search(self.FILE_AJAXID_PATTERN, self.html).group(1) - self.logDebug("File ajax id is [%s]" % self.ajaxid) - - # This may either download our file or forward us to an error page - url = self.getDownloadUrl() - self.logDebug("Downloading file with url [%s]" % url) - self.download(url) - - check = self.checkDownload({"404": ">404 Not Found<", "Error": ">Error occured<"}) - if check == "404": - self.retry(3, 60, 'Error 404') - elif check == "error": - self.retry(5, 5 * 60, "Bitshare host : Error occured") - - def getDownloadUrl(self): - # Return location if direct download is active - if self.premium: - header = self.load(self.pyfile.url, cookies=True, just_header=True) - if 'location' in header: - return header['location'] - - # Get download info - self.logDebug("Getting download info") - response = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", - post={"request": "generateID", "ajaxid": self.ajaxid}) - self.handleErrors(response, ':') - parts = response.split(":") - filetype = parts[0] - wait = int(parts[1]) - captcha = int(parts[2]) - self.logDebug("Download info [type: '%s', waiting: %d, captcha: %d]" % (filetype, wait, captcha)) - - # Waiting - if wait > 0: - self.logDebug("Waiting %d seconds." % wait) - if wait < 120: - self.wait(wait, False) - else: - self.wait(wait - 55, True) - self.retry() - - # Resolve captcha - if captcha == 1: - self.logDebug("File is captcha protected") - id = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group(1) - # Try up to 3 times - for i in xrange(3): - self.logDebug("Resolving ReCaptcha with key [%s], round %d" % (id, i + 1)) - recaptcha = ReCaptcha(self) - challenge, code = recaptcha.challenge(id) - response = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", - post={"request": "validateCaptcha", "ajaxid": self.ajaxid, - "recaptcha_challenge_field": challenge, "recaptcha_response_field": code}) - if self.handleCaptchaErrors(response): - break - - # Get download URL - self.logDebug("Getting download url") - response = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", - post={"request": "getDownloadURL", "ajaxid": self.ajaxid}) - self.handleErrors(response, '#') - url = response.split("#")[-1] - - return url - - def handleErrors(self, response, separator): - self.logDebug("Checking response [%s]" % response) - if "ERROR:Session timed out" in response: - self.retry() - elif "ERROR" in response: - msg = response.split(separator)[-1] - self.fail(msg) - - def handleCaptchaErrors(self, response): - self.logDebug("Result of captcha resolving [%s]" % response) - if "SUCCESS" in response: - self.correctCaptcha() - return True - elif "ERROR:SESSION ERROR" in response: - self.retry() - self.logDebug("Wrong captcha") - self.invalidCaptcha() - - -getInfo = create_getInfo(BitshareCom) diff --git a/module/plugins/hoster/BoltsharingCom.py b/module/plugins/hoster/BoltsharingCom.py deleted file mode 100644 index d038c50ca..000000000 --- a/module/plugins/hoster/BoltsharingCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class BoltsharingCom(DeadHoster): - __name__ = "BoltsharingCom" - __type__ = "hoster" - __version__ = "0.02" - - __pattern__ = r'http://(?:www\.)?boltsharing.com/\w{12}' - - __description__ = """Boltsharing.com hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - -getInfo = create_getInfo(BoltsharingCom) diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py deleted file mode 100644 index 4bbdfce89..000000000 --- a/module/plugins/hoster/CatShareNet.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.CaptchaService import ReCaptcha -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class CatShareNet(SimpleHoster): - __name__ = "CatShareNet" - __type__ = "hoster" - __version__ = "0.01" - - __pattern__ = r'http://(?:www\.)?catshare.net/\w{16}.*' - - __description__ = """CatShare.net hoster plugin""" - __author_name__ = "z00nx" - __author_mail__ = "z00nx0@gmail.com" - - FILE_INFO_PATTERN = r'

    ]+>(?P.*)

    \s+

    ]+>(?P.*)

    ' - OFFLINE_PATTERN = r'Podany plik zosta' - - SECONDS_PATTERN = r'var\s+count\s+=\s+(\d+);' - - RECAPTCHA_KEY = "6Lfln9kSAAAAANZ9JtHSOgxUPB9qfDFeLUI_QMEy" - - - def handleFree(self): - m = re.search(self.SECONDS_PATTERN, self.html) - seconds = int(m.group(1)) - self.logDebug("Seconds found", seconds) - self.wait(seconds + 1) - recaptcha = ReCaptcha(self) - challenge, code = recaptcha.challenge(self.RECAPTCHA_KEY) - post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": code} - self.download(self.pyfile.url, post=post_data) - check = self.checkDownload({"html": re.compile("\A\s*(?P.*?).*?\s*\((?P.*?)\)' - LINK_PATTERN = r'href="(http://cramit.in/file_download/.*?)"' - - - def setup(self): - self.resumeDownload = self.multiDL = self.premium - - -getInfo = create_getInfo(CramitIn) diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py deleted file mode 100644 index 80d9b3d61..000000000 --- a/module/plugins/hoster/CrockoCom.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.CaptchaService import ReCaptcha -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class CrockoCom(SimpleHoster): - __name__ = "CrockoCom" - __type__ = "hoster" - __version__ = "0.16" - - __pattern__ = r'http://(?:www\.)?(crocko|easy-share).com/\w+' - - __description__ = """Crocko hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - FILE_NAME_PATTERN = r'Download:\s*(?P.*)' - FILE_SIZE_PATTERN = r'(?P[^<]+)' - OFFLINE_PATTERN = r"

    Sorry,
    the page you're looking for
    isn't here.

    |File not found" - - CAPTCHA_URL_PATTERN = re.compile(r"u='(/file_contents/captcha/\w+)';\s*w='(\d+)';") - CAPTCHA_KEY_PATTERN = re.compile(r'Recaptcha.create\("([^"]+)"') - - FORM_PATTERN = r'
    (.*?)
    ' - FORM_INPUT_PATTERN = r']* name="?([^" ]+)"? value="?([^" ]+)"?[^>]*>' - - FILE_NAME_REPLACEMENTS = [(r'<[^>]*>', '')] - - - def handleFree(self): - if "You need Premium membership to download this file." in self.html: - self.fail("You need Premium membership to download this file.") - - for _ in xrange(5): - m = re.search(self.CAPTCHA_URL_PATTERN, self.html) - if m: - url, wait_time = 'http://crocko.com' + m.group(1), m.group(2) - self.wait(wait_time) - self.html = self.load(url) - else: - break - - m = re.search(self.CAPTCHA_KEY_PATTERN, self.html) - if m is None: - self.parseError('Captcha KEY') - captcha_key = m.group(1) - - m = re.search(self.FORM_PATTERN, self.html, re.DOTALL) - if m is None: - self.parseError('ACTION') - action, form = m.groups() - inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) - - recaptcha = ReCaptcha(self) - - for _ in xrange(5): - inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key) - self.download(action, post=inputs) - - check = self.checkDownload({ - "captcha_err": self.CAPTCHA_KEY_PATTERN - }) - - if check == "captcha_err": - self.invalidCaptcha() - else: - break - else: - self.fail('No valid captcha solution received') - - -getInfo = create_getInfo(CrockoCom) diff --git a/module/plugins/hoster/CyberlockerCh.py b/module/plugins/hoster/CyberlockerCh.py deleted file mode 100644 index bfab72b7c..000000000 --- a/module/plugins/hoster/CyberlockerCh.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class CyberlockerCh(DeadHoster): - __name__ = "CyberlockerCh" - __type__ = "hoster" - __version__ = "0.02" - - __pattern__ = r'http://(?:www\.)?cyberlocker\.ch/\w+' - - __description__ = """Cyberlocker.ch hoster plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" - - -getInfo = create_getInfo(CyberlockerCh) diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py deleted file mode 100644 index 4f581651b..000000000 --- a/module/plugins/hoster/CzshareCom.py +++ /dev/null @@ -1,148 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Test links: -# http://czshare.com/5278880/random.bin - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.utils import parseFileSize - - -class CzshareCom(SimpleHoster): - __name__ = "CzshareCom" - __type__ = "hoster" - __version__ = "0.94" - - __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/(\d+/|download.php\?).*' - - __description__ = """CZshare.com hoster plugin, now Sdilej.cz""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - FILE_NAME_PATTERN = r'
    \s*

    \s*Cel. n.zev: ]*>(?P[^<]+)' - FILE_SIZE_PATTERN = r'

    (?:\s*

    [^\n]*

    )*\s*Velikost:\s*(?P[0-9., ]+)(?P[kKMG])i?B\s*
    ' - OFFLINE_PATTERN = r'
    \s*

    ' - - FILE_SIZE_REPLACEMENTS = [(' ', '')] - FILE_URL_REPLACEMENTS = [(r'http://[^/]*/download.php\?.*?id=(\w+).*', r'http://sdilej.cz/\1/x/')] - - SH_CHECK_TRAFFIC = True - - FREE_URL_PATTERN = r'[^>]*alt="([^"]+)" />' - FREE_FORM_PATTERN = r'
    \s*(.*?)
    ' - PREMIUM_FORM_PATTERN = r'
    (.*?)
    ' - FORM_INPUT_PATTERN = r']* name="([^"]+)" value="([^"]+)"[^>]*/>' - MULTIDL_PATTERN = r"

    Z[^<]*PROFI.

    " - USER_CREDIT_PATTERN = r'
    \s*kredit: ([0-9., ]+)([kKMG]i?B)\s*
    ' - - - def checkTrafficLeft(self): - # check if user logged in - m = re.search(self.USER_CREDIT_PATTERN, self.html) - if m is None: - self.account.relogin(self.user) - self.html = self.load(self.pyfile.url, cookies=True, decode=True) - m = re.search(self.USER_CREDIT_PATTERN, self.html) - if m is None: - return False - - # check user credit - try: - credit = parseFileSize(m.group(1).replace(' ', ''), m.group(2)) - self.logInfo("Premium download for %i KiB of Credit" % (self.pyfile.size / 1024)) - self.logInfo("User %s has %i KiB left" % (self.user, credit / 1024)) - if credit < self.pyfile.size: - self.logInfo("Not enough credit to download file %s" % self.pyfile.name) - return False - except Exception, e: - # let's continue and see what happens... - self.logError('Parse error (CREDIT): %s' % e) - - return True - - def handlePremium(self): - # parse download link - try: - form = re.search(self.PREMIUM_FORM_PATTERN, self.html, re.DOTALL).group(1) - inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) - except Exception, e: - self.logError("Parse error (FORM): %s" % e) - self.resetAccount() - - # download the file, destination is determined by pyLoad - self.download("http://sdilej.cz/profi_down.php", post=inputs, disposition=True) - self.checkDownloadedFile() - - def handleFree(self): - # get free url - m = re.search(self.FREE_URL_PATTERN, self.html) - if m is None: - self.parseError('Free URL') - parsed_url = "http://sdilej.cz" + m.group(1) - self.logDebug("PARSED_URL:" + parsed_url) - - # get download ticket and parse html - self.html = self.load(parsed_url, cookies=True, decode=True) - if re.search(self.MULTIDL_PATTERN, self.html): - self.longWait(5 * 60, 12) - - try: - form = re.search(self.FREE_FORM_PATTERN, self.html, re.DOTALL).group(1) - inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) - self.pyfile.size = int(inputs['size']) - except Exception, e: - self.logError(e) - self.parseError('Form') - - # get and decrypt captcha - captcha_url = 'http://sdilej.cz/captcha.php' - for _ in xrange(5): - inputs['captchastring2'] = self.decryptCaptcha(captcha_url) - self.html = self.load(parsed_url, cookies=True, post=inputs, decode=True) - if u"
  • Zadaný ověřovací kód nesouhlasí!
  • " in self.html: - self.invalidCaptcha() - elif re.search(self.MULTIDL_PATTERN, self.html): - self.longWait(5 * 60, 12) - else: - self.correctCaptcha() - break - else: - self.fail("No valid captcha code entered") - - m = re.search("countdown_number = (\d+);", self.html) - self.setWait(int(m.group(1)) if m else 50) - - # download the file, destination is determined by pyLoad - self.logDebug("WAIT URL", self.req.lastEffectiveURL) - m = re.search("free_wait.php\?server=(.*?)&(.*)", self.req.lastEffectiveURL) - if m is None: - self.parseError('Download URL') - - url = "http://%s/download.php?%s" % (m.group(1), m.group(2)) - - self.wait() - self.download(url) - self.checkDownloadedFile() - - def checkDownloadedFile(self): - # check download - check = self.checkDownload({ - "tempoffline": re.compile(r"^Soubor je do.*asn.* nedostupn.*$"), - "credit": re.compile(r"^Nem.*te dostate.*n.* kredit.$"), - "multi_dl": re.compile(self.MULTIDL_PATTERN), - "captcha_err": "
  • Zadaný ověřovací kód nesouhlasí!
  • " - }) - - if check == "tempoffline": - self.fail("File not available - try later") - if check == "credit": - self.resetAccount() - elif check == "multi_dl": - self.longWait(5 * 60, 12) - elif check == "captcha_err": - self.invalidCaptcha() - self.retry() - - -getInfo = create_getInfo(CzshareCom) diff --git a/module/plugins/hoster/DailymotionCom.py b/module/plugins/hoster/DailymotionCom.py deleted file mode 100644 index 79b7acb45..000000000 --- a/module/plugins/hoster/DailymotionCom.py +++ /dev/null @@ -1,111 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.PyFile import statusMap -from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL -from module.plugins.Hoster import Hoster - - -def getInfo(urls): - result = [] #: [ .. (name, size, status, url) .. ] - regex = re.compile(DailymotionCom.__pattern__) - apiurl = "https://api.dailymotion.com/video/" - request = {"fields": "access_error,status,title"} - for url in urls: - id = regex.search(url).group("ID") - page = getURL(apiurl + id, get=request) - info = json_loads(page) - - if "title" in info: - name = info['title'] + ".mp4" - else: - name = url - - if "error" in info or info['access_error']: - status = "offline" - else: - status = info['status'] - if status in ("ready", "published"): - status = "online" - elif status in ("waiting", "processing"): - status = "temp. offline" - else: - status = "offline" - - result.append((name, 0, statusMap[status], url)) - return result - - -class DailymotionCom(Hoster): - __name__ = "DailymotionCom" - __type__ = "hoster" - __version__ = "0.2" - - __pattern__ = r'https?://(?:www\.)?dailymotion\.com/.*?video/(?P[\w^_]+)' - __config__ = [("quality", "Lowest;LD 144p;LD 240p;SD 384p;HQ 480p;HD 720p;HD 1080p;Highest", "Quality", "Highest")] - - __description__ = """Dailymotion.com hoster plugin""" - __author_name__ = "Walter Purcaro" - __author_mail__ = "vuolter@gmail.com" - - - def setup(self): - self.resumeDownload = self.multiDL = True - - def getStreams(self): - streams = [] - for result in re.finditer(r"\"(?Phttp:\\/\\/www.dailymotion.com\\/cdn\\/H264-(?P.*?)\\.*?)\"", - self.html): - url = result.group("URL") - qf = result.group("QF") - link = url.replace("\\", "") - quality = tuple(int(x) for x in qf.split("x")) - streams.append((quality, link)) - return sorted(streams, key=lambda x: x[0][::-1]) - - def getQuality(self): - q = self.getConfig("quality") - if q == "Lowest": - quality = 0 - elif q == "Highest": - quality = -1 - else: - quality = int(q.rsplit(" ")[1][:-1]) - return quality - - def getLink(self, streams, quality): - if quality > 0: - for x, s in reversed([item for item in enumerate(streams)]): - qf = s[0][1] - if qf <= quality: - idx = x - break - else: - idx = 0 - else: - idx = quality - - s = streams[idx] - self.logInfo("Download video quality %sx%s" % s[0]) - return s[1] - - def checkInfo(self, pyfile): - pyfile.name, pyfile.size, pyfile.status, pyfile.url = getInfo([pyfile.url])[0] - if pyfile.status == 1: - self.offline() - elif pyfile.status == 6: - self.tempOffline() - - def process(self, pyfile): - self.checkInfo(pyfile) - - id = re.match(self.__pattern__, pyfile.url).group("ID") - self.html = self.load("http://www.dailymotion.com/embed/video/" + id, decode=True) - - streams = self.getStreams() - quality = self.getQuality() - link = self.getLink(streams, quality) - - self.download(link) diff --git a/module/plugins/hoster/DataHu.py b/module/plugins/hoster/DataHu.py deleted file mode 100644 index 3dc01eef3..000000000 --- a/module/plugins/hoster/DataHu.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Test links: -# http://data.hu/get/6381232/random.bin - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class DataHu(SimpleHoster): - __name__ = "DataHu" - __type__ = "hoster" - __version__ = "0.01" - - __pattern__ = r'http://(?:www\.)?data.hu/get/\w+' - - __description__ = """Data.hu hoster plugin""" - __author_name__ = ("crash", "stickell") - __author_mail__ = "l.stickell@yahoo.it" - - FILE_INFO_PATTERN = ur'(?P<N>.*) \((?P<S>[^)]+)\) let\xf6lt\xe9se' - OFFLINE_PATTERN = ur'Az adott f\xe1jl nem l\xe9tezik' - LINK_PATTERN = r'
    ' - - - def handleFree(self): - self.resumeDownload = True - self.html = self.load(self.pyfile.url, decode=True) - - m = re.search(self.LINK_PATTERN, self.html) - if m: - url = m.group(1) - self.logDebug('Direct link: ' + url) - else: - self.parseError('Unable to get direct link') - - self.download(url, disposition=True) - - -getInfo = create_getInfo(DataHu) diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py deleted file mode 100644 index 56b2c2398..000000000 --- a/module/plugins/hoster/DataportCz.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class DataportCz(SimpleHoster): - __name__ = "DataportCz" - __type__ = "hoster" - __version__ = "0.37" - - __pattern__ = r'http://(?:www\.)?dataport.cz/file/(.*)' - - __description__ = """Dataport.cz hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - FILE_NAME_PATTERN = r'(?P[^<]+)' - FILE_SIZE_PATTERN = r'Velikost\s*(?P[^<]+)' - OFFLINE_PATTERN = r'

    Soubor nebyl nalezen

    ' - - FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.dataport.cz/file/\1')] - - CAPTCHA_URL_PATTERN = r'
    \s*(\d+)
    ' - - - def handleFree(self): - captchas = {"1": "jkeG", "2": "hMJQ", "3": "vmEK", "4": "ePQM", "5": "blBd"} - - for _ in xrange(60): - action, inputs = self.parseHtmlForm('free_download_form') - self.logDebug(action, inputs) - if not action or not inputs: - self.parseError('free_download_form') - - if "captchaId" in inputs and inputs['captchaId'] in captchas: - inputs['captchaCode'] = captchas[inputs['captchaId']] - else: - self.parseError('captcha') - - self.html = self.download("http://www.dataport.cz%s" % action, post=inputs) - - check = self.checkDownload({"captcha": 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");', - "slot": 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'}) - if check == "captcha": - self.parseError('invalid captcha') - elif check == "slot": - self.logDebug("No free slots - wait 60s and retry") - self.wait(60, False) - self.html = self.load(self.pyfile.url, decode=True) - continue - else: - break - - -create_getInfo(DataportCz) diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py deleted file mode 100644 index ff8c430ee..000000000 --- a/module/plugins/hoster/DateiTo.py +++ /dev/null @@ -1,83 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.CaptchaService import ReCaptcha -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class DateiTo(SimpleHoster): - __name__ = "DateiTo" - __type__ = "hoster" - __version__ = "0.02" - - __pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P\w+)\.html' - - __description__ = """Datei.to hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - FILE_NAME_PATTERN = r'Dateiname:\s*(?P.*?)\s*(?P.*?)Datei wurde nicht gefunden<|>Bitte wähle deine Datei aus... <' - PARALELL_PATTERN = r'>Du lädst bereits eine Datei herunter<' - - WAIT_PATTERN = r'countdown\({seconds: (\d+)' - DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",' - RECAPTCHA_KEY_PATTERN = r'Recaptcha.create\("(.*?)"' - - - def handleFree(self): - url = 'http://datei.to/ajax/download.php' - data = {'P': 'I', 'ID': self.file_info['ID']} - - recaptcha = ReCaptcha(self) - - for _ in xrange(10): - self.logDebug("URL", url, "POST", data) - self.html = self.load(url, post=data) - self.checkErrors() - - if url.endswith('download.php') and 'P' in data: - if data['P'] == 'I': - self.doWait() - - elif data['P'] == 'IV': - break - - m = re.search(self.DATA_PATTERN, self.html) - if m is None: - self.parseError('data') - url = 'http://datei.to/' + m.group(1) - data = dict(x.split('=') for x in m.group(2).split('&')) - - if url.endswith('recaptcha.php'): - m = re.search(self.RECAPTCHA_KEY_PATTERN, self.html) - recaptcha_key = m.group(1) if m else "6LdBbL8SAAAAAI0vKUo58XRwDd5Tu_Ze1DA7qTao" - - data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge(recaptcha_key) - - else: - self.fail('Too bad...') - - download_url = self.html - self.logDebug('Download URL', download_url) - self.download(download_url) - - def checkErrors(self): - m = re.search(self.PARALELL_PATTERN, self.html) - if m: - m = re.search(self.WAIT_PATTERN, self.html) - wait_time = int(m.group(1)) if m else 30 - self.wait(wait_time + 1, False) - self.retry() - - def doWait(self): - m = re.search(self.WAIT_PATTERN, self.html) - wait_time = int(m.group(1)) if m else 30 - - self.load('http://datei.to/ajax/download.php', post={'P': 'Ads'}) - self.wait(wait_time + 1, False) - - -getInfo = create_getInfo(DateiTo) diff --git a/module/plugins/hoster/DdlstorageCom.py b/module/plugins/hoster/DdlstorageCom.py deleted file mode 100644 index 4d77289d7..000000000 --- a/module/plugins/hoster/DdlstorageCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class DdlstorageCom(DeadHoster): - __name__ = "DdlstorageCom" - __type__ = "hoster" - __version__ = "1.02" - - __pattern__ = r'https?://(?:www\.)?ddlstorage\.com/\w+' - - __description__ = """DDLStorage.com hoster plugin""" - __author_name__ = ("zoidberg", "stickell") - __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") - - -getInfo = create_getInfo(DdlstorageCom) diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py deleted file mode 100644 index 5880b2738..000000000 --- a/module/plugins/hoster/DebridItaliaCom.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.Hoster import Hoster - - -class DebridItaliaCom(Hoster): - __name__ = "DebridItaliaCom" - __type__ = "hoster" - __version__ = "0.05" - - __pattern__ = r'https?://(?:[^/]*\.)?debriditalia\.com' - - __description__ = """Debriditalia.com hoster plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" - - - def setup(self): - self.chunkLimit = -1 - self.resumeDownload = True - - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - elif not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "DebridItalia") - self.fail("No DebridItalia account provided") - else: - self.logDebug("Old URL: %s" % pyfile.url) - url = "http://debriditalia.com/linkgen2.php?xjxfun=convertiLink&xjxargs[]=S" % pyfile.url - page = self.load(url) - self.logDebug("XML data: %s" % page) - - if 'File not available' in page: - self.fail('File not available') - else: - new_url = re.search(r'
    (?P[^<]+)', page).group('direct') - - if new_url != pyfile.url: - self.logDebug("New URL: %s" % new_url) - - self.download(new_url, disposition=True) - - check = self.checkDownload({"empty": re.compile(r"^$")}) - - if check == "empty": - self.retry(5, 2 * 60, "Empty file downloaded") diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py deleted file mode 100644 index e2b2d46fd..000000000 --- a/module/plugins/hoster/DepositfilesCom.py +++ /dev/null @@ -1,129 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from urllib import unquote - -from module.plugins.internal.CaptchaService import ReCaptcha -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class DepositfilesCom(SimpleHoster): - __name__ = "DepositfilesCom" - __type__ = "hoster" - __version__ = "0.48" - - __pattern__ = r'https?://(?:www\.)?(depositfiles\.com|dfiles\.(eu|ru))(/\w{1,3})?/files/(?P\w+)' - - __description__ = """Depositfiles.com hoster plugin""" - __author_name__ = ("spoob", "zoidberg", "Walter Purcaro") - __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz", "vuolter@gmail.com") - - FILE_NAME_PATTERN = r'' - - - def process(self, pyfile): - self.html = self.load(pyfile.url, decode=True) - self.getFileInfo() - - # parse js variables - self.jsvars = dict((x, y.strip("'")) for x, y in re.findall(r"var (\w+) = ([0-9.]+|'[^']*')", self.html)) - self.logDebug(self.jsvars) - pyfile.name = self.jsvars['ID3'] - - # determine download type - free or premium - if self.premium: - if 'UU_prihlasen' in self.jsvars: - if self.jsvars['UU_prihlasen'] == '0': - self.logWarning('User not logged in') - self.relogin(self.user) - self.retry() - elif float(self.jsvars['UU_kredit']) < float(self.jsvars['kredit_odecet']): - self.logWarning('Not enough credit left') - self.premium = False - - if self.premium: - self.handlePremium() - else: - self.handleFree() - - check = self.checkDownload({"err": re.compile(r"\AChyba!")}, max_size=100) - if check == "err": - self.fail("File not m or plugin defect") - - def handleFree(self): - # get download url - download_url = '%s/download.php' % self.jsvars['server'] - data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ("ID1", "ID2", "ID3", "ID4")) - self.logDebug("FREE URL1:" + download_url, data) - - self.req.http.c.setopt(FOLLOWLOCATION, 0) - self.load(download_url, post=data) - self.header = self.req.http.header - self.req.http.c.setopt(FOLLOWLOCATION, 1) - - m = re.search("Location\s*:\s*(.*)", self.header, re.I) - if m is None: - self.fail('File not found') - download_url = m.group(1) - self.logDebug("FREE URL2:" + download_url) - - # check errors - m = re.search(r'/chyba/(\d+)', download_url) - if m: - if m.group(1) == '1': - self.retry(60, 2 * 60, "This IP is already downloading") - elif m.group(1) == '2': - self.retry(60, 60, "No free slots available") - else: - self.fail('Error %d' % m.group(1)) - - # download file - self.download(download_url) - - def handlePremium(self): - download_url = '%s/download_premium.php' % self.jsvars['server'] - data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ("ID1", "ID2", "ID4", "ID5")) - self.logDebug("PREMIUM URL:" + download_url, data) - self.download(download_url, get=data) - - -getInfo = create_getInfo(QuickshareCz) diff --git a/module/plugins/hoster/RPNetBiz.py b/module/plugins/hoster/RPNetBiz.py deleted file mode 100644 index 47f255074..000000000 --- a/module/plugins/hoster/RPNetBiz.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.Hoster import Hoster -from module.common.json_layer import json_loads - - -class RPNetBiz(Hoster): - __name__ = "RPNetBiz" - __type__ = "hoster" - __version__ = "0.1" - - __description__ = """RPNet.biz hoster plugin""" - - __pattern__ = r'https?://.*rpnet\.biz' - __author_name__ = "Dman" - __author_mail__ = "dmanugm@gmail.com" - - - def setup(self): - self.chunkLimit = -1 - self.resumeDownload = True - - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - link_status = {'generated': pyfile.url} - elif not self.account: - # Check account - self.logError(_("Please enter your %s account or deactivate this plugin") % "rpnet") - self.fail("No rpnet account provided") - else: - (user, data) = self.account.selectAccount() - - self.logDebug("Original URL: %s" % pyfile.url) - # Get the download link - response = self.load("https://premium.rpnet.biz/client_api.php", - get={"username": user, "password": data['password'], - "action": "generate", "links": pyfile.url}) - - self.logDebug("JSON data: %s" % response) - link_status = json_loads(response)['links'][0] # get the first link... since we only queried one - - # Check if we only have an id as a HDD link - if 'id' in link_status: - self.logDebug("Need to wait at least 30 seconds before requery") - self.setWait(30) # wait for 30 seconds - self.wait() - # Lets query the server again asking for the status on the link, - # we need to keep doing this until we reach 100 - max_tries = 30 - my_try = 0 - while (my_try <= max_tries): - self.logDebug("Try: %d ; Max Tries: %d" % (my_try, max_tries)) - response = self.load("https://premium.rpnet.biz/client_api.php", - get={"username": user, "password": data['password'], - "action": "downloadInformation", "id": link_status['id']}) - self.logDebug("JSON data hdd query: %s" % response) - download_status = json_loads(response)['download'] - - if download_status['status'] == '100': - link_status['generated'] = download_status['rpnet_link'] - self.logDebug("Successfully downloaded to rpnet HDD: %s" % link_status['generated']) - break - else: - self.logDebug("At %s%% for the file download" % download_status['status']) - - self.setWait(30) - self.wait() - my_try += 1 - - if my_try > max_tries: # We went over the limit! - self.fail("Waited for about 15 minutes for download to finish but failed") - - if 'generated' in link_status: - self.download(link_status['generated'], disposition=True) - elif 'error' in link_status: - self.fail(link_status['error']) - else: - self.fail("Something went wrong, not supposed to enter here") diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py deleted file mode 100644 index ce4d9ab36..000000000 --- a/module/plugins/hoster/RapidgatorNet.py +++ /dev/null @@ -1,191 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from pycurl import HTTPHEADER - -from module.common.json_layer import json_loads -from module.network.HTTPRequest import BadHeader -from module.plugins.hoster.UnrestrictLi import secondsToMidnight -from module.plugins.internal.CaptchaService import AdsCaptcha, ReCaptcha, SolveMedia -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class RapidgatorNet(SimpleHoster): - __name__ = "RapidgatorNet" - __type__ = "hoster" - __version__ = "0.22" - - __pattern__ = r'http://(?:www\.)?(rapidgator\.net|rg\.to)/file/\w+' - - __description__ = """Rapidgator.net hoster plugin""" - __author_name__ = ("zoidberg", "chrox", "stickell", "Walter Purcaro") - __author_mail__ = ("zoidberg@mujmail.cz", "", "l.stickell@yahoo.it", "vuolter@gmail.com") - - API_URL = "http://rapidgator.net/api/file" - - FILE_NAME_PATTERN = r'Download file (?P<N>.*)' - FILE_SIZE_PATTERN = r'File size:\s*(?P[\d\.]+) (?P\w+)' - OFFLINE_PATTERN = r'>(File not found|Error 404)' - - JSVARS_PATTERN = r"\s+var\s*(startTimerUrl|getDownloadUrl|captchaUrl|fid|secs)\s*=\s*'?(.*?)'?;" - PREMIUM_ONLY_ERROR_PATTERN = r'You can download files up to|This file can be downloaded by premium only<' - DOWNLOAD_LIMIT_ERROR_PATTERN = r'You have reached your (daily|hourly) downloads limit' - WAIT_PATTERN = r'(?:Delay between downloads must be not less than|Try again in)\s*(\d+)\s*(hour|min)' - LINK_PATTERN = r"return '(http://\w+.rapidgator.net/.*)';" - - RECAPTCHA_KEY_PATTERN = r'"http://api\.recaptcha\.net/challenge\?k=(.*?)"' - ADSCAPTCHA_SRC_PATTERN = r'(http://api\.adscaptcha\.com/Get\.aspx[^"\']*)' - SOLVEMEDIA_PATTERN = r'http://api\.solvemedia\.com/papi/challenge\.script\?k=(.*?)"' - - - def setup(self): - self.resumeDownload = self.multiDL = self.premium - self.sid = None - self.chunkLimit = 1 - self.req.setOption("timeout", 120) - - def process(self, pyfile): - if self.account: - self.sid = self.account.getAccountData(self.user).get('SID', None) - - if self.sid: - self.handlePremium() - else: - self.handleFree() - - def api_response(self, cmd): - try: - json = self.load('%s/%s' % (self.API_URL, cmd), - get={'sid': self.sid, - 'url': self.pyfile.url}, decode=True) - self.logDebug('API:%s' % cmd, json, "SID: %s" % self.sid) - json = json_loads(json) - status = json['response_status'] - msg = json['response_details'] - except BadHeader, e: - self.logError('API:%s' % cmd, e, "SID: %s" % self.sid) - status = e.code - msg = e - - if status == 200: - return json['response'] - elif status == 423: - self.account.empty(self.user) - self.retry() - else: - self.account.relogin(self.user) - self.retry(wait_time=60) - - def handlePremium(self): - #self.logDebug("ACCOUNT_DATA", self.account.getAccountData(self.user)) - self.api_data = self.api_response('info') - self.api_data['md5'] = self.api_data['hash'] - self.pyfile.name = self.api_data['filename'] - self.pyfile.size = self.api_data['size'] - url = self.api_response('download')['url'] - self.download(url) - - def handleFree(self): - self.html = self.load(self.pyfile.url, decode=True) - - self.checkFree() - - jsvars = dict(re.findall(self.JSVARS_PATTERN, self.html)) - self.logDebug(jsvars) - - self.req.http.lastURL = self.pyfile.url - self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) - - url = "http://rapidgator.net%s?fid=%s" % ( - jsvars.get('startTimerUrl', '/download/AjaxStartTimer'), jsvars['fid']) - jsvars.update(self.getJsonResponse(url)) - - self.wait(int(jsvars.get('secs', 45)) + 1, False) - - url = "http://rapidgator.net%s?sid=%s" % ( - jsvars.get('getDownloadUrl', '/download/AjaxGetDownload'), jsvars['sid']) - jsvars.update(self.getJsonResponse(url)) - - self.req.http.lastURL = self.pyfile.url - self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With:"]) - - url = "http://rapidgator.net%s" % jsvars.get('captchaUrl', '/download/captcha') - self.html = self.load(url) - - for _ in xrange(5): - m = re.search(self.LINK_PATTERN, self.html) - if m: - link = m.group(1) - self.logDebug(link) - self.download(link, disposition=True) - break - else: - captcha, captcha_key = self.getCaptcha() - captcha_challenge, captcha_response = captcha.challenge(captcha_key) - - self.html = self.load(url, post={ - "DownloadCaptchaForm[captcha]": "", - "adcopy_challenge": captcha_challenge, - "adcopy_response": captcha_response - }) - - if "The verification code is incorrect" in self.html: - self.invalidCaptcha() - else: - self.correctCaptcha() - else: - self.parseError("Download link") - - def getCaptcha(self): - m = re.search(self.ADSCAPTCHA_SRC_PATTERN, self.html) - if m: - captcha_key = m.group(1) - captcha = AdsCaptcha(self) - else: - m = re.search(self.RECAPTCHA_KEY_PATTERN, self.html) - if m: - captcha_key = m.group(1) - captcha = ReCaptcha(self) - else: - m = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if m: - captcha_key = m.group(1) - captcha = SolveMedia(self) - else: - self.parseError("Captcha") - - return captcha, captcha_key - - def checkFree(self): - m = re.search(self.PREMIUM_ONLY_ERROR_PATTERN, self.html) - if m: - self.fail("Premium account needed for download") - else: - m = re.search(self.WAIT_PATTERN, self.html) - - if m: - wait_time = int(m.group(1)) * {"hour": 60, "min": 1}[m.group(2)] - else: - m = re.search(self.DOWNLOAD_LIMIT_ERROR_PATTERN, self.html) - if m is None: - return - elif m.group(1) == "daily": - self.logWarning("You have reached your daily downloads limit for today") - wait_time = secondsToMidnight(gmt=2) - else: - wait_time = 1 * 60 * 60 - - self.logDebug("Waiting %d minutes" % wait_time / 60) - self.wait(wait_time, True) - self.retry() - - def getJsonResponse(self, url): - response = self.load(url, decode=True) - if not response.startswith('{'): - self.retry() - self.logDebug(url, response) - return json_loads(response) - - -getInfo = create_getInfo(RapidgatorNet) diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py deleted file mode 100644 index 19d6cf772..000000000 --- a/module/plugins/hoster/RapidshareCom.py +++ /dev/null @@ -1,223 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.network.RequestFactory import getURL -from module.plugins.Hoster import Hoster - - -def getInfo(urls): - ids = "" - names = "" - - p = re.compile(RapidshareCom.__pattern__) - - for url in urls: - r = p.search(url) - if r.group("name"): - ids += "," + r.group("id") - names += "," + r.group("name") - elif r.group("name_new"): - ids += "," + r.group("id_new") - names += "," + r.group("name_new") - - url = "http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=checkfiles&files=%s&filenames=%s" % (ids[1:], names[1:]) - - api = getURL(url) - result = [] - i = 0 - for res in api.split(): - tmp = res.split(",") - if tmp[4] in ("0", "4", "5"): - status = 1 - elif tmp[4] == "1": - status = 2 - else: - status = 3 - - result.append((tmp[1], tmp[2], status, urls[i])) - i += 1 - - yield result - - -class RapidshareCom(Hoster): - __name__ = "RapidshareCom" - __type__ = "hoster" - __version__ = "1.39" - - __pattern__ = r'https?://(?:www\.)?rapidshare.com/(?:files/(?P\d*?)/(?P[^?]+)|#!download\|(?:\w+)\|(?P\d+)\|(?P[^|]+))' - __config__ = [("server", - "Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera", - "Preferred Server", "None")] - - __description__ = """Rapidshare.com hoster plugin""" - __author_name__ = ("spoob", "RaNaN", "mkaay") - __author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "mkaay@mkaay.de") - - - def setup(self): - self.no_download = True - self.api_data = None - self.offset = 0 - self.dl_dict = {} - - self.id = None - self.name = None - - self.chunkLimit = -1 if self.premium else 1 - self.multiDL = self.resumeDownload = self.premium - - def process(self, pyfile): - self.url = pyfile.url - self.prepare() - - def prepare(self): - m = re.match(self.__pattern__, self.url) - - if m.group("name"): - self.id = m.group("id") - self.name = m.group("name") - else: - self.id = m.group("id_new") - self.name = m.group("name_new") - - self.download_api_data() - if self.api_data['status'] == "1": - self.pyfile.name = self.get_file_name() - - if self.premium: - self.handlePremium() - else: - self.handleFree() - - elif self.api_data['status'] == "2": - self.logInfo(_("Rapidshare: Traffic Share (direct download)")) - self.pyfile.name = self.get_file_name() - - self.download(self.pyfile.url, get={"directstart": 1}) - - elif self.api_data['status'] in ("0", "4", "5"): - self.offline() - elif self.api_data['status'] == "3": - self.tempOffline() - else: - self.fail("Unknown response code.") - - def handleFree(self): - while self.no_download: - self.dl_dict = self.freeWait() - - #tmp = "#!download|%(server)s|%(id)s|%(name)s|%(size)s" - download = "http://%(host)s/cgi-bin/rsapi.cgi?sub=download&editparentlocation=0&bin=1&fileid=%(id)s&filename=%(name)s&dlauth=%(auth)s" % self.dl_dict - - self.logDebug("RS API Request: %s" % download) - self.download(download, ref=False) - - check = self.checkDownload({"ip": "You need RapidPro to download more files from your IP address", - "auth": "Download auth invalid"}) - if check == "ip": - self.setWait(60) - self.logInfo(_("Already downloading from this ip address, waiting 60 seconds")) - self.wait() - self.handleFree() - elif check == "auth": - self.logInfo(_("Invalid Auth Code, download will be restarted")) - self.offset += 5 - self.handleFree() - - def handlePremium(self): - info = self.account.getAccountInfo(self.user, True) - self.logDebug("%s: Use Premium Account" % self.__name__) - url = self.api_data['mirror'] - self.download(url, get={"directstart": 1}) - - def download_api_data(self, force=False): - """ - http://images.rapidshare.com/apidoc.txt - """ - if self.api_data and not force: - return - api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" - api_param_file = {"sub": "checkfiles", "incmd5": "1", "files": self.id, "filenames": self.name} - src = self.load(api_url_base, cookies=False, get=api_param_file).strip() - self.logDebug("RS INFO API: %s" % src) - if src.startswith("ERROR"): - return - fields = src.split(",") - - # status codes: - # 0=File not found - # 1=File OK (Anonymous downloading) - # 3=Server down - # 4=File marked as illegal - # 5=Anonymous file locked, because it has more than 10 downloads already - # 50+n=File OK (TrafficShare direct download type "n" without any logging.) - # 100+n=File OK (TrafficShare direct download type "n" with logging. - # Read our privacy policy to see what is logged.) - - self.api_data = {"fileid": fields[0], "filename": fields[1], "size": int(fields[2]), "serverid": fields[3], - "status": fields[4], "shorthost": fields[5], "checksum": fields[6].strip().lower()} - - if int(self.api_data['status']) > 100: - self.api_data['status'] = str(int(self.api_data['status']) - 100) - elif int(self.api_data['status']) > 50: - self.api_data['status'] = str(int(self.api_data['status']) - 50) - - self.api_data['mirror'] = "http://rs%(serverid)s%(shorthost)s.rapidshare.com/files/%(fileid)s/%(filename)s" % self.api_data - - def freeWait(self): - """downloads html with the important information - """ - self.no_download = True - - id = self.id - name = self.name - - prepare = "https://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=download&fileid=%(id)s&filename=%(name)s&try=1&cbf=RSAPIDispatcher&cbid=1" % { - "name": name, "id": id} - - self.logDebug("RS API Request: %s" % prepare) - result = self.load(prepare, ref=False) - self.logDebug("RS API Result: %s" % result) - - between_wait = re.search("You need to wait (\d+) seconds", result) - - if "You need RapidPro to download more files from your IP address" in result: - self.setWait(60) - self.logInfo(_("Already downloading from this ip address, waiting 60 seconds")) - self.wait() - elif ("Too many users downloading from this server right now" in result or - "All free download slots are full" in result): - self.setWait(120) - self.logInfo(_("RapidShareCom: No free slots")) - self.wait() - elif "This file is too big to download it for free" in result: - self.fail(_("You need a premium account for this file")) - elif "Filename invalid." in result: - self.fail(_("Filename reported invalid")) - elif between_wait: - self.setWait(int(between_wait.group(1))) - self.wantReconnect = True - self.wait() - else: - self.no_download = False - - tmp, info = result.split(":") - data = info.split(",") - - dl_dict = {"id": id, - "name": name, - "host": data[0], - "auth": data[1], - "server": self.api_data['serverid'], - "size": self.api_data['size']} - self.setWait(int(data[2]) + 2 + self.offset) - self.wait() - - return dl_dict - - def get_file_name(self): - if self.api_data['filename']: - return self.api_data['filename'] - return self.url.split("/")[-1] diff --git a/module/plugins/hoster/RarefileNet.py b/module/plugins/hoster/RarefileNet.py deleted file mode 100644 index 51df5c882..000000000 --- a/module/plugins/hoster/RarefileNet.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo -from module.utils import html_unescape - - -class RarefileNet(XFileSharingPro): - __name__ = "RarefileNet" - __type__ = "hoster" - __version__ = "0.03" - - __pattern__ = r'http://(?:www\.)?rarefile.net/\w{12}' - - __description__ = """Rarefile.net hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - HOSTER_NAME = "rarefile.net" - - FILE_NAME_PATTERN = r'(?P.*?)' - FILE_SIZE_PATTERN = r'Size : (?P.+?) ' - LINK_PATTERN = r'(?P=link)' - - - def setup(self): - self.resumeDownload = self.multiDL = self.premium - - def handleCaptcha(self, inputs): - captcha_div = re.search(r'Enter code.*?(.*?)
    ', self.html, re.S).group(1) - self.logDebug(captcha_div) - numerals = re.findall('(\d)', html_unescape(captcha_div)) - inputs['code'] = "".join([a[1] for a in sorted(numerals, key=lambda num: int(num[0]))]) - self.logDebug("CAPTCHA", inputs['code'], numerals) - return 3 - - -getInfo = create_getInfo(RarefileNet) diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py deleted file mode 100644 index de7540628..000000000 --- a/module/plugins/hoster/RealdebridCom.py +++ /dev/null @@ -1,91 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from random import randrange -from urllib import quote, unquote -from time import time - -from module.common.json_layer import json_loads -from module.plugins.Hoster import Hoster -from module.utils import parseFileSize - - -class RealdebridCom(Hoster): - __name__ = "RealdebridCom" - __type__ = "hoster" - __version__ = "0.53" - - __pattern__ = r'https?://(?:[^/]*\.)?real-debrid\..*' - - __description__ = """Real-Debrid.com hoster plugin""" - __author_name__ = "Devirex Hazzard" - __author_mail__ = "naibaf_11@yahoo.de" - - - def getFilename(self, url): - try: - name = unquote(url.rsplit("/", 1)[1]) - except IndexError: - name = "Unknown_Filename..." - if not name or name.endswith(".."): # incomplete filename, append random stuff - name += "%s.tmp" % randrange(100, 999) - return name - - def setup(self): - self.chunkLimit = 3 - self.resumeDownload = True - - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - elif not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Real-debrid") - self.fail("No Real-debrid account provided") - else: - self.logDebug("Old URL: %s" % pyfile.url) - password = self.getPassword().splitlines() - if not password: - password = "" - else: - password = password[0] - - url = "https://real-debrid.com/ajax/unrestrict.php?lang=en&link=%s&password=%s&time=%s" % ( - quote(pyfile.url, ""), password, int(time() * 1000)) - page = self.load(url) - data = json_loads(page) - - self.logDebug("Returned Data: %s" % data) - - if data['error'] != 0: - if data['message'] == "Your file is unavailable on the hoster.": - self.offline() - else: - self.logWarning(data['message']) - self.tempOffline() - else: - if pyfile.name is not None and pyfile.name.endswith('.tmp') and data['file_name']: - pyfile.name = data['file_name'] - pyfile.size = parseFileSize(data['file_size']) - new_url = data['generated_links'][0][-1] - - if self.getConfig("https"): - new_url = new_url.replace("http://", "https://") - else: - new_url = new_url.replace("https://", "http://") - - if new_url != pyfile.url: - self.logDebug("New URL: %s" % new_url) - - if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown") or pyfile.name.endswith('..'): - #only use when name wasnt already set - pyfile.name = self.getFilename(new_url) - - self.download(new_url, disposition=True) - - check = self.checkDownload( - {"error": "An error occured while processing your request"}) - - if check == "error": - #usual this download can safely be retried - self.retry(wait_time=60, reason="An error occured while generating link.") diff --git a/module/plugins/hoster/RedtubeCom.py b/module/plugins/hoster/RedtubeCom.py deleted file mode 100644 index bdb948d6d..000000000 --- a/module/plugins/hoster/RedtubeCom.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.Hoster import Hoster -from module.unescape import unescape - - -class RedtubeCom(Hoster): - __name__ = "RedtubeCom" - __type__ = "hoster" - __version__ = "0.2" - - __pattern__ = r'http://(?:www\.)?redtube\.com/\d+' - - __description__ = """Redtube.com hoster plugin""" - __author_name__ = "jeix" - __author_mail__ = "jeix@hasnomail.de" - - - def process(self, pyfile): - self.download_html() - if not self.file_exists(): - self.offline() - - pyfile.name = self.get_file_name() - self.download(self.get_file_url()) - - def download_html(self): - url = self.pyfile.url - self.html = self.load(url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if not self.html: - self.download_html() - - file_url = unescape(re.search(r'hashlink=(http.*?)"', self.html).group(1)) - - return file_url - - def get_file_name(self): - if not self.html: - self.download_html() - - return re.search('(.*?)- RedTube - Free Porn Videos', self.html).group(1).strip() + ".flv" - - def file_exists(self): - """ returns True or False - """ - if not self.html: - self.download_html() - - if re.search(r'This video has been removed.', self.html) is not None: - return False - else: - return True diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py deleted file mode 100644 index 98fb10d94..000000000 --- a/module/plugins/hoster/RehostTo.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- - -from urllib import quote, unquote - -from module.plugins.Hoster import Hoster - - -class RehostTo(Hoster): - __name__ = "RehostTo" - __type__ = "hoster" - __version__ = "0.13" - - __pattern__ = r'https?://.*rehost.to\..*' - - __description__ = """Rehost.com hoster plugin""" - __author_name__ = "RaNaN" - __author_mail__ = "RaNaN@pyload.org" - - - def getFilename(self, url): - return unquote(url.rsplit("/", 1)[1]) - - def setup(self): - self.chunkLimit = 1 - self.resumeDownload = True - - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "rehost.to") - self.fail("No rehost.to account provided") - - data = self.account.getAccountInfo(self.user) - long_ses = data['long_ses'] - - self.logDebug("Rehost.to: Old URL: %s" % pyfile.url) - new_url = "http://rehost.to/process_download.php?user=cookie&pass=%s&dl=%s" % (long_ses, quote(pyfile.url, "")) - - #raise timeout to 2min - self.req.setOption("timeout", 120) - - self.download(new_url, disposition=True) diff --git a/module/plugins/hoster/RemixshareCom.py b/module/plugins/hoster/RemixshareCom.py deleted file mode 100644 index ea396495e..000000000 --- a/module/plugins/hoster/RemixshareCom.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Test links: -# http://remixshare.com/download/p946u -# -# Note: -# The remixshare.com website is very very slow, so -# if your download not starts because of pycurl timeouts: -# Adjust timeouts in /usr/share/pyload/module/network/HTTPRequest.py - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class RemixshareCom(SimpleHoster): - __name__ = "RemixshareCom" - __type__ = "hoster" - __version__ = "0.01" - - __pattern__ = r'https?://remixshare\.com/(download|dl)/\w+' - - __description__ = """Remixshare.com hoster plugin""" - __author_name__ = ("zapp-brannigan", "Walter Purcaro") - __author_mail__ = ("fuerst.reinje@web.de", "vuolter@gmail.com") - - FILE_INFO_PATTERN = r'title=\'.+?\'>(?P.+?) \((?P\d+) (?P\w+)\)<' - OFFLINE_PATTERN = r'

    Ooops!<' - - LINK_PATTERN = r'(http://remixshare\.com/downloadfinal/.+?)"' - TOKEN_PATTERN = r'var acc = (\d+)' - WAIT_PATTERN = r'var XYZ = r"(\d+)"' - - - def setup(self): - self.multiDL = True - self.chunkLimit = 1 - - def handleFree(self): - b = re.search(self.LINK_PATTERN, self.html) - if not b: - self.parseError("Cannot parse download url") - c = re.search(self.TOKEN_PATTERN, self.html) - if not c: - self.parseError("Cannot parse file token") - dl_url = b.group(1) + c.group(1) - - #Check if we have to wait - seconds = re.search(self.WAIT_PATTERN, self.html) - if seconds: - self.logDebug("Wait " + seconds.group(1)) - self.wait(seconds.group(1)) - - # Finally start downloading... - self.logDebug("Download URL = r" + dl_url) - self.download(dl_url, disposition=True) - - -getInfo = create_getInfo(RemixshareCom) diff --git a/module/plugins/hoster/RgHostNet.py b/module/plugins/hoster/RgHostNet.py deleted file mode 100644 index dccc6e557..000000000 --- a/module/plugins/hoster/RgHostNet.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class RgHostNet(SimpleHoster): - __name__ = "RgHostNet" - __type__ = "hoster" - __version__ = "0.01" - - __pattern__ = r'http://(?:www\.)?rghost\.net/\d+(?:r=\d+)?' - - __description__ = """RgHost.net hoster plugin""" - __author_name__ = "z00nx" - __author_mail__ = "z00nx0@gmail.com" - - FILE_INFO_PATTERN = r'

    \s+(]+>)?(?P[^<]+)()?\s+]+>\s+\((?P[^)]+)\)\s+\s+

    ' - OFFLINE_PATTERN = r'File is deleted|this page is not found' - LINK_PATTERN = r''']+>Download''' - - - def handleFree(self): - m = re.search(self.LINK_PATTERN, self.html) - if m is None: - self.parseError("Unable to detect the direct link") - download_link = m.group(1) - self.download(download_link, disposition=True) - - -getInfo = create_getInfo(RgHostNet) diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py deleted file mode 100644 index a24090cde..000000000 --- a/module/plugins/hoster/RyushareCom.py +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Test links: -# http://ryushare.com/cl0jy8ric2js/random.bin - -import re - -from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo -from module.plugins.internal.CaptchaService import SolveMedia - - -class RyushareCom(XFileSharingPro): - __name__ = "RyushareCom" - __type__ = "hoster" - __version__ = "0.16" - - __pattern__ = r'http://(?:www\.)?ryushare\.com/\w+' - - __description__ = """Ryushare.com hoster plugin""" - __author_name__ = ("zoidberg", "stickell", "quareevo") - __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it", "quareevo@arcor.de") - - HOSTER_NAME = "ryushare.com" - - FILE_SIZE_PATTERN = r'You have requested [^<]+ \((?P[\d\.]+) (?P\w+)' - - WAIT_PATTERN = r'You have to wait ((?P\d+) hour[s]?, )?((?P\d+) minute[s], )?(?P\d+) second[s]' - LINK_PATTERN = r'Click here to download<' - SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' - - - def getDownloadLink(self): - retry = False - self.html = self.load(self.pyfile.url) - action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")}) - if "method_premium" in inputs: - del inputs['method_premium'] - - self.html = self.load(self.pyfile.url, post=inputs) - action, inputs = self.parseHtmlForm('F1') - - self.setWait(65) - # Wait 1 hour - if "You have reached the download-limit" in self.html: - self.setWait(1 * 60 * 60, True) - retry = True - - m = re.search(self.WAIT_PATTERN, self.html) - if m: - wait = m.groupdict(0) - waittime = int(wait['hour']) * 60 * 60 + int(wait['min']) * 60 + int(wait['sec']) - self.setWait(waittime, True) - retry = True - - self.wait() - if retry: - self.retry() - - for _ in xrange(5): - m = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if m is None: - self.parseError("Error parsing captcha") - - captchaKey = m.group(1) - captcha = SolveMedia(self) - challenge, response = captcha.challenge(captchaKey) - - inputs['adcopy_challenge'] = challenge - inputs['adcopy_response'] = response - - self.html = self.load(self.pyfile.url, post=inputs) - if "WRONG CAPTCHA" in self.html: - self.invalidCaptcha() - self.logInfo("Invalid Captcha") - else: - self.correctCaptcha() - break - else: - self.fail("You have entered 5 invalid captcha codes") - - if "Click here to download" in self.html: - return re.search(r'Click here to download', self.html).group(1) - - -getInfo = create_getInfo(RyushareCom) diff --git a/module/plugins/hoster/SecureUploadEu.py b/module/plugins/hoster/SecureUploadEu.py deleted file mode 100644 index 3691be7da..000000000 --- a/module/plugins/hoster/SecureUploadEu.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo - - -class SecureUploadEu(XFileSharingPro): - __name__ = "SecureUploadEu" - __type__ = "hoster" - __version__ = "0.01" - - __pattern__ = r'http://(?:www\.)?secureupload\.eu/(\w){12}(/\w+)' - - __description__ = """SecureUpload.eu hoster plugin""" - __author_name__ = "z00nx" - __author_mail__ = "z00nx0@gmail.com" - - HOSTER_NAME = "secureupload.eu" - - FILE_INFO_PATTERN = r'

    Downloading (?P[^<]+) \((?P[^<]+)\)

    ' - OFFLINE_PATTERN = r'The file was removed|File Not Found' - - -getInfo = create_getInfo(SecureUploadEu) diff --git a/module/plugins/hoster/SendmywayCom.py b/module/plugins/hoster/SendmywayCom.py deleted file mode 100644 index f5e9e9ca6..000000000 --- a/module/plugins/hoster/SendmywayCom.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo - - -class SendmywayCom(XFileSharingPro): - __name__ = "SendmywayCom" - __type__ = "hoster" - __version__ = "0.01" - - __pattern__ = r'http://(?:www\.)?sendmyway.com/\w{12}' - - __description__ = """SendMyWay hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - HOSTER_NAME = "sendmyway.com" - - FILE_NAME_PATTERN = r'

    <.*?>\s*(?P.+)' - FILE_SIZE_PATTERN = r'\((?P\d+) bytes\)' - - -getInfo = create_getInfo(SendmywayCom) diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py deleted file mode 100644 index 1dac231eb..000000000 --- a/module/plugins/hoster/SendspaceCom.py +++ /dev/null @@ -1,60 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class SendspaceCom(SimpleHoster): - __name__ = "SendspaceCom" - __type__ = "hoster" - __version__ = "0.13" - - __pattern__ = r'http://(?:www\.)?sendspace.com/file/.*' - - __description__ = """Sendspace.com hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - FILE_NAME_PATTERN = r'

    \s*<(?:b|strong)>(?P[^<]+)\s*File Size:\s*(?P[0-9.]+)(?P[kKMG])i?B\s*

    ' - OFFLINE_PATTERN = r'
    Sorry, the file you requested is not available.
    ' - - LINK_PATTERN = r'' - USER_CAPTCHA_PATTERN = r'' - - - def handleFree(self): - params = {} - for _ in xrange(3): - m = re.search(self.LINK_PATTERN, self.html) - if m: - if 'captcha_hash' in params: - self.correctCaptcha() - download_url = m.group(1) - break - - m = re.search(self.CAPTCHA_PATTERN, self.html) - if m: - if 'captcha_hash' in params: - self.invalidCaptcha() - captcha_url1 = "http://www.sendspace.com/" + m.group(1) - m = re.search(self.USER_CAPTCHA_PATTERN, self.html) - captcha_url2 = "http://www.sendspace.com/" + m.group(1) - params = {'captcha_hash': m.group(2), - 'captcha_submit': 'Verify', - 'captcha_answer': self.decryptCaptcha(captcha_url1) + " " + self.decryptCaptcha(captcha_url2)} - else: - params = {'download': "Regular Download"} - - self.logDebug(params) - self.html = self.load(self.pyfile.url, post=params) - else: - self.fail("Download link not found") - - self.logDebug("Download URL: %s" % download_url) - self.download(download_url) - - -create_getInfo(SendspaceCom) diff --git a/module/plugins/hoster/Share4webCom.py b/module/plugins/hoster/Share4webCom.py deleted file mode 100644 index e5221baa9..000000000 --- a/module/plugins/hoster/Share4webCom.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.hoster.UnibytesCom import UnibytesCom -from module.plugins.internal.SimpleHoster import create_getInfo - - -class Share4webCom(UnibytesCom): - __name__ = "Share4webCom" - __type__ = "hoster" - __version__ = "0.1" - - __pattern__ = r'http://(?:www\.)?share4web\.com/get/\w+' - - __description__ = """Share4web.com hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - HOSTER_NAME = "share4web.com" - - -getInfo = create_getInfo(UnibytesCom) diff --git a/module/plugins/hoster/Share76Com.py b/module/plugins/hoster/Share76Com.py deleted file mode 100644 index 2c5dd877d..000000000 --- a/module/plugins/hoster/Share76Com.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class Share76Com(DeadHoster): - __name__ = "Share76Com" - __type__ = "hoster" - __version__ = "0.04" - - __pattern__ = r'http://(?:www\.)?share76.com/\w{12}' - - __description__ = """Share76.com hoster plugin""" - __author_name__ = "me" - __author_mail__ = None - - -getInfo = create_getInfo(Share76Com) diff --git a/module/plugins/hoster/ShareFilesCo.py b/module/plugins/hoster/ShareFilesCo.py deleted file mode 100644 index 54ae7777a..000000000 --- a/module/plugins/hoster/ShareFilesCo.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class ShareFilesCo(DeadHoster): - __name__ = "ShareFilesCo" - __type__ = "hoster" - __version__ = "0.02" - - __pattern__ = r'http://(?:www\.)?sharefiles\.co/\w{12}' - - __description__ = """Sharefiles.co hoster plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" - - -getInfo = create_getInfo(ShareFilesCo) diff --git a/module/plugins/hoster/ShareRapidCom.py b/module/plugins/hoster/ShareRapidCom.py deleted file mode 100644 index 414e92feb..000000000 --- a/module/plugins/hoster/ShareRapidCom.py +++ /dev/null @@ -1,66 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from pycurl import HTTPHEADER - -from module.network.RequestFactory import getRequest -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo - - -def getInfo(urls): - h = getRequest() - h.c.setopt(HTTPHEADER, - ["Accept: text/html", - "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"]) - for url in urls: - html = h.load(url, decode=True) - file_info = parseFileInfo(ShareRapidCom, url, html) - yield file_info - - -class ShareRapidCom(SimpleHoster): - __name__ = "ShareRapidCom" - __type__ = "hoster" - __version__ = "0.54" - - __pattern__ = r'http://(?:www\.)?(share|mega)rapid\.cz/soubor/\d+/.+' - - __description__ = """MegaRapid.cz hoster plugin""" - __author_name__ = ("MikyWoW", "zoidberg", "stickell", "Walter Purcaro") - __author_mail__ = ("mikywow@seznam.cz", "zoidberg@mujmail.cz", "l.stickell@yahoo.it", "vuolter@gmail.com") - - FILE_NAME_PATTERN = r']*>]*>(?:]*>)?(?P[^<]+)' - FILE_SIZE_PATTERN = r'Velikost:\s*\s*(?P[0-9.]+) (?P[kKMG])i?B' - OFFLINE_PATTERN = ur'Nastala chyba 404|Soubor byl smazán' - - SH_CHECK_TRAFFIC = True - - LINK_PATTERN = r'([^<]+)' - ERR_LOGIN_PATTERN = ur'
    Stahování je přístupné pouze přihlášeným uživatelům' - ERR_CREDIT_PATTERN = ur'
    Stahování zdarma je možné jen přes náš' - - - def setup(self): - self.chunkLimit = 1 - - def handlePremium(self): - try: - self.html = self.load(self.pyfile.url, decode=True) - except BadHeader, e: - self.account.relogin(self.user) - self.retry(max_tries=3, reason=str(e)) - - m = re.search(self.LINK_PATTERN, self.html) - if m: - link = m.group(1) - self.logDebug("Premium link: %s" % link) - self.download(link, disposition=True) - else: - if re.search(self.ERR_LOGIN_PATTERN, self.html): - self.relogin(self.user) - self.retry(max_tries=3, reason="User login failed") - elif re.search(self.ERR_CREDIT_PATTERN, self.html): - self.fail("Not enough credit left") - else: - self.fail("Download link not found") diff --git a/module/plugins/hoster/SharebeesCom.py b/module/plugins/hoster/SharebeesCom.py deleted file mode 100644 index d5b4a3bbc..000000000 --- a/module/plugins/hoster/SharebeesCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class SharebeesCom(DeadHoster): - __name__ = "SharebeesCom" - __type__ = "hoster" - __version__ = "0.02" - - __pattern__ = r'http://(?:www\.)?sharebees.com/\w{12}' - - __description__ = """ShareBees hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - -getInfo = create_getInfo(SharebeesCom) diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py deleted file mode 100644 index feaa95603..000000000 --- a/module/plugins/hoster/ShareonlineBiz.py +++ /dev/null @@ -1,199 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import time - -from module.network.RequestFactory import getURL -from module.plugins.Hoster import Hoster -from module.plugins.Plugin import chunks -from module.plugins.internal.CaptchaService import ReCaptcha - - -def getInfo(urls): - api_url_base = "http://api.share-online.biz/linkcheck.php" - - urls = [url.replace("https://", "http://") for url in urls] - - for chunk in chunks(urls, 90): - api_param_file = {"links": "\n".join(x.replace("http://www.share-online.biz/dl/", "").rstrip("/") for x in - chunk)} # api only supports old style links - src = getURL(api_url_base, post=api_param_file, decode=True) - result = [] - for i, res in enumerate(src.split("\n")): - if not res: - continue - fields = res.split(";") - - if fields[1] == "OK": - status = 2 - elif fields[1] in ("DELETED", "NOT FOUND"): - status = 1 - else: - status = 3 - - result.append((fields[2], int(fields[3]), status, chunk[i])) - yield result - - -class ShareonlineBiz(Hoster): - __name__ = "ShareonlineBiz" - __type__ = "hoster" - __version__ = "0.40" - - __pattern__ = r'https?://(?:www\.)?(share-online\.biz|egoshare\.com)/(download.php\?id=|dl/)(?P\w+)' - - __description__ = """Shareonline.biz hoster plugin""" - __author_name__ = ("spoob", "mkaay", "zoidberg", "Walter Purcaro") - __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz", "vuolter@gmail.com") - - ERROR_INFO_PATTERN = r'

    Information:

    \s*
    \s*(.*?)' - - - def setup(self): - # range request not working? - # api supports resume, only one chunk - # website isn't supporting resuming in first place - self.file_id = re.match(self.__pattern__, self.pyfile.url).group("ID") - self.pyfile.url = "http://www.share-online.biz/dl/" + self.file_id - - self.resumeDownload = self.premium - self.multiDL = False - #self.chunkLimit = 1 - - self.check_data = None - - def process(self, pyfile): - if self.premium: - self.handlePremium() - #web-download fallback removed - didn't work anyway - else: - self.handleFree() - - # check = self.checkDownload({"failure": re.compile(self.ERROR_INFO_PATTERN)}) - # if check == "failure": - # try: - # self.retry(reason=self.lastCheck.group(1).decode("utf8")) - # except: - # self.retry(reason="Unknown error") - - if self.api_data: - self.check_data = {"size": int(self.api_data['size']), "md5": self.api_data['md5']} - - def loadAPIData(self): - api_url_base = "http://api.share-online.biz/linkcheck.php?md5=1" - api_param_file = {"links": self.file_id} # api only supports old style links - src = self.load(api_url_base, cookies=False, post=api_param_file, decode=True) - - fields = src.split(";") - self.api_data = {"fileid": fields[0], - "status": fields[1]} - if not self.api_data['status'] == "OK": - self.offline() - else: - self.api_data['filename'] = fields[2] - self.api_data['size'] = fields[3] # in bytes - self.api_data['md5'] = fields[4].strip().lower().replace("\n\n", "") # md5 - - def handleFree(self): - self.loadAPIData() - self.pyfile.name = self.api_data['filename'] - self.pyfile.size = int(self.api_data['size']) - - self.html = self.load(self.pyfile.url, cookies=True) # refer, stuff - self.setWait(3) - self.wait() - - self.html = self.load("%s/free/" % self.pyfile.url, post={"dl_free": "1", "choice": "free"}, decode=True) - self.checkErrors() - - m = re.search(r'var wait=(\d+);', self.html) - - recaptcha = ReCaptcha(self) - for _ in xrange(5): - challenge, response = recaptcha.challenge("6LdatrsSAAAAAHZrB70txiV5p-8Iv8BtVxlTtjKX") - self.setWait(int(m.group(1)) if m else 30) - response = self.load("%s/free/captcha/%d" % (self.pyfile.url, int(time() * 1000)), post={ - 'dl_free': '1', - 'recaptcha_challenge_field': challenge, - 'recaptcha_response_field': response}) - - if not response == '0': - self.correctCaptcha() - break - else: - self.invalidCaptcha() - else: - self.invalidCaptcha() - self.fail("No valid captcha solution received") - - download_url = response.decode("base64") - self.logDebug(download_url) - if not download_url.startswith("http://"): - self.parseError("download url") - - self.wait() - self.download(download_url) - # check download - check = self.checkDownload({ - "cookie": re.compile(r'
    Share-Online") - }) - if check == "cookie": - self.invalidCaptcha() - self.retry(5, 60, "Cookie failure") - elif check == "fail": - self.invalidCaptcha() - self.retry(5, 5 * 60, "Download failed") - else: - self.correctCaptcha() - - def handlePremium(self): #: should be working better loading (account) api internally - self.account.getAccountInfo(self.user, True) - src = self.load("http://api.share-online.biz/account.php", - {"username": self.user, "password": self.account.accounts[self.user]['password'], - "act": "download", "lid": self.file_id}) - - self.api_data = dlinfo = {} - for line in src.splitlines(): - key, value = line.split(": ") - dlinfo[key.lower()] = value - - self.logDebug(dlinfo) - if not dlinfo['status'] == "online": - self.offline() - else: - self.pyfile.name = dlinfo['name'] - self.pyfile.size = int(dlinfo['size']) - - dlLink = dlinfo['url'] - if dlLink == "server_under_maintenance": - self.tempOffline() - else: - self.multiDL = True - self.download(dlLink) - - def checkErrors(self): - m = re.search(r"/failure/(.*?)/1", self.req.lastEffectiveURL) - if m is None: - return - - err = m.group(1) - m = re.search(self.ERROR_INFO_PATTERN, self.html) - msg = m.group(1) if m else "" - self.logError(err, msg or "Unknown error occurred") - - if err == "invalid": - self.fail(msg or "File not available") - elif err in ("freelimit", "size", "proxy"): - self.fail(msg or "Premium account needed") - else: - if err in 'server': - self.setWait(600, False) - elif err in 'expired': - self.setWait(30, False) - else: - self.setWait(300, True) - - self.wait() - self.retry(max_tries=25, reason=msg) diff --git a/module/plugins/hoster/ShareplaceCom.py b/module/plugins/hoster/ShareplaceCom.py deleted file mode 100644 index 0d236fe30..000000000 --- a/module/plugins/hoster/ShareplaceCom.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from urllib import unquote - -from module.plugins.Hoster import Hoster - - -class ShareplaceCom(Hoster): - __name__ = "ShareplaceCom" - __type__ = "hoster" - __version__ = "0.11" - - __pattern__ = r'(http://)?(?:www\.)?shareplace\.(com|org)/\?[a-zA-Z0-9]+' - - __description__ = """Shareplace.com hoster plugin""" - __author_name__ = "ACCakut" - __author_mail__ = None - - - def process(self, pyfile): - self.pyfile = pyfile - self.prepare() - self.download(self.get_file_url()) - - def prepare(self): - if not self.file_exists(): - self.offline() - - self.pyfile.name = self.get_file_name() - - wait_time = self.get_waiting_time() - self.setWait(wait_time) - self.logDebug("%s: Waiting %d seconds." % (self.__name__, wait_time)) - self.wait() - - def get_waiting_time(self): - if not self.html: - self.download_html() - - #var zzipitime = 15; - m = re.search(r'var zzipitime = (\d+);', self.html) - if m: - sec = int(m.group(1)) - else: - sec = 0 - - return sec - - def download_html(self): - url = re.sub("shareplace.com\/\?", "shareplace.com//index1.php/?a=", self.pyfile.url) - self.html = self.load(url, decode=True) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - url = re.search(r"var beer = '(.*?)';", self.html) - if url: - url = url.group(1) - url = unquote( - url.replace("http://http:/", "").replace("vvvvvvvvv", "").replace("lllllllll", "").replace( - "teletubbies", "")) - self.logDebug("URL: %s" % url) - return url - else: - self.fail("absolute filepath could not be found. offline? ") - - def get_file_name(self): - if not self.html: - self.download_html() - - return re.search("\s*(.*?)\s*", self.html).group(1) - - def file_exists(self): - """ returns True or False - """ - if not self.html: - self.download_html() - - if re.search(r"HTTP Status 404", self.html) is not None: - return False - else: - return True diff --git a/module/plugins/hoster/ShragleCom.py b/module/plugins/hoster/ShragleCom.py deleted file mode 100644 index ba3356d66..000000000 --- a/module/plugins/hoster/ShragleCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class ShragleCom(DeadHoster): - __name__ = "ShragleCom" - __type__ = "hoster" - __version__ = "0.22" - - __pattern__ = r'http://(?:www\.)?(cloudnator|shragle).com/files/(?P.*?)/' - - __description__ = """Cloudnator.com (Shragle.com) hoster plugin""" - __author_name__ = ("RaNaN", "zoidberg") - __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") - - -getInfo = create_getInfo(ShragleCom) diff --git a/module/plugins/hoster/SimplyPremiumCom.py b/module/plugins/hoster/SimplyPremiumCom.py deleted file mode 100644 index 5db9f5daa..000000000 --- a/module/plugins/hoster/SimplyPremiumCom.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from datetime import datetime, timedelta - -from module.plugins.Hoster import Hoster -from module.plugins.hoster.UnrestrictLi import secondsToMidnight - - -class SimplyPremiumCom(Hoster): - __name__ = "SimplyPremiumCom" - __type__ = "hoster" - __version__ = "0.03" - - __pattern__ = r'https?://.*(simply-premium)\.com' - - __description__ = """Simply-Premium.com hoster plugin""" - __author_name__ = "EvolutionClip" - __author_mail__ = "evolutionclip@live.de" - - - def setup(self): - self.chunkLimit = 16 - self.resumeDownload = False - - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - elif not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Simply-Premium.com") - self.fail("No Simply-Premium.com account provided") - else: - self.logDebug("Old URL: %s" % pyfile.url) - for i in xrange(5): - page = self.load('http://www.simply-premium.com/premium.php?info&link=' + pyfile.url) - self.logDebug("JSON data: " + page) - if page != '': - break - else: - self.logInfo("Unable to get API data, waiting 1 minute and retry") - self.retry(5, 60, "Unable to get API data") - - if '0' in page or ( - "You are not allowed to download from this host" in page and self.premium): - self.account.relogin(self.user) - self.retry() - elif "NOTFOUND" in page: - self.offline() - elif "downloadlimit" in page: - self.logWarning("Reached maximum connctions") - self.retry(5, 60, "Reached maximum connctions") - elif "trafficlimit" in page: - self.logWarning("Reached daily limit for this host") - self.retry(1, secondsToMidnight(gmt=2), "Daily limit for this host reached") - elif "hostererror" in page: - self.logWarning("Hoster temporarily unavailable, waiting 1 minute and retry") - self.retry(5, 60, "Hoster is temporarily unavailable") - #page = json_loads(page) - #new_url = page.keys()[0] - #self.api_data = page[new_url] - - try: - self.pyfile.name = re.search(r'([^<]+)', page).group(1) - except AttributeError: - self.pyfile.name = "" - - try: - self.pyfile.size = re.search(r'(\d+)', page).group(1) - except AttributeError: - self.pyfile.size = 0 - - try: - new_url = re.search(r'([^<]+)', page).group(1) - except AttributeError: - new_url = 'http://www.simply-premium.com/premium.php?link=' + pyfile.url - - if new_url != pyfile.url: - self.logDebug("New URL: " + new_url) - - self.download(new_url, disposition=True) diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py deleted file mode 100644 index 78f6c0a34..000000000 --- a/module/plugins/hoster/SimplydebridCom.py +++ /dev/null @@ -1,62 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.Hoster import Hoster - - -class SimplydebridCom(Hoster): - __name__ = "SimplydebridCom" - __type__ = "hoster" - __version__ = "0.1" - - __pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd.php/*' - - __description__ = """Simply-debrid.com hoster plugin""" - __author_name__ = "Kagenoshin" - __author_mail__ = "kagenoshin@gmx.ch" - - - def setup(self): - self.resumeDownload = self.multiDL = True - self.chunkLimit = 1 - - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "simply-debrid.com") - self.fail("No simply-debrid.com account provided") - - self.logDebug("Old URL: %s" % pyfile.url) - - #fix the links for simply-debrid.com! - new_url = pyfile.url - new_url = new_url.replace("clz.to", "cloudzer.net/file") - new_url = new_url.replace("http://share-online", "http://www.share-online") - new_url = new_url.replace("ul.to", "uploaded.net/file") - new_url = new_url.replace("uploaded.com", "uploaded.net") - new_url = new_url.replace("filerio.com", "filerio.in") - new_url = new_url.replace("lumfile.com", "lumfile.se") - if('fileparadox' in new_url): - new_url = new_url.replace("http://", "https://") - - if re.match(self.__pattern__, new_url): - new_url = new_url - - self.logDebug("New URL: %s" % new_url) - - if not re.match(self.__pattern__, new_url): - page = self.load('http://simply-debrid.com/api.php', get={'dl': new_url}) # +'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) - if 'tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page): - self.fail('Unable to unrestrict link') - new_url = page - - self.setWait(5) - self.wait() - self.logDebug("Unrestricted URL: " + new_url) - - self.download(new_url, disposition=True) - - check = self.checkDownload({"bad1": "No address associated with hostname", "bad2": "\w+)' - - __description__ = """Sockshare.com hoster plugin""" - __author_name__ = ("jeix", "stickell", "Walter Purcaro") - __author_mail__ = ("jeix@hasnomail.de", "l.stickell@yahoo.it", "vuolter@gmail.com") - - FILE_INFO_PATTERN = r'site-content">\s*

    (?P.+)\( (?P[^)]+) \)

    ' - OFFLINE_PATTERN = r'>This file doesn\'t exist, or has been removed.<' - TEMP_OFFLINE_PATTERN = r'(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)' - - FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.sockshare.com/file/\g')] - - - def setup(self): - self.multiDL = self.resumeDownload = True - self.chunkLimit = -1 - - def handleFree(self): - name = self.pyfile.name - link = self._getLink() - self.logDebug("Direct link: " + link) - self.download(link, disposition=True) - self.processName(name) - - def _getLink(self): - hash_data = re.search(r'', self.html) - if not hash_data: - self.parseError("Unable to detect hash") - - post_data = {"hash": hash_data.group(1), "confirm": "Continue+as+Free+User"} - self.html = self.load(self.pyfile.url, post=post_data) - if ">You have exceeded the daily stream limit for your country\\. You can wait until tomorrow" in self.html: - self.logWarning("You have exceeded your daily stream limit for today") - self.wait(secondsToMidnight(gmt=2), True) - elif re.search(self.TEMP_OFFLINE_PATTERN, self.html): - self.retry(wait_time=2 * 60 * 60, reason="Server temporarily offline") # 2 hours wait - - patterns = (r'(/get_file\.php\?id=[A-Z0-9]+&key=[a-zA-Z0-9=]+&original=1)', - r'(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+)', - r'(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+&original=1)', - r'Tired of ads and waiting\? Go Pro![\t\n\rn ]+
    [\t\n\rn ]+.*?)/(?P.*)' - - __description__ = """SoundCloud.com hoster plugin""" - __author_name__ = "Peekayy" - __author_mail__ = "peekayy.dev@gmail.com" - - - def process(self, pyfile): - # default UserAgent of HTTPRequest fails for this hoster so we use this one - self.req.http.c.setopt(pycurl.USERAGENT, 'Mozilla/5.0') - page = self.load(pyfile.url) - m = re.search(r'
    .*?)"', page) - if m: - clientId = m.group("CID") - - if len(clientId) <= 0: - clientId = "b45b1aa10f1ac2941910a7f0d10f8e28" - - m = re.search(r'\s(?P.*?)\s</em>', page) - if m: - pyfile.name = m.group("TITLE") + ".mp3" - else: - pyfile.name = re.match(self.__pattern__, pyfile.url).group("SID") + ".mp3" - - # url to retrieve the actual song url - page = self.load("https://api.sndcdn.com/i1/tracks/%s/streams" % songId, get={"client_id": clientId}) - # getting streams - # for now we choose the first stream found in all cases - # it could be improved if relevant for this hoster - streams = [ - (result.group("QUALITY"), result.group("URL")) - for result in re.finditer(r'"(?P<QUALITY>.*?)":"(?P<URL>.*?)"', page) - ] - self.logDebug("Found Streams", streams) - self.logDebug("Downloading", streams[0][0], streams[0][1]) - self.download(streams[0][1]) diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py deleted file mode 100644 index 8cf1163b2..000000000 --- a/module/plugins/hoster/SpeedLoadOrg.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class SpeedLoadOrg(DeadHoster): - __name__ = "SpeedLoadOrg" - __type__ = "hoster" - __version__ = "1.02" - - __pattern__ = r'http://(?:www\.)?speedload\.org/(?P<ID>\w+)' - - __description__ = """Speedload.org hoster plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" - - -getInfo = create_getInfo(SpeedLoadOrg) diff --git a/module/plugins/hoster/SpeedfileCz.py b/module/plugins/hoster/SpeedfileCz.py deleted file mode 100644 index 6a42d1dbe..000000000 --- a/module/plugins/hoster/SpeedfileCz.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class SpeedfileCz(DeadHoster): - __name__ = "SpeedFileCz" - __type__ = "hoster" - __version__ = "0.32" - - __pattern__ = r'http://(?:www\.)?speedfile.cz/.*' - - __description__ = """Speedfile.cz hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - -getInfo = create_getInfo(SpeedfileCz) diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py deleted file mode 100644 index 22f4ee511..000000000 --- a/module/plugins/hoster/SpeedyshareCom.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- - -# Testlink: -# http://speedy.sh/ep2qY/Zapp-Brannigan.jpg - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class SpeedyshareCom(SimpleHoster): - __name__ = "SpeedyshareCom" - __type__ = "hoster" - __pattern__ = r"https?://(www\.)?(speedyshare.com|speedy.sh)/.*" - __version__ = "0.01" - __description__ = """speedyshare.com hoster plugin""" - __author_name__ = ("zapp-brannigan") - __author_mail__ = ("fuerst.reinje@web.de") - - FILE_NAME_PATTERN = r'class=downloadfilename>(?P<N>.*)</span></td>' - FILE_SIZE_PATTERN = r'class=sizetagtext>(?P<S>.*) (?P<U>[kKmM]?[iI]?[bB]?)</div>' - LINK_PATTERN = r'<a href=\'(.*)\'><img src=/gf/slowdownload.png alt=\'Slow Download\' border=0' - FILE_OFFLINE_PATTERN = r'class=downloadfilenamenotfound>.*</span>' - BASE_URL = 'www.speedyshare.com' - - def setup(self): - self.multiDL = False - self.chunkLimit = 1 - - def process(self, pyfile): - self.html = self.load(pyfile.url, decode=True) - try: - dl_link = re.search(self.LINK_PATTERN, self.html).group(1) - self.logDebug("Link: " + dl_link) - except: - self.parseError("Unable to find download link") - self.download(self.BASE_URL + dl_link, disposition=True) - check = self.checkDownload({"is_html": re.compile("html")}) - if check == "is_html": - self.fail("The downloaded file is html, maybe the plugin is out of date") - - -getInfo = create_getInfo(SpeedyshareCom) diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py deleted file mode 100644 index 526e61eea..000000000 --- a/module/plugins/hoster/StreamCz.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.network.RequestFactory import getURL -from module.plugins.Hoster import Hoster - - -def getInfo(urls): - result = [] - - for url in urls: - - html = getURL(url) - if re.search(StreamCz.OFFLINE_PATTERN, html): - # File offline - result.append((url, 0, 1, url)) - else: - result.append((url, 0, 2, url)) - yield result - - -class StreamCz(Hoster): - __name__ = "StreamCz" - __type__ = "hoster" - __version__ = "0.2" - - __pattern__ = r'https?://(?:www\.)?stream\.cz/[^/]+/\d+.*' - - __description__ = """Stream.cz hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - FILE_NAME_PATTERN = r'<link rel="video_src" href="http://www.stream.cz/\w+/(\d+)-([^"]+)" />' - OFFLINE_PATTERN = r'<h1 class="commonTitle">Str.nku nebylo mo.n. nal.zt \(404\)</h1>' - - CDN_PATTERN = r'<param name="flashvars" value="[^"]*&id=(?P<ID>\d+)(?:&cdnLQ=(?P<cdnLQ>\d*))?(?:&cdnHQ=(?P<cdnHQ>\d*))?(?:&cdnHD=(?P<cdnHD>\d*))?&' - - - def setup(self): - self.multiDL = True - self.resumeDownload = True - - def process(self, pyfile): - - self.html = self.load(pyfile.url, decode=True) - - if re.search(self.OFFLINE_PATTERN, self.html): - self.offline() - - m = re.search(self.CDN_PATTERN, self.html) - if m is None: - self.fail("Parse error (CDN)") - cdn = m.groupdict() - self.logDebug(cdn) - for cdnkey in ("cdnHD", "cdnHQ", "cdnLQ"): - if cdnkey in cdn and cdn[cdnkey] > '': - cdnid = cdn[cdnkey] - break - else: - self.fail("Stream URL not found") - - m = re.search(self.FILE_NAME_PATTERN, self.html) - if m is None: - self.fail("Parse error (NAME)") - pyfile.name = "%s-%s.%s.mp4" % (m.group(2), m.group(1), cdnkey[-2:]) - - download_url = "http://cdn-dispatcher.stream.cz/?id=" + cdnid - self.logInfo("STREAM (%s): %s" % (cdnkey[-2:], download_url)) - self.download(download_url) diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py deleted file mode 100644 index 11333640e..000000000 --- a/module/plugins/hoster/StreamcloudEu.py +++ /dev/null @@ -1,124 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import sleep - -from module.network.HTTPRequest import HTTPRequest -from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo - - -class StreamcloudEu(XFileSharingPro): - __name__ = "StreamcloudEu" - __type__ = "hoster" - __version__ = "0.04" - - __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\S+' - - __description__ = """Streamcloud.eu hoster plugin""" - __author_name__ = "seoester" - __author_mail__ = "seoester@googlemail.com" - - HOSTER_NAME = "streamcloud.eu" - - LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud.eu:?\d*/.*/video\.(mp4|flv))",' - - - def setup(self): - super(StreamcloudEu, self).setup() - self.multiDL = True - - def getDownloadLink(self): - m = re.search(self.LINK_PATTERN, self.html, re.S) - if m: - return m.group(1) - - for i in xrange(5): - self.logDebug("Getting download link: #%d" % i) - data = self.getPostParameters() - httpRequest = HTTPRequest(options=self.req.options) - httpRequest.cj = self.req.cj - sleep(10) - self.html = httpRequest.load(self.pyfile.url, post=data, referer=False, cookies=True, decode=True) - self.header = httpRequest.header - - m = re.search("Location\s*:\s*(.*)", self.header, re.I) - if m: - break - - m = re.search(self.LINK_PATTERN, self.html, re.S) - if m: - break - - else: - if self.errmsg and 'captcha' in self.errmsg: - self.fail("No valid captcha code entered") - else: - self.fail("Download link not found") - - return m.group(1) - - def getPostParameters(self): - for i in xrange(3): - if not self.errmsg: - self.checkErrors() - - if hasattr(self, "FORM_PATTERN"): - action, inputs = self.parseHtmlForm(self.FORM_PATTERN) - else: - action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")}) - - if not inputs: - action, inputs = self.parseHtmlForm('F1') - if not inputs: - if self.errmsg: - self.retry() - else: - self.parseError("Form not found") - - self.logDebug(self.HOSTER_NAME, inputs) - - if 'op' in inputs and inputs['op'] in ("download1", "download2", "download3"): - if "password" in inputs: - if self.passwords: - inputs['password'] = self.passwords.pop(0) - else: - self.fail("No or invalid passport") - - if not self.premium: - m = re.search(self.WAIT_PATTERN, self.html) - if m: - wait_time = int(m.group(1)) + 1 - self.setWait(wait_time, False) - else: - wait_time = 0 - - self.captcha = self.handleCaptcha(inputs) - - if wait_time: - self.wait() - - self.errmsg = None - self.logDebug("getPostParameters {0}".format(i)) - return inputs - - else: - inputs['referer'] = self.pyfile.url - - if self.premium: - inputs['method_premium'] = "Premium Download" - if 'method_free' in inputs: - del inputs['method_free'] - else: - inputs['method_free'] = "Free Download" - if 'method_premium' in inputs: - del inputs['method_premium'] - - self.html = self.load(self.pyfile.url, post=inputs, ref=False) - self.errmsg = None - - else: - self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) - - -getInfo = create_getInfo(StreamcloudEu) diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py deleted file mode 100644 index a9cc46614..000000000 --- a/module/plugins/hoster/TurbobitNet.py +++ /dev/null @@ -1,167 +0,0 @@ -# -*- coding: utf-8 -*- - -import random -import re -import time - -from Crypto.Cipher import ARC4 -from binascii import hexlify, unhexlify -from pycurl import HTTPHEADER -from urllib import quote - -from module.network.RequestFactory import getURL -from module.plugins.internal.CaptchaService import ReCaptcha -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp - - -class TurbobitNet(SimpleHoster): - __name__ = "TurbobitNet" - __type__ = "hoster" - __version__ = "0.11" - - __pattern__ = r'http://(?:www\.)?(turbobit.net|unextfiles.com)/(?!download/folder/)(?:download/free/)?(?P<ID>\w+).*' - - __description__ = """Turbobit.net plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - FILE_INFO_PATTERN = r"<span class='file-icon1[^>]*>(?P<N>[^<]+)</span>\s*\((?P<S>[^\)]+)\)\s*</h1>" #: long filenames are shortened - FILE_NAME_PATTERN = r'<meta name="keywords" content="\s+(?P<N>[^,]+)' #: full name but missing on page2 - OFFLINE_PATTERN = r'<h2>File Not Found</h2>|html\(\'File (?:was )?not found' - - FILE_URL_REPLACEMENTS = [(r"http://(?:www\.)?(turbobit.net|unextfiles.com)/(?:download/free/)?(?P<ID>\w+).*", - "http://turbobit.net/\g<ID>.html")] - SH_COOKIES = [(".turbobit.net", "user_lang", "en")] - - LINK_PATTERN = r'(?P<url>/download/redirect/[^"\']+)' - LIMIT_WAIT_PATTERN = r'<div id="time-limit-text">\s*.*?<span id=\'timeout\'>(\d+)</span>' - CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' - CAPTCHA_SRC_PATTERN = r'<img alt="Captcha" src="(.*?)"' - - - def handleFree(self): - self.url = "http://turbobit.net/download/free/%s" % self.file_info['ID'] - self.html = self.load(self.url) - - rtUpdate = self.getRtUpdate() - - self.solveCaptcha() - self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) - self.url = self.getDownloadUrl(rtUpdate) - - self.wait() - self.html = self.load(self.url) - self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With:"]) - self.downloadFile() - - def solveCaptcha(self): - for _ in xrange(5): - m = re.search(self.LIMIT_WAIT_PATTERN, self.html) - if m: - wait_time = int(m.group(1)) - self.wait(wait_time, wait_time > 60) - self.retry() - - action, inputs = self.parseHtmlForm("action='#'") - if not inputs: - self.parseError("captcha form") - self.logDebug(inputs) - - if inputs['captcha_type'] == 'recaptcha': - recaptcha = ReCaptcha(self) - m = re.search(self.CAPTCHA_KEY_PATTERN, self.html) - captcha_key = m.group(1) if m else '6LcTGLoSAAAAAHCWY9TTIrQfjUlxu6kZlTYP50_c' - inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge( - captcha_key) - else: - m = re.search(self.CAPTCHA_SRC_PATTERN, self.html) - if m is None: - self.parseError('captcha') - captcha_url = m.group(1) - inputs['captcha_response'] = self.decryptCaptcha(captcha_url) - - self.logDebug(inputs) - self.html = self.load(self.url, post=inputs) - - if not "<div class='download-timer-header'>" in self.html: - self.invalidCaptcha() - else: - self.correctCaptcha() - break - else: - self.fail("Invalid captcha") - - def getRtUpdate(self): - rtUpdate = self.getStorage("rtUpdate") - if not rtUpdate: - if self.getStorage("version") != self.__version__ or int( - self.getStorage("timestamp", 0)) + 86400000 < timestamp(): - # that's right, we are even using jdownloader updates - rtUpdate = getURL("http://update0.jdownloader.org/pluginstuff/tbupdate.js") - rtUpdate = self.decrypt(rtUpdate.splitlines()[1]) - # but we still need to fix the syntax to work with other engines than rhino - rtUpdate = re.sub(r'for each\(var (\w+) in(\[[^\]]+\])\)\{', - r'zza=\2;for(var zzi=0;zzi<zza.length;zzi++){\1=zza[zzi];', rtUpdate) - rtUpdate = re.sub(r"for\((\w+)=", r"for(var \1=", rtUpdate) - - self.logDebug("rtUpdate") - self.setStorage("rtUpdate", rtUpdate) - self.setStorage("timestamp", timestamp()) - self.setStorage("version", self.__version__) - else: - self.logError("Unable to download, wait for update...") - self.tempOffline() - - return rtUpdate - - def getDownloadUrl(self, rtUpdate): - self.req.http.lastURL = self.url - - m = re.search("(/\w+/timeout\.js\?\w+=)([^\"\'<>]+)", self.html) - url = "http://turbobit.net%s%s" % (m.groups() if m else ( - '/files/timeout.js?ver=', ''.join(random.choice('0123456789ABCDEF') for _ in xrange(32)))) - fun = self.load(url) - - self.setWait(65, False) - - for b in [1, 3]: - self.jscode = "var id = \'%s\';var b = %d;var inn = \'%s\';%sout" % ( - self.file_info['ID'], b, quote(fun), rtUpdate) - - try: - out = self.js.eval(self.jscode) - self.logDebug("URL", self.js.engine, out) - if out.startswith('/download/'): - return "http://turbobit.net%s" % out.strip() - except Exception, e: - self.logError(e) - else: - if self.retries >= 2: - # retry with updated js - self.delStorage("rtUpdate") - self.retry() - - def decrypt(self, data): - cipher = ARC4.new(hexlify('E\x15\xa1\x9e\xa3M\xa0\xc6\xa0\x84\xb6H\x83\xa8o\xa0')) - return unhexlify(cipher.encrypt(unhexlify(data))) - - def getLocalTimeString(self): - lt = time.localtime() - tz = time.altzone if lt.tm_isdst else time.timezone - return "%s GMT%+03d%02d" % (time.strftime("%a %b %d %Y %H:%M:%S", lt), -tz // 3600, tz % 3600) - - def handlePremium(self): - self.logDebug("Premium download as user %s" % self.user) - self.html = self.load(self.pyfile.url) # Useless in 0.5 - self.downloadFile() - - def downloadFile(self): - m = re.search(self.LINK_PATTERN, self.html) - if m is None: - self.parseError("download link") - self.url = "http://turbobit.net" + m.group('url') - self.logDebug(self.url) - self.download(self.url) - - -getInfo = create_getInfo(TurbobitNet) diff --git a/module/plugins/hoster/TurbouploadCom.py b/module/plugins/hoster/TurbouploadCom.py deleted file mode 100644 index bcfa2d7d4..000000000 --- a/module/plugins/hoster/TurbouploadCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class TurbouploadCom(DeadHoster): - __name__ = "TurbouploadCom" - __type__ = "hoster" - __version__ = "0.03" - - __pattern__ = r'http://(?:www\.)?turboupload.com/(\w+).*' - - __description__ = """Turboupload.com hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - -getInfo = create_getInfo(TurbouploadCom) diff --git a/module/plugins/hoster/TusfilesNet.py b/module/plugins/hoster/TusfilesNet.py deleted file mode 100644 index 7fb2a375e..000000000 --- a/module/plugins/hoster/TusfilesNet.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo - - -class TusfilesNet(XFileSharingPro): - __name__ = "TusfilesNet" - __type__ = "hoster" - __version__ = "0.03" - - __pattern__ = r'https?://(?:www\.)?tusfiles\.net/(?P<ID>\w+)' - - __description__ = """Tusfiles.net hoster plugin""" - __author_name__ = "Walter Purcaro" - __author_mail__ = "vuolter@gmail.com" - - HOSTER_NAME = "tusfiles.net" - - FILE_INFO_PATTERN = r'\](?P<N>.+) - (?P<S>[\d.]+) (?P<U>\w+)\[' - OFFLINE_PATTERN = r'>File Not Found|<Title>TusFiles - Fast Sharing Files!' - - SH_COOKIES = [(".tusfiles.net", "lang", "english")] - - - def setup(self): - self.multiDL = False - self.chunkLimit = -1 - self.resumeDownload = True - - -getInfo = create_getInfo(TusfilesNet) diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py deleted file mode 100644 index dbd33dd83..000000000 --- a/module/plugins/hoster/TwoSharedCom.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class TwoSharedCom(SimpleHoster): - __name__ = "TwoSharedCom" - __type__ = "hoster" - __version__ = "0.11" - - __pattern__ = r'http://(?:www\.)?2shared.com/(account/)?(download|get|file|document|photo|video|audio)/.*' - - __description__ = """2Shared.com hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - FILE_NAME_PATTERN = r'<h1>(?P<N>.*)</h1>' - FILE_SIZE_PATTERN = r'<span class="dtitle">File size:</span>\s*(?P<S>[0-9,.]+) (?P<U>[kKMG])i?B' - OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.' - - LINK_PATTERN = r"window.location ='([^']+)';" - - - def setup(self): - self.resumeDownload = self.multiDL = True - - def handleFree(self): - m = re.search(self.LINK_PATTERN, self.html) - if m is None: - self.parseError('Download link') - link = m.group(1) - self.logDebug("Download URL %s" % link) - - self.download(link) - - -getInfo = create_getInfo(TwoSharedCom) diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py deleted file mode 100644 index dbdaf3f8e..000000000 --- a/module/plugins/hoster/UlozTo.py +++ /dev/null @@ -1,158 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -import time - -from module.common.json_layer import json_loads -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -def convertDecimalPrefix(m): - # decimal prefixes used in filesize and traffic - return ("%%.%df" % {'k': 3, 'M': 6, 'G': 9}[m.group(2)] % float(m.group(1))).replace('.', '') - - -class UlozTo(SimpleHoster): - __name__ = "UlozTo" - __type__ = "hoster" - __version__ = "0.98" - - __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(?:live/)?(?P<id>\w+/[^/?]*)' - - __description__ = """Uloz.to hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - FILE_INFO_PATTERN = r'<p>File <strong>(?P<N>[^<]+)</strong> is password protected</p>' - FILE_NAME_PATTERN = r'<title>(?P<N>[^<]+) \| Uloz.to' - FILE_SIZE_PATTERN = r'.*?(?P[0-9.]+\s[kMG]?B)' - OFFLINE_PATTERN = r'404 - Page not found|

    File (has been deleted|was banned)

    ' - - FILE_SIZE_REPLACEMENTS = [('([0-9.]+)\s([kMG])B', convertDecimalPrefix)] - FILE_URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "www.ulozto.net")] - - ADULT_PATTERN = r'
    ' - PASSWD_PATTERN = r'
    ' - VIPLINK_PATTERN = r'' - FREE_URL_PATTERN = r'
    ' - - - def setup(self): - self.multiDL = self.premium - self.resumeDownload = True - - def process(self, pyfile): - pyfile.url = re.sub(r"(?<=http://)([^/]+)", "www.ulozto.net", pyfile.url) - self.html = self.load(pyfile.url, decode=True, cookies=True) - - if re.search(self.ADULT_PATTERN, self.html): - self.logInfo("Adult content confirmation needed. Proceeding..") - - m = re.search(self.TOKEN_PATTERN, self.html) - if m is None: - self.parseError('TOKEN') - token = m.group(1) - - self.html = self.load(pyfile.url, get={"do": "askAgeForm-submit"}, - post={"agree": "Confirm", "_token_": token}, cookies=True) - - passwords = self.getPassword().splitlines() - while self.PASSWD_PATTERN in self.html: - if passwords: - password = passwords.pop(0) - self.logInfo("Password protected link, trying " + password) - self.html = self.load(pyfile.url, get={"do": "passwordProtectedForm-submit"}, - post={"password": password, "password_send": 'Send'}, cookies=True) - else: - self.fail("No or incorrect password") - - if re.search(self.VIPLINK_PATTERN, self.html): - self.html = self.load(pyfile.url, get={"disclaimer": "1"}) - - self.file_info = self.getFileInfo() - - if self.premium and self.checkTrafficLeft(): - self.handlePremium() - else: - self.handleFree() - - self.doCheckDownload() - - def handleFree(self): - action, inputs = self.parseHtmlForm('id="frm-downloadDialog-freeDownloadForm"') - if not action or not inputs: - self.parseError("free download form") - - self.logDebug('inputs.keys() = ' + str(inputs.keys())) - # get and decrypt captcha - if all(key in inputs for key in ("captcha_value", "captcha_id", "captcha_key")): - # Old version - last seen 9.12.2013 - self.logDebug('Using "old" version') - - captcha_value = self.decryptCaptcha("http://img.uloz.to/captcha/%s.png" % inputs['captcha_id']) - self.logDebug('CAPTCHA ID: ' + inputs['captcha_id'] + ", CAPTCHA VALUE: " + captcha_value) - - inputs.update({'captcha_id': inputs['captcha_id'], 'captcha_key': inputs['captcha_key'], 'captcha_value': captcha_value}) - - elif all(key in inputs for key in ("captcha_value", "timestamp", "salt", "hash")): - # New version - better to get new parameters (like captcha reload) because of image url - since 6.12.2013 - self.logDebug('Using "new" version') - - xapca = self.load("http://www.ulozto.net/reloadXapca.php", get={"rnd": str(int(time.time()))}) - self.logDebug('xapca = ' + str(xapca)) - - data = json_loads(xapca) - captcha_value = self.decryptCaptcha(str(data['image'])) - self.logDebug("CAPTCHA HASH: " + data['hash'] + ", CAPTCHA SALT: " + str(data['salt']) + ", CAPTCHA VALUE: " + captcha_value) - - inputs.update({'timestamp': data['timestamp'], 'salt': data['salt'], 'hash': data['hash'], 'captcha_value': captcha_value}) - else: - self.parseError("CAPTCHA form changed") - - self.multiDL = True - self.download("http://www.ulozto.net" + action, post=inputs, cookies=True, disposition=True) - - def handlePremium(self): - self.download(self.pyfile.url + "?do=directDownload", disposition=True) - #parsed_url = self.findDownloadURL(premium=True) - #self.download(parsed_url, post={"download": "Download"}) - - def findDownloadURL(self, premium=False): - msg = "%s link" % ("Premium" if premium else "Free") - m = re.search(self.PREMIUM_URL_PATTERN if premium else self.FREE_URL_PATTERN, self.html) - if m is None: - self.parseError(msg) - parsed_url = "http://www.ulozto.net" + m.group(1) - self.logDebug("%s: %s" % (msg, parsed_url)) - return parsed_url - - def doCheckDownload(self): - check = self.checkDownload({ - "wrong_captcha": re.compile(r'