From 0732eb3304039519b812eb35751bd974fe1140b8 Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 25 Mar 2013 16:05:20 +0100 Subject: NetloadIn: Fixed bug #49 netload URL regex doesn't allow https links --- module/plugins/hoster/NetloadIn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index d2bf37d70..e616badc2 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -54,8 +54,8 @@ def getInfo(urls): class NetloadIn(Hoster): __name__ = "NetloadIn" __type__ = "hoster" - __pattern__ = r"http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)" - __version__ = "0.41" + __pattern__ = r"https?://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)" + __version__ = "0.42" __description__ = """Netload.in Download Hoster""" __author_name__ = ("spoob", "RaNaN", "Gregy") __author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "gregy@gregy.cz") -- cgit v1.2.3 From f4ce5647c93b450e9052390655cb4e7456b8e777 Mon Sep 17 00:00:00 2001 From: enkore Date: Mon, 25 Mar 2013 19:25:13 +0100 Subject: Add plugin for ZDF mediathek --- module/plugins/hoster/ZDF.py | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 module/plugins/hoster/ZDF.py diff --git a/module/plugins/hoster/ZDF.py b/module/plugins/hoster/ZDF.py new file mode 100644 index 000000000..f72bde1ed --- /dev/null +++ b/module/plugins/hoster/ZDF.py @@ -0,0 +1,46 @@ + +import re +from xml.etree.ElementTree import fromstring + +from module.plugins.Hoster import Hoster + +XML_API = "http://www.zdf.de/ZDFmediathek/xmlservice/web/beitragsDetails?id=%i" + +class ZDF(Hoster): + # Based on zdfm + # http://github.com/enkore/zdfm/ + __name__ = "ZDF Mediathek" + __version__ = "0.7" + __pattern__ = r"http://www\.zdf\.de/ZDFmediathek/[^0-9]*([0-9]+)[^0-9]*" + __config__ = [] + + @staticmethod + def video_key(video): + return ( + int(video.findtext("videoBitrate", "0")), + any(f.text == "progressive" for f in video.iter("facet")), + ) + + @staticmethod + def video_valid(video): + return (video.findtext("url").startswith("http") and video.findtext("url").endswith(".mp4")) + + @staticmethod + def get_id(url): + return int(re.search(r"[^0-9]*([0-9]+)[^0-9]*", url).group(1)) + + def process(self, pyfile): + xml = fromstring(self.load(XML_API % self.get_id(pyfile.url))) + + status = xml.findtext("./status/statuscode") + if status != "ok": + self.fail("Error retrieving manifest.") + + video = xml.find("video") + title = video.findtext("information/title") + + pyfile.name = title + + target_url = sorted((v for v in video.iter("formitaet") if self.video_valid(v)), key=self.video_key)[-1].findtext("url") + + self.download(target_url) -- cgit v1.2.3 From 61d17f6c399d25409b5553eb3e78e601ded978f7 Mon Sep 17 00:00:00 2001 From: enkore Date: Mon, 25 Mar 2013 19:28:31 +0100 Subject: Add author --- module/plugins/hoster/ZDF.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/hoster/ZDF.py b/module/plugins/hoster/ZDF.py index f72bde1ed..ea45f4fd8 100644 --- a/module/plugins/hoster/ZDF.py +++ b/module/plugins/hoster/ZDF.py @@ -7,7 +7,7 @@ from module.plugins.Hoster import Hoster XML_API = "http://www.zdf.de/ZDFmediathek/xmlservice/web/beitragsDetails?id=%i" class ZDF(Hoster): - # Based on zdfm + # Based on zdfm by Roland Beermann # http://github.com/enkore/zdfm/ __name__ = "ZDF Mediathek" __version__ = "0.7" -- cgit v1.2.3 From 5f461121485ac69997565c3d35a26f4abbe388ae Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 25 Mar 2013 21:30:23 +0100 Subject: DebridItaliaCom: retry if the downloaded file is empty --- module/plugins/hoster/DebridItaliaCom.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index 5142bbdf7..a8f7dd57e 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -7,7 +7,7 @@ from module.plugins.Hoster import Hoster class DebridItaliaCom(Hoster): __name__ = "DebridItaliaCom" - __version__ = "0.01" + __version__ = "0.02" __type__ = "hoster" __pattern__ = r"https?://.*debriditalia\.com" __description__ = """Debriditalia.com hoster plugin""" @@ -35,4 +35,9 @@ class DebridItaliaCom(Hoster): self.logDebug("New URL: %s" % new_url) - self.download(new_url, disposition=True) \ No newline at end of file + self.download(new_url, disposition=True) + + check = self.checkDownload({"empty": re.compile(r"^$")}) + + if check == "empty": + self.retry(5, 120, 'Empty file downloaded') -- cgit v1.2.3 From 574e9030558cb2412c78cf6107d220c297fd05f8 Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 25 Mar 2013 21:40:28 +0100 Subject: AlldebridCom: code cleanup --- module/plugins/hoster/AlldebridCom.py | 37 ++++++++++++++--------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index fe58ff0a7..efc96ff28 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -1,19 +1,16 @@ -#!/usr/nv python # -*- coding: utf-8 -*- import re -from urllib import quote, unquote +from urllib import unquote from random import randrange -from os import stat - from module.plugins.Hoster import Hoster from module.common.json_layer import json_loads -from module.utils import parseFileSize, fs_encode +from module.utils import parseFileSize class AlldebridCom(Hoster): __name__ = "AlldebridCom" - __version__ = "0.3" + __version__ = "0.31" __type__ = "hoster" __pattern__ = r"https?://.*alldebrid\..*" @@ -27,7 +24,7 @@ class AlldebridCom(Hoster): except IndexError: name = "Unknown_Filename..." if name.endswith("..."): #incomplete filename, append random stuff - name += "%s.tmp" % randrange(100,999) + name += "%s.tmp" % randrange(100, 999) return name def init(self): @@ -35,10 +32,9 @@ class AlldebridCom(Hoster): self.chunkLimit = 3 self.resumeDownload = True - - def process(self, pyfile): + def process(self, pyfile): if not self.account: - self.logError(_("Please enter your AllDebrid account or deactivate this plugin")) + self.logError("Please enter your AllDebrid account or deactivate this plugin") self.fail("No AllDebrid account provided") self.log.debug("AllDebrid: Old URL: %s" % pyfile.url) @@ -46,14 +42,13 @@ class AlldebridCom(Hoster): new_url = pyfile.url else: password = self.getPassword().splitlines() - if not password: password = "" - else: password = password[0] + password = "" if not password else password[0] - url = "http://www.alldebrid.com/service.php?link=%s&json=true&pw=%s" %(pyfile.url, password) + 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.log.debug("Json data: %s" % str(data)) + + self.logDebug("Json data: %s" % str(data)) if data["error"]: if data["error"] == "This link isn't available on the hoster website.": @@ -72,7 +67,7 @@ class AlldebridCom(Hoster): else: new_url = new_url.replace("https://", "http://") - self.log.debug("AllDebrid: New URL: %s" % new_url) + self.logDebug("AllDebrid: New URL: %s" % new_url) if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): #only use when name wasnt already set @@ -80,12 +75,10 @@ class AlldebridCom(Hoster): self.download(new_url, disposition=True) - check = self.checkDownload( - {"error": "An error occured while processing your request","empty": re.compile(r"^$")}) + check = self.checkDownload({"error": "An error occured while processing your request", + "empty": re.compile(r"^$")}) if check == "error": self.retry(reason="An error occured while generating link.", wait_time=60) - else: - if check == "empty": - self.retry(reason="Downloaded File was empty.", wait_time=60) - + elif check == "empty": + self.retry(reason="Downloaded File was empty.", wait_time=60) -- cgit v1.2.3 From 495bf10578110b1af3e91300d6a778be4e601946 Mon Sep 17 00:00:00 2001 From: enkore Date: Mon, 25 Mar 2013 22:11:58 +0100 Subject: Rewrote FourChanOrg crypter --- module/plugins/crypter/FourChanOrg.py | 38 +++++++++++------------------------ 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/module/plugins/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py index cbcdd920c..5c96e723d 100644 --- a/module/plugins/crypter/FourChanOrg.py +++ b/module/plugins/crypter/FourChanOrg.py @@ -6,34 +6,20 @@ import re from module.plugins.Crypter import Crypter class FourChanOrg(Crypter): + # Based on 4chandl by Roland Beermann + # https://gist.github.com/enkore/3492599 __name__ = "FourChanOrg" __type__ = "container" - __pattern__ = r"http://(www\.)?(img\.)?(zip\.)?4chan.org/\w+/(res/|imgboard\.html)" - __version__ = "0.1" - __description__ = """4chan.org Thread Download Plugin""" - __author_name__ = ("Spoob") - __author_mail__ = ("Spoob@pyload.org") + __version__ = "0.3" + __pattern__ = r"http://boards\.4chan.org/\w+/res/(\d+)" + __description__ = "Downloader for entire 4chan threads" - def __init__(self, parent): - Crypter.__init__(self, parent) - self.parent = parent - self.html = None + def decrypt(self, pyfile): + pagehtml = self.load(pyfile.url) - def file_exists(self): - """ returns True or False - """ - return True + images = set(re.findall(r'(images\.4chan\.org/[^/]*/src/[^"<]*)', pagehtml)) + urls = [] + for image in images: + urls.append("http://" + image) - def proceed(self, url, location): - url = self.parent.url - html = self.req.load(url) - link_pattern = "" - temp_links = [] - if "imagebord.html" in url: - link_pattern = '[Reply]' - temp_links = re.findall(link_pattern, html) - for link in re.findall(link_pattern, html): - temp_links.append(link) - else: - temp_links = re.findall('File : Date: Tue, 26 Mar 2013 00:57:37 +0100 Subject: Add module.utils.which --- module/utils.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/module/utils.py b/module/utils.py index 8748b7693..895768cba 100644 --- a/module/utils.py +++ b/module/utils.py @@ -195,6 +195,26 @@ def html_unescape(text): """Removes HTML or XML character references and entities from a text string""" return re.sub("&#?\w+;", fixup, text) +def which(program): + """Works exactly like the unix command which + + Courtesy of http://stackoverflow.com/a/377028/675646""" + def is_exe(fpath): + return os.path.isfile(fpath) and os.access(fpath, os.X_OK) + + fpath, fname = os.path.split(program) + if fpath: + if is_exe(program): + return program + else: + for path in os.environ["PATH"].split(os.pathsep): + path = path.strip('"') + exe_file = os.path.join(path, program) + if is_exe(exe_file): + return exe_file + + return None + if __name__ == "__main__": print freeSpace(".") -- cgit v1.2.3 From 8c655c6835e864c81d71a0e15a4d79bdb3cdfa1d Mon Sep 17 00:00:00 2001 From: enkore Date: Tue, 26 Mar 2013 01:00:15 +0100 Subject: YoutubeCom: Add support for time specification, if ffmpeg is installed and in PATH --- module/plugins/hoster/YoutubeCom.py | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index a9fed5638..9f21ddf79 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -2,9 +2,11 @@ # -*- coding: utf-8 -*- import re +import subprocess +import os from urllib import unquote -from module.utils import html_unescape +from module.utils import html_unescape, which from module.plugins.Hoster import Hoster class YoutubeCom(Hoster): @@ -114,5 +116,25 @@ class YoutubeCom(Hoster): file_name_pattern = '' name = re.search(file_name_pattern, html).group(1).replace("/", "") + file_suffix pyfile.name = html_unescape(name) - - self.download(url) \ No newline at end of file + + filename = self.download(url) + + ffmpeg = which("ffmpeg") + if ffmpeg: + time = re.search(r"t=((\d+)m)?(\d+)s", pyfile.url) + if time: + m, s = time.groups()[1:] + if not m: + m = "0" + + inputfile = filename + "_" + os.rename(filename, inputfile) + + subprocess.call([ + which("ffmpeg"), + "-ss", "00:%s:%s" % (m, s), + "-i", inputfile, + "-vcodec", "copy", + "-acodec", "copy", + filename]) + os.remove(inputfile) -- cgit v1.2.3 From 703422d3e7ae56ff74c5ab95a5dd9f5f92a6bd83 Mon Sep 17 00:00:00 2001 From: enkore Date: Tue, 26 Mar 2013 13:41:36 +0100 Subject: Move which function to YoutubeCom plugin --- module/plugins/hoster/YoutubeCom.py | 23 ++++++++++++++++++++++- module/utils.py | 20 -------------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 9f21ddf79..4bc608b05 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -4,11 +4,32 @@ import re import subprocess import os +import os.path from urllib import unquote -from module.utils import html_unescape, which +from module.utils import html_unescape from module.plugins.Hoster import Hoster +def which(program): + """Works exactly like the unix command which + + Courtesy of http://stackoverflow.com/a/377028/675646""" + def is_exe(fpath): + return os.path.isfile(fpath) and os.access(fpath, os.X_OK) + + fpath, fname = os.path.split(program) + if fpath: + if is_exe(program): + return program + else: + for path in os.environ["PATH"].split(os.pathsep): + path = path.strip('"') + exe_file = os.path.join(path, program) + if is_exe(exe_file): + return exe_file + + return None + class YoutubeCom(Hoster): __name__ = "YoutubeCom" __type__ = "hoster" diff --git a/module/utils.py b/module/utils.py index 895768cba..8748b7693 100644 --- a/module/utils.py +++ b/module/utils.py @@ -195,26 +195,6 @@ def html_unescape(text): """Removes HTML or XML character references and entities from a text string""" return re.sub("&#?\w+;", fixup, text) -def which(program): - """Works exactly like the unix command which - - Courtesy of http://stackoverflow.com/a/377028/675646""" - def is_exe(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) - - fpath, fname = os.path.split(program) - if fpath: - if is_exe(program): - return program - else: - for path in os.environ["PATH"].split(os.pathsep): - path = path.strip('"') - exe_file = os.path.join(path, program) - if is_exe(exe_file): - return exe_file - - return None - if __name__ == "__main__": print freeSpace(".") -- cgit v1.2.3 From fafd901d97eaa80f3d67c92cd95074fa61ed3262 Mon Sep 17 00:00:00 2001 From: enkore Date: Tue, 26 Mar 2013 13:45:29 +0100 Subject: YoutubeCom: Show start time in package name --- module/plugins/hoster/YoutubeCom.py | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 4bc608b05..f01094c7d 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -138,24 +138,26 @@ class YoutubeCom(Hoster): name = re.search(file_name_pattern, html).group(1).replace("/", "") + file_suffix pyfile.name = html_unescape(name) + time = re.search(r"t=((\d+)m)?(\d+)s", pyfile.url) + if time: + m, s = time.groups()[1:] + if not m: + m = "0" + + pyfile.name += " (starting at %s:%s)" % (m, s) + filename = self.download(url) ffmpeg = which("ffmpeg") if ffmpeg: - time = re.search(r"t=((\d+)m)?(\d+)s", pyfile.url) - if time: - m, s = time.groups()[1:] - if not m: - m = "0" - - inputfile = filename + "_" - os.rename(filename, inputfile) - - subprocess.call([ - which("ffmpeg"), - "-ss", "00:%s:%s" % (m, s), - "-i", inputfile, - "-vcodec", "copy", - "-acodec", "copy", - filename]) - os.remove(inputfile) + inputfile = filename + "_" + os.rename(filename, inputfile) + + subprocess.call([ + ffmpeg, + "-ss", "00:%s:%s" % (m, s), + "-i", inputfile, + "-vcodec", "copy", + "-acodec", "copy", + filename]) + os.remove(inputfile) -- cgit v1.2.3 From ba5b01cc56ab2d99f51ee3b6bd21bac90e2c806d Mon Sep 17 00:00:00 2001 From: enkore Date: Tue, 26 Mar 2013 13:48:34 +0100 Subject: YoutubeCom: fix program flow quirks --- module/plugins/hoster/YoutubeCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index f01094c7d..ce9fe4945 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -139,7 +139,8 @@ class YoutubeCom(Hoster): pyfile.name = html_unescape(name) time = re.search(r"t=((\d+)m)?(\d+)s", pyfile.url) - if time: + ffmpeg = which("ffmpeg") + if ffmpeg and time: m, s = time.groups()[1:] if not m: m = "0" @@ -148,8 +149,7 @@ class YoutubeCom(Hoster): filename = self.download(url) - ffmpeg = which("ffmpeg") - if ffmpeg: + if ffmpeg and time: inputfile = filename + "_" os.rename(filename, inputfile) -- cgit v1.2.3 From 1b935cc92a420b264dabe5160c64eba165200c73 Mon Sep 17 00:00:00 2001 From: enkore Date: Tue, 26 Mar 2013 13:50:19 +0100 Subject: YoutubeCom: Fix file naming quirks --- module/plugins/hoster/YoutubeCom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index ce9fe4945..8b8764367 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -135,7 +135,7 @@ class YoutubeCom(Hoster): #set file name file_suffix = self.formats[fmt][0] if fmt in self.formats else ".flv" file_name_pattern = '' - name = re.search(file_name_pattern, html).group(1).replace("/", "") + file_suffix + name = re.search(file_name_pattern, html).group(1).replace("/", "") pyfile.name = html_unescape(name) time = re.search(r"t=((\d+)m)?(\d+)s", pyfile.url) @@ -146,6 +146,7 @@ class YoutubeCom(Hoster): m = "0" pyfile.name += " (starting at %s:%s)" % (m, s) + pyfile.name += file_suffix filename = self.download(url) -- cgit v1.2.3 From dbd39676d6b3f5842c2ff342a154b1551c60f7a8 Mon Sep 17 00:00:00 2001 From: Stefano Date: Wed, 27 Mar 2013 20:29:09 +0100 Subject: LinkdecrypterCom: fixed bug #54 regex doesn't allow https links --- module/plugins/hooks/LinkdecrypterCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 2cb91d120..d3d6bce68 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -24,7 +24,7 @@ from module.utils import remove_chars class LinkdecrypterCom(Hook): __name__ = "LinkdecrypterCom" - __version__ = "0.16" + __version__ = "0.17" __description__ = """linkdecrypter.com - regexp loader""" __config__ = [ ("activated", "bool", "Activated" , "True") ] __author_name__ = ("zoidberg") @@ -50,7 +50,7 @@ class LinkdecrypterCom(Hook): self.logError(_("Crypter list is empty")) return - regexp = r"http://([^.]+\.)*?(%s)/.*" % "|".join(online) + regexp = r"https?://([^.]+\.)*?(%s)/.*" % "|".join(online) dict = self.core.pluginManager.crypterPlugins[self.__name__] dict["pattern"] = regexp -- cgit v1.2.3 From 8801af3abae628053a66af59c5df2a0bb9584ddd Mon Sep 17 00:00:00 2001 From: Stefano Date: Fri, 29 Mar 2013 21:59:48 +0100 Subject: New hoster: FilerNet --- module/plugins/hoster/FilerNet.py | 103 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 module/plugins/hoster/FilerNet.py diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py new file mode 100644 index 000000000..9693723f9 --- /dev/null +++ b/module/plugins/hoster/FilerNet.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8 -*- + +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +############################################################################ + +# Test links (random.bin): +# http://filer.net/get/ivgf5ztw53et3ogd +# http://filer.net/get/hgo14gzcng3scbvv + +import pycurl +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.ReCaptcha import ReCaptcha + + +class FilerNet(SimpleHoster): + __name__ = "FilerNet" + __type__ = "hoster" + __pattern__ = r"https?://(www\.)?filer\.net/get/(\w+)" + __version__ = "0.01" + __description__ = """Filer.net Download Hoster""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + FILE_INFO_PATTERN = r'

Free Download (?P\S+) (?P[\w.]+) (?P\w+)

' + FILE_OFFLINE_PATTERN = r'Nicht gefunden' + RECAPTCHA_KEY = '6LcFctISAAAAAAgaeHgyqhNecGJJRnxV1m_vAz3V' + + def process(self, pyfile): + self.req.setOption("timeout", 120) + self.html = self.load(pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES) + + # Wait between downloads + m = re.search(r'musst du (\d+) Sekunden warten', self.html) + if m: + waittime = int(m.group(1)) + self.retry(3, waittime, 'Wait between free downloads') + + self.getFileInfo() + if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()): + self.handlePremium() + else: + self.handleFree() + + def handleFree(self): + self.html = self.load(self.pyfile.url, decode=True) + + inputs = self.parseHtmlForm(input_names='token')[1] + if 'token' not in inputs: + self.parseError('Unable to detect token') + token = inputs['token'] + self.logDebug('Token: ' + token) + + self.html = self.load(self.pyfile.url, post={'token': token}, decode=True) + + inputs = self.parseHtmlForm(input_names='hash')[1] + if 'hash' not in inputs: + self.parseError('Unable to detect hash') + hash_data = inputs['hash'] + self.logDebug('Hash: ' + hash_data) + + downloadURL = '' + recaptcha = ReCaptcha(self) + for i in xrange(5): + challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) + post_data = {'recaptcha_challenge_field': challenge, + 'recaptcha_response_field': response, + 'hash': hash_data} + + # Workaround for 0.4.9 just_header issue. In 0.5 clean the code using just_header + self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) + self.load(self.pyfile.url, post=post_data) + self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) + + if 'location' in self.req.http.header: + location = re.search(r'location: (\S+)', self.req.http.header).group(1) + downloadURL = 'http://filer.net' + location + self.correctCaptcha() + break + else: + self.logInfo('Wrong captcha') + self.invalidCaptcha() + + if not downloadURL: + self.fail("No Download url retrieved/all captcha attempts failed") + + self.download(downloadURL, disposition=True) + + +getInfo = create_getInfo(FilerNet) -- cgit v1.2.3 From 3634f7f678ed58becda172192536f756a61b2ec1 Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 30 Mar 2013 21:20:35 +0100 Subject: Two plugins updated to avoid errors in 0.5 --- module/plugins/crypter/UlozToFolder.py | 2 +- module/plugins/hoster/OneFichierCom.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index c6672ea8c..814d5240d 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -7,7 +7,7 @@ class UlozToFolder(Crypter): __name__ = "UlozToFolder" __type__ = "crypter" __pattern__ = r"http://.*(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(m|soubory)/.*" - __version__ = "0.1a" + __version__ = "0.2" __description__ = """Uloz.to Folder Plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 46323d829..922eb3a1f 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -10,8 +10,7 @@ class OneFichierCom(SimpleHoster): __version__ = "0.45" __description__ = """1fichier.com download hoster""" __author_name__ = ("fragonib", "the-razer", "zoidberg","imclem") - __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "daniel_ AT gmx DOT net", - "zoidberg@mujmail.cz","imclem on github") + __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "daniel_ AT gmx DOT net", "zoidberg@mujmail.cz","imclem on github") FILE_NAME_PATTERN = r'">File name :\s*(?P[^<]+)' FILE_SIZE_PATTERN = r'File size :\s*(?P[^<]+)' -- cgit v1.2.3 From 173c5f3ccfb06b4a24b38e59ad73127fc363eea4 Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 30 Mar 2013 21:35:19 +0100 Subject: OneFichierCom: version number increased --- module/plugins/hoster/OneFichierCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 922eb3a1f..7b87bbe71 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -7,7 +7,7 @@ class OneFichierCom(SimpleHoster): __name__ = "OneFichierCom" __type__ = "hoster" __pattern__ = r"(http://(\w+)\.((1fichier|d(es)?fichiers|pjointe)\.(com|fr|net|org)|(cjoint|mesfichiers|piecejointe|oi)\.(org|net)|tenvoi\.(com|org|net)|dl4free\.com|alterupload\.com|megadl.fr))" - __version__ = "0.45" + __version__ = "0.46" __description__ = """1fichier.com download hoster""" __author_name__ = ("fragonib", "the-razer", "zoidberg","imclem") __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "daniel_ AT gmx DOT net", "zoidberg@mujmail.cz","imclem on github") -- cgit v1.2.3 From c54be663c5db62765c0553f80826a64109016d5a Mon Sep 17 00:00:00 2001 From: Stefano Date: Sun, 31 Mar 2013 16:08:30 +0300 Subject: RarefileNet: fixed url http://forum.pyload.org/viewtopic.php?f=12&t=2148 --- module/plugins/accounts/RarefileNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/accounts/RarefileNet.py b/module/plugins/accounts/RarefileNet.py index 57f293c55..90ad02d43 100644 --- a/module/plugins/accounts/RarefileNet.py +++ b/module/plugins/accounts/RarefileNet.py @@ -3,10 +3,10 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class RarefileNet(XFSPAccount): __name__ = "RarefileNet" - __version__ = "0.01" + __version__ = "0.02" __type__ = "account" __description__ = """RareFile.net account plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - MAIN_PAGE = "http://rarefile.in/" \ No newline at end of file + MAIN_PAGE = "http://rarefile.net/" -- cgit v1.2.3 From f802d769fac6e1c2e296507df2a56ce4b79e9ec1 Mon Sep 17 00:00:00 2001 From: Stefano Date: Sun, 31 Mar 2013 15:15:40 +0200 Subject: New crypter plugin for Goo.gl --- module/plugins/crypter/GooGl.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 module/plugins/crypter/GooGl.py diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py new file mode 100644 index 000000000..07de5e008 --- /dev/null +++ b/module/plugins/crypter/GooGl.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- + +from module.plugins.Crypter import Crypter +from module.common.json_layer import json_loads + + +class GooGl(Crypter): + __name__ = "GooGl" + __type__ = "crypter" + __pattern__ = r"https?://(www\.)?goo\.gl/\w+" + __version__ = "0.01" + __description__ = """Goo.gl Crypter Plugin""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + API_URL = 'https://www.googleapis.com/urlshortener/v1/url' + + def decrypt(self, pyfile): + rep = self.load(self.API_URL, get={'shortUrl': pyfile.url}) + self.logDebug('JSON data: ' + rep) + rep = json_loads(rep) + + if 'longUrl' in rep: + self.core.files.addLinks([rep['longUrl']], self.pyfile.package().id) + else: + self.fail('Unable to expand shortened link') -- cgit v1.2.3 From 9f7a6a0ac03ddf78bfedbb34b0e21becd441a4af Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 1 Apr 2013 01:51:26 +0300 Subject: DebridItaliaCom: two new hosters supported --- module/plugins/hooks/DebridItaliaCom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index 8cd997f4d..3a10ecfc2 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -5,7 +5,7 @@ from module.plugins.internal.MultiHoster import MultiHoster class DebridItaliaCom(MultiHoster): __name__ = "DebridItaliaCom" - __version__ = "0.01" + __version__ = "0.02" __type__ = "hook" __config__ = [("activated", "bool", "Activated", "False"), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), @@ -22,4 +22,5 @@ class DebridItaliaCom(MultiHoster): "uploading.com", "megashares.com", "crocko.com", "filepost.com", "bitshare.com", "share-links.biz", "putlocker.com", "uploaded.to", "speedload.org", "rapidgator.net", "likeupload.net", "cyberlocker.ch", - "depositfiles.com", "extabit.com", "filefactory.com", "sharefiles.co"] + "depositfiles.com", "extabit.com", "filefactory.com", "sharefiles.co", + "ryushare.com", "tusfiles.net"] -- cgit v1.2.3 From 3b52a1537e599efca78da3ca89306a5b0f5081de Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 1 Apr 2013 15:16:02 +0200 Subject: RarefileNet: added pattern to support premium downloads --- module/plugins/hoster/RarefileNet.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/module/plugins/hoster/RarefileNet.py b/module/plugins/hoster/RarefileNet.py index 7c5543cc8..a0f5930b5 100644 --- a/module/plugins/hoster/RarefileNet.py +++ b/module/plugins/hoster/RarefileNet.py @@ -1,30 +1,34 @@ # -*- 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" __pattern__ = r"http://(?:\w*\.)*rarefile.net/\w{12}" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Rarefile.net hoster plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - + FILE_NAME_PATTERN = r'(?P.*?)' FILE_SIZE_PATTERN = r'Size : (?P.+?) ' + DIRECT_LINK_PATTERN = r'
(?P=link)' HOSTER_NAME = "rarefile.net" - + def setup(self): - self.resumeDownload = self.multiDL = self.premium - + 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) + 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) + self.logDebug("CAPTCHA", inputs['code'], numerals) return 3 -getInfo = create_getInfo(RarefileNet) \ No newline at end of file +getInfo = create_getInfo(RarefileNet) -- cgit v1.2.3 From 4279f57d08844ed7a67d91aa3863baa0ed1164fe Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 2 Apr 2013 01:19:16 +0200 Subject: New hoster: Data.hu --- module/plugins/hoster/DataHu.py | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 module/plugins/hoster/DataHu.py diff --git a/module/plugins/hoster/DataHu.py b/module/plugins/hoster/DataHu.py new file mode 100644 index 000000000..7abd93d1f --- /dev/null +++ b/module/plugins/hoster/DataHu.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- + +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +############################################################################ + +# Test links (random.bin): +# 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" + __pattern__ = r"http://(www\.)?data.hu/get/\w+" + __version__ = "0.01" + __description__ = """Data.hu Download Hoster""" + __author_name__ = ("crash", "stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + FILE_INFO_PATTERN = ur'(?P<N>.*) \((?P<S>[^)]+)\) let\xf6lt\xe9se' + FILE_OFFLINE_PATTERN = ur'Az adott f\xe1jl nem l\xe9tezik' + DIRECT_LINK_PATTERN = r'
' + + def handleFree(self): + self.resumeDownload = True + self.html = self.load(self.pyfile.url, decode=True) + + m = re.search(self.DIRECT_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) -- cgit v1.2.3 From f4a45c283af44e58595b12161021e4e8f094d4b4 Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 2 Apr 2013 12:46:05 +0300 Subject: DebridItaliaCom: new hoster supported --- module/plugins/hooks/DebridItaliaCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index 3a10ecfc2..f82eb10ff 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -5,7 +5,7 @@ from module.plugins.internal.MultiHoster import MultiHoster class DebridItaliaCom(MultiHoster): __name__ = "DebridItaliaCom" - __version__ = "0.02" + __version__ = "0.03" __type__ = "hook" __config__ = [("activated", "bool", "Activated", "False"), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), @@ -23,4 +23,4 @@ class DebridItaliaCom(MultiHoster): "bitshare.com", "share-links.biz", "putlocker.com", "uploaded.to", "speedload.org", "rapidgator.net", "likeupload.net", "cyberlocker.ch", "depositfiles.com", "extabit.com", "filefactory.com", "sharefiles.co", - "ryushare.com", "tusfiles.net"] + "ryushare.com", "tusfiles.net", "nowvideo.co"] -- cgit v1.2.3 From 6260e02b65d3be072c8392c3b2e36ef47d215c41 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 2 Apr 2013 16:52:03 +0200 Subject: Unrar also deletes .r* files --- module/plugins/internal/UnRar.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index 240dc0233..ef04f558e 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -28,12 +28,13 @@ from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPas class UnRar(AbtractExtractor): __name__ = "UnRar" - __version__ = "0.11" + __version__ = "0.12" # there are some more uncovered rar formats - re_splitfile = re.compile(r"(.*)\.part(\d+)\.rar$") + re_splitfile = re.compile(r"(.*)\.part(\d+)\.rar$", re.I) + re_partfiles = re.compile(r".*\.(rar|r[0-9]+)", re.I) re_filelist = re.compile(r"(.+)\s+(\d+)\s+(\d+)\s+") - re_wrongpwd = re.compile("(Corrupt file or wrong password|password incorrect)") + re_wrongpwd = re.compile("(Corrupt file or wrong password|password incorrect)", re.I) CMD = "unrar" @staticmethod @@ -139,7 +140,9 @@ class UnRar(AbtractExtractor): def getDeleteFiles(self): if ".part" in self.file: return glob(re.sub("(?<=\.part)([01]+)", "*", self.file, re.IGNORECASE)) - return [self.file] + # get files which matches .r* and filter unsuited files out + parts = glob(re.sub(r"(?<=\.r)ar$", "*", self.file, re.IGNORECASE)) + return filter(lambda x: self.re_partfiles.match(x), parts) def listContent(self): command = "vb" if self.fullpath else "lb" -- cgit v1.2.3 From 062ba46a2c99c7fefe1223d2d2694f4a84082764 Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 2 Apr 2013 20:24:52 +0200 Subject: New crypter for Data.hu folders --- module/plugins/crypter/DataHuFolder.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 module/plugins/crypter/DataHuFolder.py diff --git a/module/plugins/crypter/DataHuFolder.py b/module/plugins/crypter/DataHuFolder.py new file mode 100644 index 000000000..5d0d38f79 --- /dev/null +++ b/module/plugins/crypter/DataHuFolder.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.SimpleCrypter import SimpleCrypter + + +class DataHuFolder(SimpleCrypter): + __name__ = "DataHuFolder" + __type__ = "crypter" + __pattern__ = r"http://(www\.)?data.hu/dir/\w+" + __version__ = "0.01" + __description__ = """Data.hu Folder Plugin""" + __author_name__ = ("crash") + + LINK_PATTERN = r"\1" + TITLE_PATTERN = ur'(.+) Let\xf6lt\xe9se' -- cgit v1.2.3 From 1a95a01a675fc46e178a194a834578ab149db403 Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 2 Apr 2013 21:43:28 +0200 Subject: DataHuFolder: added support to password protected folders --- module/plugins/crypter/DataHuFolder.py | 44 +++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/module/plugins/crypter/DataHuFolder.py b/module/plugins/crypter/DataHuFolder.py index 5d0d38f79..a93e33cea 100644 --- a/module/plugins/crypter/DataHuFolder.py +++ b/module/plugins/crypter/DataHuFolder.py @@ -1,5 +1,22 @@ # -*- coding: utf-8 -*- +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +############################################################################ + +import re + from module.plugins.internal.SimpleCrypter import SimpleCrypter @@ -7,9 +24,30 @@ class DataHuFolder(SimpleCrypter): __name__ = "DataHuFolder" __type__ = "crypter" __pattern__ = r"http://(www\.)?data.hu/dir/\w+" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Data.hu Folder Plugin""" - __author_name__ = ("crash") + __author_name__ = ("crash", "stickell") + __author_mail__ = ("l.stickell@yahoo.it") LINK_PATTERN = r"\1" - TITLE_PATTERN = ur'(.+) Let\xf6lt\xe9se' + TITLE_PATTERN = ur'(?P<title>.+) Let\xf6lt\xe9se' + + def decrypt(self, pyfile): + self.html = self.load(pyfile.url, decode=True) + + if u'K\xe9rlek add meg a jelsz\xf3t' in self.html: # Password protected + password = self.getPassword() + self.logDebug('The folder is password protected', 'Using password: ' + password) + self.html = self.load(pyfile.url, post={'mappa_pass': password}, decode=True) + if u'Hib\xe1s jelsz\xf3' in self.html: # Wrong password + self.fail("Incorrect password, please set right password on Add package form and retry") + + package_name, folder_name = self.getPackageNameAndFolder() + + package_links = re.findall(self.LINK_PATTERN, self.html) + self.logDebug('Package has %d links' % len(package_links)) + + if package_links: + self.packages = [(package_name, package_links, folder_name)] + else: + self.fail('Could not extract any links') -- cgit v1.2.3 From a0308bfa9767895e629c1746e4b9e80313c33237 Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 2 Apr 2013 21:45:20 +0200 Subject: SimpleCrypter: decoding loaded html --- module/plugins/internal/SimpleCrypter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index b8942c724..a36df1979 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -22,7 +22,7 @@ from module.plugins.Crypter import Crypter class SimpleCrypter(Crypter): __name__ = "SimpleCrypter" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = None __type__ = "crypter" __description__ = """Base crypter plugin""" @@ -39,7 +39,7 @@ class SimpleCrypter(Crypter): """ def decrypt(self, pyfile): - self.html = self.load(pyfile.url) + self.html = self.load(pyfile.url, decode=True) package_name, folder_name = self.getPackageNameAndFolder() -- cgit v1.2.3 From 75f150e522cb11fe3de2df05bc3ef5356872db19 Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 2 Apr 2013 21:46:15 +0200 Subject: SimpleHoster: fixed wrong pattern names in documentation --- module/plugins/internal/SimpleHoster.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index cfc9f2b43..69ed57ff8 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -155,8 +155,8 @@ class SimpleHoster(Hoster): """ These patterns should be defined by each hoster: FILE_INFO_PATTERN = r'(?Pfile_name) (?Pfile_size) (?Punits)' - or FILE_NAME_INFO = r'(?Pfile_name)' - and FILE_SIZE_INFO = r'(?Pfile_size) (?Punits)' + or FILE_NAME_PATTERN = r'(?Pfile_name)' + and FILE_SIZE_PATTERN = r'(?Pfile_size) (?Punits)' FILE_OFFLINE_PATTERN = r'File (deleted|not found)' TEMP_OFFLINE_PATTERN = r'Server maintainance' """ -- cgit v1.2.3 From e1993f0517457942ca30d9c9f2991070bb1e6543 Mon Sep 17 00:00:00 2001 From: Stefano Date: Wed, 3 Apr 2013 14:38:48 +0200 Subject: DataHuFolder: error message if folder is password protected but no password is specified --- module/plugins/crypter/DataHuFolder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/plugins/crypter/DataHuFolder.py b/module/plugins/crypter/DataHuFolder.py index a93e33cea..f710f60d7 100644 --- a/module/plugins/crypter/DataHuFolder.py +++ b/module/plugins/crypter/DataHuFolder.py @@ -24,7 +24,7 @@ class DataHuFolder(SimpleCrypter): __name__ = "DataHuFolder" __type__ = "crypter" __pattern__ = r"http://(www\.)?data.hu/dir/\w+" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Data.hu Folder Plugin""" __author_name__ = ("crash", "stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -37,6 +37,8 @@ class DataHuFolder(SimpleCrypter): if u'K\xe9rlek add meg a jelsz\xf3t' in self.html: # Password protected password = self.getPassword() + if password is '': + self.fail("No password specified, please set right password on Add package form and retry") self.logDebug('The folder is password protected', 'Using password: ' + password) self.html = self.load(pyfile.url, post={'mappa_pass': password}, decode=True) if u'Hib\xe1s jelsz\xf3' in self.html: # Wrong password -- cgit v1.2.3 From 12741a9f656cd5a0a96c29ed63a2988c5c2be9da Mon Sep 17 00:00:00 2001 From: nilo Date: Wed, 3 Apr 2013 14:04:03 +0200 Subject: added progress to unrar --- module/plugins/internal/UnRar.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index ef04f558e..ef31fbae2 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -114,15 +114,31 @@ class UnRar(AbtractExtractor): def extract(self, progress, password=None): command = "x" if self.fullpath else "e" - # popen thinks process is still alive (just like pexpect) - very strange behavior - # so for now progress can not be determined correctly p = self.call_unrar(command, self.file, self.out, password=password) renice(p.pid, self.renice) progress(0) - out, err = p.communicate() #wait for process + progressstring = "" + while True: + c = p.stdout.read(1) + # quit loop on eof + if not c: + break + # reading a percentage sign -> set progress and restart + if c == '%': + progress(int(progressstring)) + progressstring = "" + # not reading a digit -> therefore restart + elif re.match('[0-9]',c) is None: + progressstring = "" + # add digit to progressstring + else: + progressstring = progressstring + c progress(100) + # retrieve stderr + err = p.stderr.read() + if "CRC failed" in err and not password and not self.passwordProtected: raise CRCError elif "CRC failed" in err: -- cgit v1.2.3 From d8fd1819a672887471678344a856747302d9cd56 Mon Sep 17 00:00:00 2001 From: Stefano Date: Wed, 3 Apr 2013 18:06:47 +0300 Subject: SimpleCrypter: trivial fix in documentation --- module/plugins/internal/SimpleCrypter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index a36df1979..b2cc03985 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -18,8 +18,10 @@ """ import re + from module.plugins.Crypter import Crypter + class SimpleCrypter(Crypter): __name__ = "SimpleCrypter" __version__ = "0.04" @@ -29,7 +31,7 @@ class SimpleCrypter(Crypter): __author_name__ = ("stickell", "zoidberg") __author_mail__ = ("l.stickell@yahoo.it", "zoidberg@mujmail.cz") """ - These patterns should be defined by each hoster: + These patterns should be defined by each crypter: LINK_PATTERN: group(1) must be a download link example: [\t\n\rn ]+Tired of ads and waiting\\? Go Pro\\![\t\n\rn ]+
[\t\n\rn ]+ Date: Thu, 4 Apr 2013 18:40:35 +0200 Subject: UploadedTo: update regex to fix bug #62 + cosmetics --- module/plugins/hoster/UploadedTo.py | 53 ++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index a2134ecb5..5d8c9a5ac 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -11,34 +11,37 @@ from module.plugins.ReCaptcha import ReCaptcha key = "bGhGMkllZXByd2VEZnU5Y2NXbHhYVlZ5cEE1bkEzRUw=".decode('base64') + def getID(url): """ returns id from file url""" - m = re.match(r"http://[\w\.-]*?(uploaded\.(to|net)(/file/|/?\?id=|.*?&id=)|ul\.to/)(?P\w+)", url) + m = re.match(r"http://[\w\.-]*?(uploaded\.(to|net)|ul\.to)(/file/|/?\?id=|.*?&id=)(?P\w+)", url) return m.group('ID') + def getAPIData(urls): - post = {"apikey" : key} + post = {"apikey": key} - idMap = {} + idMap = {} - for i, url in enumerate(urls): - id = getID(url) - post["id_%s" % i] = id - idMap[id] = url + for i, url in enumerate(urls): + id = getID(url) + post["id_%s" % i] = id + idMap[id] = url - api = unicode(getURL("http://uploaded.net/api/filemultiple", post=post, decode=False), 'iso-8859-1') + api = unicode(getURL("http://uploaded.net/api/filemultiple", post=post, decode=False), 'iso-8859-1') - result = {} + result = {} - if api: - for line in api.splitlines(): - data = line.split(",", 4) - if data[1] in idMap: - result[data[1]] = (data[0], data[2], data[4], data[3], idMap[data[1]]) + if api: + for line in api.splitlines(): + data = line.split(",", 4) + if data[1] in idMap: + result[data[1]] = (data[0], data[2], data[4], data[3], idMap[data[1]]) - return result + return result -def parseFileInfo(self, url = '', html = ''): + +def parseFileInfo(self, url='', html=''): if not html and hasattr(self, "html"): html = self.html name, size, status, found, fileid = url, 0, 3, None, None @@ -54,6 +57,7 @@ def parseFileInfo(self, url = '', html = ''): return name, size, status, fileid + def getInfo(urls): for chunk in chunks(urls, 80): result = [] @@ -74,7 +78,7 @@ class UploadedTo(Hoster): __name__ = "UploadedTo" __type__ = "hoster" __pattern__ = r"http://[\w\.-]*?(uploaded\.(to|net)(/file/|/?\?id=|.*?&id=)|ul\.to/)\w+" - __version__ = "0.64" + __version__ = "0.65" __description__ = """Uploaded.net Download Hoster""" __author_name__ = ("spoob", "mkaay", "zoidberg", "netpok", "stickell") __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz", "netpok@gmail.com", "l.stickell@yahoo.it") @@ -88,7 +92,7 @@ class UploadedTo(Hoster): self.multiDL = False self.resumeDownload = False self.url = False - self.chunkLimit = 1 # critical problems with more chunks + self.chunkLimit = 1 # critical problems with more chunks if self.account: self.premium = self.account.getAccountInfo(self.user)["premium"] if self.premium: @@ -108,7 +112,7 @@ class UploadedTo(Hoster): if not api: self.logWarning("No response for API call") - self.html = unicode(self.load(pyfile.url, decode = False), 'iso-8859-1') + self.html = unicode(self.load(pyfile.url, decode=False), 'iso-8859-1') name, size, status, self.fileID = parseFileInfo(self) self.logDebug(name, size, status, self.fileID) if status == 1: @@ -140,8 +144,9 @@ class UploadedTo(Hoster): def handlePremium(self): info = self.account.getAccountInfo(self.user, True) - self.log.debug("%(name)s: Use Premium Account (%(left)sGB left)" % {"name" :self.__name__, "left" : info["trafficleft"]/1024/1024}) - if int(self.data[1])/1024 > info["trafficleft"]: + self.log.debug("%(name)s: Use Premium Account (%(left)sGB left)" % {"name": self.__name__, + "left": info["trafficleft"] / 1024 / 1024}) + if int(self.data[1]) / 1024 > info["trafficleft"]: self.log.info(_("%s: Not enough traffic left" % self.__name__)) self.account.empty(self.user) self.resetAccount() @@ -185,7 +190,7 @@ class UploadedTo(Hoster): #self.req.lastURL = str(self.url) re_captcha = ReCaptcha(self) challenge, result = re_captcha.challenge(challengeId.group(1)) - options = {"recaptcha_challenge_field" : challenge, "recaptcha_response_field": result} + options = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": result} self.wait() result = self.load(url, post=options) @@ -193,13 +198,13 @@ class UploadedTo(Hoster): if "limit-size" in result: self.fail("File too big for free download") - elif "limit-slot" in result: # Temporary restriction so just wait a bit + elif "limit-slot" in result: # Temporary restriction so just wait a bit self.setWait(30 * 60, True) self.wait() self.retry() elif "limit-parallel" in result: self.fail("Cannot download in parallel") - elif self.DL_LIMIT_PATTERN in result: # limit-dl + elif self.DL_LIMIT_PATTERN in result: # limit-dl self.setWait(60 * 60, True) self.wait() self.retry() -- cgit v1.2.3 From 260f0e1f9dea492d88ebcb3f55b7575431a92573 Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 4 Apr 2013 18:51:51 +0200 Subject: DebridItaliaCom: + ability to detect offline files. + license note --- module/plugins/accounts/DebridItaliaCom.py | 15 +++++++++++++++ module/plugins/hooks/DebridItaliaCom.py | 15 +++++++++++++++ module/plugins/hoster/DebridItaliaCom.py | 22 ++++++++++++++++++++-- 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py index d68f1c8a8..91dd3787f 100644 --- a/module/plugins/accounts/DebridItaliaCom.py +++ b/module/plugins/accounts/DebridItaliaCom.py @@ -1,5 +1,20 @@ # -*- coding: utf-8 -*- +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +############################################################################ + import re import _strptime import time diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index f82eb10ff..d570eebe3 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -1,5 +1,20 @@ # -*- coding: utf-8 -*- +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +############################################################################ + from module.plugins.internal.MultiHoster import MultiHoster diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index a8f7dd57e..121a141b3 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -1,5 +1,20 @@ # -*- coding: utf-8 -*- +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +############################################################################ + import re from module.plugins.Hoster import Hoster @@ -7,7 +22,7 @@ from module.plugins.Hoster import Hoster class DebridItaliaCom(Hoster): __name__ = "DebridItaliaCom" - __version__ = "0.02" + __version__ = "0.03" __type__ = "hoster" __pattern__ = r"https?://.*debriditalia\.com" __description__ = """Debriditalia.com hoster plugin""" @@ -31,7 +46,10 @@ class DebridItaliaCom(Hoster): page = self.load(url) self.logDebug("XML data: %s" % page) - new_url = re.search(r'(?P[^<]+)', page).group('direct') + if 'File not available' in page: + self.offline() + else: + new_url = re.search(r'(?P[^<]+)', page).group('direct') self.logDebug("New URL: %s" % new_url) -- cgit v1.2.3 From 0f984f7e3fea8d7fb111543a23e0f7f617c1a63c Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 4 Apr 2013 20:55:09 +0200 Subject: PutlockerCom: code optimized and cleaned up --- module/plugins/hoster/PutlockerCom.py | 77 +++++++++++++++++------------------ 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/module/plugins/hoster/PutlockerCom.py b/module/plugins/hoster/PutlockerCom.py index e98e4d332..043adcb06 100644 --- a/module/plugins/hoster/PutlockerCom.py +++ b/module/plugins/hoster/PutlockerCom.py @@ -28,7 +28,7 @@ class PutlockerCom(SimpleHoster): __name__ = "PutlockerCom" __type__ = "hoster" __pattern__ = r'http://(www\.)?putlocker\.com/(file|embed)/[A-Z0-9]+' - __version__ = "0.22" + __version__ = "0.23" __description__ = """Putlocker.Com""" __author_name__ = ("jeix", "stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -39,43 +39,42 @@ class PutlockerCom(SimpleHoster): def handleFree(self): self.html = self.load(self.pyfile.url, decode=True) - self.link = self._getLink() - if not self.link.startswith('http://'): - self.link = "http://www.putlocker.com" + self.link - self.download(self.link, disposition=True) + link = self._getLink() + if not link.startswith('http://'): + link = "http://www.putlocker.com" + link + self.download(link, disposition=True) def _getLink(self): - self.hash = re.search("", self.html) - # if self.hash is None: - # self.fail("%s: Plugin broken." % self.__name__) - - self.param = "hash=" + self.hash.group(1) + "&confirm=Continue+as+Free+User" - self.html2 = self.load(self.pyfile.url, post=self.param) - if ">You have exceeded the daily stream limit for your country\\. You can wait until tomorrow" in self.html2 or "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html2: - self.waittime = 2 * 60 * 60 - self.retry(wait_time=self.waittime, reason="Waiting %s seconds" % self.waittime) - - self.link = re.search( - "Tired of ads and waiting\\? Go Pro\\![\t\n\rn ]+[\t\n\rn ]+', 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 or \ + "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html: + self.retry(wait_time=2 * 60 * 60, reason="Download limit exceeded or server disabled") + + link = re.search(r'(/get_file\.php\?id=[A-Z0-9]+&key=[A-Za-z0-9=]+&original=1)', self.html) + if not link: + link = re.search(r"(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+)", self.html) + + if not link: + link = re.search(r"(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+&original=1)", self.html) + + if not link: + link = re.search( + r'Tired of ads and waiting\? Go Pro![\t\n\rn ]+[\t\n\rn ]+ Date: Fri, 5 Apr 2013 17:37:13 +0200 Subject: PutlockerCom: using loop to avoid repeated statement --- module/plugins/hoster/PutlockerCom.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/module/plugins/hoster/PutlockerCom.py b/module/plugins/hoster/PutlockerCom.py index 043adcb06..9eff0dc2b 100644 --- a/module/plugins/hoster/PutlockerCom.py +++ b/module/plugins/hoster/PutlockerCom.py @@ -28,7 +28,7 @@ class PutlockerCom(SimpleHoster): __name__ = "PutlockerCom" __type__ = "hoster" __pattern__ = r'http://(www\.)?putlocker\.com/(file|embed)/[A-Z0-9]+' - __version__ = "0.23" + __version__ = "0.24" __description__ = """Putlocker.Com""" __author_name__ = ("jeix", "stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -55,19 +55,15 @@ class PutlockerCom(SimpleHoster): "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html: self.retry(wait_time=2 * 60 * 60, reason="Download limit exceeded or server disabled") - link = re.search(r'(/get_file\.php\?id=[A-Z0-9]+&key=[A-Za-z0-9=]+&original=1)', self.html) - if not link: - link = re.search(r"(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+)", self.html) - - if not link: - link = re.search(r"(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+&original=1)", self.html) - - if not link: - link = re.search( - r'Tired of ads and waiting\? Go Pro![\t\n\rn ]+[\t\n\rn ]+Tired of ads and waiting\? Go Pro![\t\n\rn ]+[\t\n\rn ]+ Date: Fri, 5 Apr 2013 21:41:55 +0200 Subject: EgoFilesCom: fixed bug in premium downloads. Sometimes for premium users pyfile.url redirect directly to the file, so the load call in the process function of SimpleHoster causes a pyCurl error. + content-disposition --- module/plugins/hoster/EgoFilesCom.py | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index b27abb416..ad278e60f 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -1,15 +1,34 @@ # -*- coding: utf-8 -*- +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +############################################################################ + +# Test link (random.bin): +# http://egofiles.com/mOZfMI1WLZ6HBkGG/random.bin + +import re + from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.plugins.ReCaptcha import ReCaptcha -import re class EgoFilesCom(SimpleHoster): __name__ = "EgoFilesCom" __type__ = "hoster" __pattern__ = r"https?://(www\.)?egofiles.com/(\w+)" - __version__ = "0.10" + __version__ = "0.11" __description__ = """Egofiles.com Download Hoster""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -25,8 +44,15 @@ class EgoFilesCom(SimpleHoster): # Set English language self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True) + def process(self, pyfile): + if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()): + self.handlePremium() + else: + self.handleFree() + def handleFree(self): self.html = self.load(self.pyfile.url, decode=True) + self.getFileInfo() # Wait time between free downloads if 'For next free download you have to wait' in self.html: @@ -56,7 +82,7 @@ class EgoFilesCom(SimpleHoster): if not downloadURL: self.fail("No Download url retrieved/all captcha attempts failed") - self.download(downloadURL) + self.download(downloadURL, disposition=True) def handlePremium(self): header = self.load(self.pyfile.url, just_header=True) @@ -65,11 +91,13 @@ class EgoFilesCom(SimpleHoster): self.download(header['location']) else: self.html = self.load(self.pyfile.url, decode=True) + self.getFileInfo() m = re.search(r'Download >', self.html) if not m: self.parseError('Unable to detect direct download url') else: self.logDebug('DIRECT URL from html: ' + m.group('link')) - self.download(m.group('link')) + self.download(m.group('link'), disposition=True) + getInfo = create_getInfo(EgoFilesCom) -- cgit v1.2.3