diff options
-rw-r--r-- | pyload/plugins/hoster/EgoFilesCom.py | 106 | ||||
-rw-r--r-- | pyload/plugins/hoster/FreakshareCom.py | 170 | ||||
-rw-r--r-- | pyload/plugins/hoster/LuckyShareNet.py | 75 | ||||
-rw-r--r-- | pyload/plugins/hoster/UploadedTo.py | 5 |
4 files changed, 0 insertions, 356 deletions
diff --git a/pyload/plugins/hoster/EgoFilesCom.py b/pyload/plugins/hoster/EgoFilesCom.py index 081821c06..274286cf1 100644 --- a/pyload/plugins/hoster/EgoFilesCom.py +++ b/pyload/plugins/hoster/EgoFilesCom.py @@ -1,108 +1,3 @@ -<<<<<<< HEAD:pyload/plugins/hoster/EgoFilesCom.py -# -*- coding: utf-8 -*- - -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ - -# 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 - - -class EgoFilesCom(SimpleHoster): - __name__ = "EgoFilesCom" - __type__ = "hoster" - __pattern__ = r"https?://(www\.)?egofiles.com/(\w+)" - __version__ = "0.13" - __description__ = """Egofiles.com Download Hoster""" - __author_name__ = ("stickell") - __author_mail__ = ("l.stickell@yahoo.it") - - FILE_INFO_PATTERN = r'<div class="down-file">\s+(?P<N>[^\t]+)\s+<div class="file-properties">\s+(File size|Rozmiar): (?P<S>[\w.]+) (?P<U>\w+) \|' - FILE_OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB' - WAIT_TIME_PATTERN = r'For next free download you have to wait <strong>((?P<m>\d*)m)? ?((?P<s>\d+)s)?</strong>' - DIRECT_LINK_PATTERN = r'<a href="(?P<link>[^"]+)">Download ></a>' - RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX' - - def init(self): - self.file_info = {} - # 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: - m = re.search(self.WAIT_TIME_PATTERN, self.html).groupdict('0') - waittime = int(m['m']) * 60 + int(m['s']) - self.setWait(waittime, True) - self.wait() - - 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} - self.html = self.load(self.pyfile.url, post=post_data, decode=True) - m = re.search(self.DIRECT_LINK_PATTERN, self.html) - if not m: - self.logInfo('Wrong captcha') - self.invalidCaptcha() - elif hasattr(m, 'group'): - downloadURL = m.group('link') - self.correctCaptcha() - break - else: - self.fail('Unknown error - Plugin may be out of date') - - if not downloadURL: - self.fail("No Download url retrieved/all captcha attempts failed") - - self.download(downloadURL, disposition=True) - - def handlePremium(self): - header = self.load(self.pyfile.url, just_header=True) - if header.has_key('location'): - self.logDebug('DIRECT LINK from header: ' + header['location']) - self.download(header['location']) - else: - self.html = self.load(self.pyfile.url, decode=True) - self.getFileInfo() - m = re.search(r'<a href="(?P<link>[^"]+)">Download ></a>', 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'), disposition=True) - - -getInfo = create_getInfo(EgoFilesCom) -======= # -*- coding: utf-8 -*- ############################################################################ @@ -206,4 +101,3 @@ class EgoFilesCom(SimpleHoster): getInfo = create_getInfo(EgoFilesCom) ->>>>>>> dd30ed8... Using CaptchaService to make them works on 0.5:module/plugins/hoster/EgoFilesCom.py diff --git a/pyload/plugins/hoster/FreakshareCom.py b/pyload/plugins/hoster/FreakshareCom.py index 9c9e20f46..156f697c3 100644 --- a/pyload/plugins/hoster/FreakshareCom.py +++ b/pyload/plugins/hoster/FreakshareCom.py @@ -1,172 +1,3 @@ -<<<<<<< HEAD:pyload/plugins/hoster/FreakshareCom.py -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.plugins.Hoster import Hoster -from module.plugins.ReCaptcha import ReCaptcha - -class FreakshareCom(Hoster): - __name__ = "FreakshareCom" - __type__ = "hoster" - __pattern__ = r"http://(?:www\.)?freakshare\.(net|com)/files/\S*?/" - __version__ = "0.37" - __description__ = """Freakshare.com Download Hoster""" - __author_name__ = ("sitacuisses","spoob","mkaay", "Toilal") - __author_mail__ = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de", "toilal.dev@gmail.com") - - def setup(self): - self.html = None - self.wantReconnect = False - self.multiDL = False - self.req_opts = [] - - def process(self, pyfile): - self.pyfile = pyfile - - pyfile.url = pyfile.url.replace("freakshare.net/","freakshare.com/") - - if self.account: - self.html = self.load(pyfile.url, cookies=False) - pyfile.name = self.get_file_name() - self.download(pyfile.url) - - else: - self.prepare() - self.get_file_url() - - self.download(self.pyfile.url, post=self.req_opts) - - - check = self.checkDownload({"bad": "bad try", - "paralell": "> Sorry, you cant download more then 1 files at time. <", - "empty": "Warning: Unknown: Filename cannot be empty", - "wrong_captcha": "Wrong Captcha!"}) - - if check == "bad": - self.fail("Bad Try.") - if check == "paralell": - self.setWait(300, True) - self.wait() - self.retry() - if check == "empty": - self.fail("File not downloadable") - if check == "wrong_captcha": - self.invalidCaptcha() - self.retry() - - def prepare(self): - pyfile = self.pyfile - - self.wantReconnect = False - - self.download_html() - - if not self.file_exists(): - self.offline() - - self.setWait( self.get_waiting_time() ) - - pyfile.name = self.get_file_name() - pyfile.size = self.get_file_size() - - self.wait() - - return True - - def download_html(self): - self.load("http://freakshare.com/index.php", {"language": "EN"}); # Set english language in server session - self.html = self.load(self.pyfile.url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html is None: - self.download_html() - if not self.wantReconnect: - self.req_opts = self.get_download_options() # get the Post options for the Request - #file_url = self.pyfile.url - #return file_url - else: - self.offline() - - def get_file_name(self): - if self.html is None: - self.download_html() - if not self.wantReconnect: - file_name = re.search(r"<h1\sclass=\"box_heading\"\sstyle=\"text-align:center;\">([^ ]+)", self.html) - if file_name is not None: - file_name = file_name.group(1) - else: - file_name = self.pyfile.url - return file_name - else: - return self.pyfile.url - - def get_file_size(self): - size = 0 - if self.html is None: - self.download_html() - if not self.wantReconnect: - file_size_check = re.search(r"<h1\sclass=\"box_heading\"\sstyle=\"text-align:center;\">[^ ]+ - ([^ ]+) (\w\w)yte", self.html) - if file_size_check is not None: - units = float(file_size_check.group(1).replace(",", "")) - pow = {'KB': 1, 'MB': 2, 'GB': 3}[file_size_check.group(2)] - size = int(units * 1024 ** pow) - - return size - - def get_waiting_time(self): - if self.html is None: - self.download_html() - - if "Your Traffic is used up for today" in self.html: - self.wantReconnect = True - return 24*3600 - - timestring = re.search('\s*var\s(?:downloadWait|time)\s=\s(\d*)[.\d]*;', self.html) - if timestring: - return int(timestring.group(1)) + 1 #add 1 sec as tenths of seconds are cut off - else: - return 60 - - - def file_exists(self): - """ returns True or False - """ - if self.html is None: - self.download_html() - if re.search(r"This file does not exist!", self.html) is not None: - return False - else: - return True - - def get_download_options(self): - re_envelope = re.search(r".*?value=\"Free\sDownload\".*?\n*?(.*?<.*?>\n*)*?\n*\s*?</form>", self.html).group(0) #get the whole request - to_sort = re.findall(r"<input\stype=\"hidden\"\svalue=\"(.*?)\"\sname=\"(.*?)\"\s\/>", re_envelope) - request_options = dict((n, v) for (v, n) in to_sort) - - herewego = self.load(self.pyfile.url, None, request_options) # the actual download-Page - - # comment this in, when it doesnt work - # with open("DUMP__FS_.HTML", "w") as fp: - # fp.write(herewego) - - to_sort = re.findall(r"<input\stype=\".*?\"\svalue=\"(\S*?)\".*?name=\"(\S*?)\"\s.*?\/>", herewego) - request_options = dict((n, v) for (v, n) in to_sort) - - # comment this in, when it doesnt work as well - #print "\n\n%s\n\n" % ";".join(["%s=%s" % x for x in to_sort]) - - challenge = re.search(r"http://api\.recaptcha\.net/challenge\?k=([0-9A-Za-z]+)", herewego) - - if challenge: - re_captcha = ReCaptcha(self) - request_options["recaptcha_challenge_field"], request_options["recaptcha_response_field"] \ - = re_captcha.challenge(challenge.group(1)) - - return request_options -======= #!/usr/bin/env python # -*- coding: utf-8 -*- @@ -334,4 +165,3 @@ class FreakshareCom(Hoster): = re_captcha.challenge(challenge.group(1)) return request_options ->>>>>>> dd30ed8... Using CaptchaService to make them works on 0.5:module/plugins/hoster/FreakshareCom.py diff --git a/pyload/plugins/hoster/LuckyShareNet.py b/pyload/plugins/hoster/LuckyShareNet.py index 5f6b26493..08e44d9f6 100644 --- a/pyload/plugins/hoster/LuckyShareNet.py +++ b/pyload/plugins/hoster/LuckyShareNet.py @@ -1,77 +1,3 @@ -<<<<<<< HEAD:pyload/plugins/hoster/LuckyShareNet.py -# -*- coding: utf-8 -*- - -import re -from module.lib.bottle import json_loads - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.plugins.ReCaptcha import ReCaptcha - - -class LuckyShareNet(SimpleHoster): - __name__ = "LuckyShareNet" - __type__ = "hoster" - __pattern__ = r"https?://(www\.)?luckyshare.net/(?P<ID>\d{10,})" - __version__ = "0.02" - __description__ = """LuckyShare.net Download Hoster""" - __author_name__ = ("stickell") - __author_mail__ = ("l.stickell@yahoo.it") - - FILE_INFO_PATTERN = r"<h1 class='file_name'>(?P<N>\S+)</h1>\s*<span class='file_size'>Filesize: (?P<S>[\d.]+)(?P<U>\w+)</span>" - FILE_OFFLINE_PATTERN = 'There is no such file available' - RECAPTCHA_KEY = '6LdivsgSAAAAANWh-d7rPE1mus4yVWuSQIJKIYNw' - - def parseJson(self, rep): - if 'AJAX Error' in rep: - html = self.load(self.pyfile.url, decode=True) - m = re.search(r"waitingtime = (\d+);", html) - if m: - waittime = int(m.group(1)) - self.logDebug('You have to wait %d seconds between free downloads' % waittime) - self.retry(wait_time=waittime) - else: - self.parseError('Unable to detect wait time between free downloads') - elif 'Hash expired' in rep: - self.retry(reason='Hash expired') - return json_loads(rep) - - # TODO: There should be a filesize limit for free downloads - # TODO: Some files could not be downloaded in free mode - def handleFree(self): - file_id = re.search(self.__pattern__, self.pyfile.url).group('ID') - self.logDebug('File ID: ' + file_id) - rep = self.load(r"http://luckyshare.net/download/request/type/time/file/" + file_id, decode=True) - self.logDebug('JSON: ' + rep) - json = self.parseJson(rep) - - self.setWait(int(json['time'])) - self.wait() - - recaptcha = ReCaptcha(self) - for i in xrange(5): - challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) - rep = self.load(r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s" % - (challenge, response, json['hash']), decode=True) - self.logDebug('JSON: ' + rep) - if 'link' in rep: - json.update(self.parseJson(rep)) - self.correctCaptcha() - break - elif 'Verification failed' in rep: - self.logInfo('Wrong captcha') - self.invalidCaptcha() - else: - self.parseError('Unable to get downlaod link') - - if not json['link']: - self.fail("No Download url retrieved/all captcha attempts failed") - - self.logDebug('Direct URL: ' + json['link']) - self.download(json['link']) - - -getInfo = create_getInfo(LuckyShareNet) -======= # -*- coding: utf-8 -*- import re @@ -144,4 +70,3 @@ class LuckyShareNet(SimpleHoster): getInfo = create_getInfo(LuckyShareNet) ->>>>>>> dd30ed8... Using CaptchaService to make them works on 0.5:module/plugins/hoster/LuckyShareNet.py diff --git a/pyload/plugins/hoster/UploadedTo.py b/pyload/plugins/hoster/UploadedTo.py index 8285ef474..4ae075cfa 100644 --- a/pyload/plugins/hoster/UploadedTo.py +++ b/pyload/plugins/hoster/UploadedTo.py @@ -11,12 +11,7 @@ from module.utils import html_unescape, parseFileSize, chunks from module.plugins.Hoster import Hoster from module.network.RequestFactory import getURL -<<<<<<< HEAD:pyload/plugins/hoster/UploadedTo.py -from module.plugins.ReCaptcha import ReCaptcha -======= -from module.plugins.Plugin import chunks from module.plugins.internal.CaptchaService import ReCaptcha ->>>>>>> dd30ed8... Using CaptchaService to make them works on 0.5:module/plugins/hoster/UploadedTo.py key = "bGhGMkllZXByd2VEZnU5Y2NXbHhYVlZ5cEE1bkEzRUw=".decode('base64') |