From 032bb8d837dc91742746ba39d6e9cb8e1323f22b Mon Sep 17 00:00:00 2001 From: mkaay Date: Mon, 16 Nov 2009 18:22:29 +0100 Subject: relink.us fix --- module/plugins/RelinkUs.py | 50 +++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 14 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/RelinkUs.py b/module/plugins/RelinkUs.py index 4bfa5a18b..840497413 100644 --- a/module/plugins/RelinkUs.py +++ b/module/plugins/RelinkUs.py @@ -2,8 +2,9 @@ # -*- coding: utf-8 -*- import re +import time -from module.Plugin import Plugin +from Plugin import Plugin class RelinkUs(Plugin): @@ -12,14 +13,15 @@ class RelinkUs(Plugin): props = {} props['name'] = "RelinkUs" props['type'] = "container" - props['pattern'] = r"http://(www\.)?relink.us/go.php" - props['version'] = "0.1" + props['pattern'] = r"http://(www\.)?relink.us/(f|((view|go).php))" + props['version'] = "0.2" props['description'] = """Relink.us Container Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") + props['author_name'] = ("Sleeper-") + props['author_mail'] = ("@nonymous") self.props = props self.parent = parent self.html = None + self.multi_dl = False def file_exists(self): """ returns True or False @@ -27,13 +29,33 @@ class RelinkUs(Plugin): return True def proceed(self, url, location): - url = self.parent.url - self.html = self.req.load(url) - container_id = url.split("id=")[-1] + container_id = self.parent.url.split("/")[-1].split("id=")[-1] + url = "http://relink.us/view.php?id="+container_id + self.html = self.req.load(url, cookies=True) temp_links = [] - link_number = len(re.findall(r"test_\d+", self.html)) - for number in range(0, link_number): - new_link = re.search("src='(.*)'>", self.req.load("http://relink.us/f/%s/1/%i" % (container_id, number))).group(1) - temp_links.append(new_link) - print temp_links - self.links = temp_links + + # Download Ad-Frames, otherwise we aren't enabled for download + iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)>", self.html) + for iframe in iframes: + self.req.load("http://relink.us/"+iframe[0], cookies=True) + + link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) + + for link_string in link_strings: + self.req.lastURL = url + + # Set Download File + framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) + + new_link = self.req.lastEffectiveURL + + if re.match(r"http://(www\.)?relink.us/",new_link): + # Find iframe + new_link = re.search("src=['\"]([^'\"]*)['\"](.*)>", framereq).group(1) + # Wait some secs for relink.us server... + time.sleep(5) + + print new_link + temp_links.append(new_link) + + self.links = temp_links -- cgit v1.2.3 From a49bae7ba97ae64f61f38c4e64b671a650203910 Mon Sep 17 00:00:00 2001 From: mkaay Date: Mon, 16 Nov 2009 18:32:37 +0100 Subject: indentation fix --- module/plugins/RelinkUs.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/RelinkUs.py b/module/plugins/RelinkUs.py index 840497413..9ca209be3 100644 --- a/module/plugins/RelinkUs.py +++ b/module/plugins/RelinkUs.py @@ -34,28 +34,28 @@ class RelinkUs(Plugin): self.html = self.req.load(url, cookies=True) temp_links = [] - # Download Ad-Frames, otherwise we aren't enabled for download - iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)>", self.html) - for iframe in iframes: - self.req.load("http://relink.us/"+iframe[0], cookies=True) + # Download Ad-Frames, otherwise we aren't enabled for download + iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)>", self.html) + for iframe in iframes: + self.req.load("http://relink.us/"+iframe[0], cookies=True) - link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) + link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) - for link_string in link_strings: - self.req.lastURL = url + for link_string in link_strings: + self.req.lastURL = url - # Set Download File - framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) + # Set Download File + framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) - new_link = self.req.lastEffectiveURL + new_link = self.req.lastEffectiveURL - if re.match(r"http://(www\.)?relink.us/",new_link): - # Find iframe - new_link = re.search("src=['\"]([^'\"]*)['\"](.*)>", framereq).group(1) - # Wait some secs for relink.us server... - time.sleep(5) + if re.match(r"http://(www\.)?relink.us/",new_link): + # Find iframe + new_link = re.search("src=['\"]([^'\"]*)['\"](.*)>", framereq).group(1) + # Wait some secs for relink.us server... + time.sleep(5) - print new_link - temp_links.append(new_link) + print new_link + temp_links.append(new_link) - self.links = temp_links + self.links = temp_links -- cgit v1.2.3 From 20a3ae56f5eea95a0f9641eabb273e0410fe2309 Mon Sep 17 00:00:00 2001 From: mkaay Date: Mon, 16 Nov 2009 18:38:16 +0100 Subject: indentation fix, 2nd try -.- --- module/plugins/RelinkUs.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/RelinkUs.py b/module/plugins/RelinkUs.py index 9ca209be3..1700beb2b 100644 --- a/module/plugins/RelinkUs.py +++ b/module/plugins/RelinkUs.py @@ -34,28 +34,28 @@ class RelinkUs(Plugin): self.html = self.req.load(url, cookies=True) temp_links = [] - # Download Ad-Frames, otherwise we aren't enabled for download - iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)>", self.html) - for iframe in iframes: - self.req.load("http://relink.us/"+iframe[0], cookies=True) + # Download Ad-Frames, otherwise we aren't enabled for download + iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)>", self.html) + for iframe in iframes: + self.req.load("http://relink.us/"+iframe[0], cookies=True) - link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) + link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) - for link_string in link_strings: - self.req.lastURL = url + for link_string in link_strings: + self.req.lastURL = url - # Set Download File - framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) + # Set Download File + framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) - new_link = self.req.lastEffectiveURL + new_link = self.req.lastEffectiveURL - if re.match(r"http://(www\.)?relink.us/",new_link): - # Find iframe - new_link = re.search("src=['\"]([^'\"]*)['\"](.*)>", framereq).group(1) - # Wait some secs for relink.us server... - time.sleep(5) + if re.match(r"http://(www\.)?relink.us/",new_link): + # Find iframe + new_link = re.search("src=['\"]([^'\"]*)['\"](.*)>", framereq).group(1) + # Wait some secs for relink.us server... + time.sleep(5) - print new_link - temp_links.append(new_link) + print new_link + temp_links.append(new_link) - self.links = temp_links + self.links = temp_links -- cgit v1.2.3 From 80b31ff0d1f1b4eaf4f3ded0347114b0d0390dc3 Mon Sep 17 00:00:00 2001 From: mkaay Date: Mon, 16 Nov 2009 18:40:28 +0100 Subject: indentation fix, 3nd try.. --- module/plugins/RelinkUs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/RelinkUs.py b/module/plugins/RelinkUs.py index 1700beb2b..786733558 100644 --- a/module/plugins/RelinkUs.py +++ b/module/plugins/RelinkUs.py @@ -50,10 +50,10 @@ class RelinkUs(Plugin): new_link = self.req.lastEffectiveURL if re.match(r"http://(www\.)?relink.us/",new_link): - # Find iframe - new_link = re.search("src=['\"]([^'\"]*)['\"](.*)>", framereq).group(1) - # Wait some secs for relink.us server... - time.sleep(5) + # Find iframe + new_link = re.search("src=['\"]([^'\"]*)['\"](.*)>", framereq).group(1) + # Wait some secs for relink.us server... + time.sleep(5) print new_link temp_links.append(new_link) -- cgit v1.2.3 From ed688632fb44f6c71e8053722895502cc4315494 Mon Sep 17 00:00:00 2001 From: spoob Date: Mon, 16 Nov 2009 18:56:44 +0100 Subject: Fixed DLC Plugin for new Plugin System --- module/plugins/DLC.pyc | Bin 3692 -> 2228 bytes module/plugins/UploadedTo.py | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/DLC.pyc b/module/plugins/DLC.pyc index 5d4809178..3adddec00 100644 Binary files a/module/plugins/DLC.pyc and b/module/plugins/DLC.pyc differ diff --git a/module/plugins/UploadedTo.py b/module/plugins/UploadedTo.py index bcb0a7008..4bddbd6f1 100644 --- a/module/plugins/UploadedTo.py +++ b/module/plugins/UploadedTo.py @@ -69,8 +69,7 @@ class UploadedTo(Plugin): tries += 1 if tries > 5: - raise Exception, "Error while preparing DL, HTML dump: %s" % self.html - + raise Exception, "Error while preparing DL" return True def download_api_data(self): -- cgit v1.2.3 From f22b9cebe1f800127658f94b9e4c9b9b2481c59e Mon Sep 17 00:00:00 2001 From: spoob Date: Mon, 16 Nov 2009 20:28:33 +0100 Subject: Fixed DLC Plugin --- module/plugins/DLC.pyc | Bin 2228 -> 2231 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/DLC.pyc b/module/plugins/DLC.pyc index 3adddec00..980dd8ace 100644 Binary files a/module/plugins/DLC.pyc and b/module/plugins/DLC.pyc differ -- cgit v1.2.3 From d862585e35c87498023882f02fc9e4b014becf2a Mon Sep 17 00:00:00 2001 From: sitacuisses Date: Wed, 18 Nov 2009 00:47:28 +0100 Subject: user: sitacuisses branch 'default' added module/plugins/FilesmonsterCom.py --- module/plugins/FilesmonsterCom.py | 94 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 module/plugins/FilesmonsterCom.py (limited to 'module/plugins') diff --git a/module/plugins/FilesmonsterCom.py b/module/plugins/FilesmonsterCom.py new file mode 100644 index 000000000..27c687363 --- /dev/null +++ b/module/plugins/FilesmonsterCom.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Plugin for www.filesmonster.com +# this plugin isn't fully implemented yet,but it does download +# todo: +# detect, if reconnect is necessary +# download-error handling +# postpone download, if speed is below a set limit +# implement premium-access +# optional replace blanks in filename with underscores + +import re +import urllib +import time +from Plugin import Plugin + +class FilesmonsterCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "FilesmonsterCom" + props['type'] = "hoster" + props['pattern'] = r"http://(www.)??filesmonster.com/download.php" + props['version'] = "0.1" + props['description'] = """Filesmonster.com Download Plugin""" + props['author_name'] = ("sitacuisses","spoob") + props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + self.htmlwithlink = None + self.url = None + self.filerequest = None + + def download_html(self): + self.url = self.parent.url + self.html = self.req.load(self.url) # get the start page + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + self.get_download_page() # the complex work is done here + file_url = self.htmlwithlink + return file_url + else: + return False + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search(r"File\sname:\s(.*?)", self.html).group(1) + return file_name + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: + return False + else: + return True + + def get_download_page(self): + herewego = re.findall(r"\s*\n\s*", self.html) + the_download_page = self.req.load("http://filesmonster.com/get/free/", None, herewego) + temporary_filtered = re.search(r"\s*\n(\s*\s*\n)*?\s*", the_download_page).group(0) + all_the_tuples = re.findall(r" Date: Sun, 29 Nov 2009 20:59:53 +0100 Subject: First Version, works but doesn't reconnect branch 'default' added module/plugins/FreakshareNet.py --- module/plugins/FreakshareNet.py | 144 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 module/plugins/FreakshareNet.py (limited to 'module/plugins') diff --git a/module/plugins/FreakshareNet.py b/module/plugins/FreakshareNet.py new file mode 100644 index 000000000..0768b5476 --- /dev/null +++ b/module/plugins/FreakshareNet.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import urllib +import httplib +from module.Plugin import Plugin +from time import time + + +class FreakshareNet(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "FreakshareNet" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www\.)?freakshare\.net/files/\S*?/" + props['version'] = "0.1" + props['description'] = """Freakshare.com Download Plugin""" + props['author_name'] = ("sitacuisses","spoob","mkaay") + props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + self.req_opts = list() + + def prepare(self, thread): + pyfile = self.parent + + self.want_reconnect = False + + self.download_html() + + pyfile.status.exists = self.file_exists() + + if not pyfile.status.exists: + raise Exception, "The file was not found on the server." + return False + + self.get_waiting_time() + + pyfile.status.filename = self.get_file_name() + + pyfile.status.waituntil = self.time_plus_wait + thread.wait(self.parent) + pyfile.status.url = self.get_file_url() + pyfile.status.want_reconnect = self.want_reconnect + + return True + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url, cookies=True) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + self.req_opts = self.get_download_options() # get the Post options for the Request + file_url = self.parent.url + return file_url + else: + return False + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search(r"(.*?)<\/h1>", self.html).group(1) + return file_name + else: + return self.parent.url + + def get_waiting_time(self): + if self.html == None: + self.download_html() + timestring = re.search('\s*var\stime\s=\s(\d*?)\.\d*;', self.html).group(1) + if timestring: + sec = int(timestring) + 1 #add 1 sec as tenths of seconds are cut off + else: + sec = 0 + self.time_plus_wait = time() + sec + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"Sorry, this Download doesnt exist anymore", self.html) != None: + return False + else: + return True + + def get_download_options(self): + re_envelope = re.search(r".*?value=\"Free\sDownload\".*?\n*?(.*?<.*?>\n*)*?\n*\s*?", self.html).group(0) #get the whole request + to_sort = re.findall(r"", re_envelope) + request_options = list() + for item in to_sort: #Name value pairs are output reversed from regex, so we reorder them + request_options.append((item[1], item[0])) + herewego = self.req.load(self.parent.url, None, request_options, cookies=True) # the actual download-Page + to_sort = None + to_sort = re.findall(r"", herewego) + request_options = list() + for item in to_sort: #Same as above + request_options.append((item[1], item[0])) + return request_options + + def proceed(self, url, location): + """ + request.download doesn't handle the 302 redirect correctly + that's why the data are posted "manually" via httplib + and the redirect-url is read from the header. + Important: The cookies may not be posted to the download-url + otherwise the downloaded file only contains "bad try" + Need to come up with a better idea to handle the redirect, + help is appreciated. + """ + temp_options = urllib.urlencode(self.req_opts) + temp_url = re.match(r"http://(.*?)/.*", url).group(1) # get the server name + temp_extended = re.match(r"http://.*?(/.*)", url).group(1) # get the url relative to serverroot + cookie_list = "" + for temp_cookie in self.req.cookies: #prepare cookies + cookie_list += temp_cookie.name + "=" + temp_cookie.value +";" + temp_headers = [ #create the additional header fields + ["Content-type", "application/x-www-form-urlencoded"], #this is very important + ["User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.10"], + ["Accept-Encoding", "deflate"], + ["Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"], + ["Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"], + ["Connection", "keep-alive"], + ["Keep-Alive", "300"], + ["Referer", self.req.lastURL], + ["Cookie", cookie_list]] + temp_conn = httplib.HTTPConnection(temp_url) + temp_conn.request("POST", temp_extended, temp_options, dict(temp_headers)) + temp_response = temp_conn.getresponse() + new_url = temp_response.getheader("Location") # we need the Location-header + temp_conn.close + self.req.download(new_url, location, None, None, cookies=False) -- cgit v1.2.3 From dc97a68f74dc0966b1df9e8f8231d76ecd9f2673 Mon Sep 17 00:00:00 2001 From: mkaay Date: Tue, 2 Feb 2010 22:15:48 +0100 Subject: some gui fixes, i18n update --- module/plugins/decrypter/SerienjunkiesOrg.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins') diff --git a/module/plugins/decrypter/SerienjunkiesOrg.py b/module/plugins/decrypter/SerienjunkiesOrg.py index af7dc8169..d8396bd0b 100644 --- a/module/plugins/decrypter/SerienjunkiesOrg.py +++ b/module/plugins/decrypter/SerienjunkiesOrg.py @@ -5,6 +5,7 @@ import re from module.Plugin import Plugin from module.BeautifulSoup import BeautifulSoup from module.unescape import unescape +from module.download_thread import CaptchaError class SerienjunkiesOrg(Plugin): def __init__(self, parent): -- cgit v1.2.3 From 58ff65301f3edeb1fcffae36b2fd6df3aa46258b Mon Sep 17 00:00:00 2001 From: mkaay Date: Tue, 2 Feb 2010 22:17:09 +0100 Subject: closes #70, thx kepheus --- module/plugins/container/CCF.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py index 88b567904..12728d022 100644 --- a/module/plugins/container/CCF.py +++ b/module/plugins/container/CCF.py @@ -2,7 +2,6 @@ # -*- coding: utf-8 -*- import os.path -import random import re import tempfile import urllib2 @@ -36,20 +35,11 @@ class CCF(Plugin): "upload": open(infile, "rb")} tempdlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php', params).read() - random.seed() - tempdir = tempfile.gettempdir() - if tempdir[0] == '/': - delim = '/' - else: - delim = '\\' - tempdlc_name = tempdir + delim + str(random.randint(0, 100)) + '-tmp.dlc' - while os.path.exists(tempdlc_name): - tempdlc_name = tempfile.gettempdir() + '/' + str(random.randint(0, 100)) + '-tmp.dlc' - - tempdlc = open(tempdlc_name, "w") + tempdlc = tempfile.NamedTemporaryFile(delete=False, suffix='.dlc') tempdlc.write(re.search(r'(.*)', tempdlc_content, re.DOTALL).group(1)) - tempdlc.close + tempdlc.close() - self.links.append(tempdlc_name) + self.links.append(tempdlc.name) return True + -- cgit v1.2.3