summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-11-16 18:22:29 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-11-16 18:22:29 +0100
commit900964358d3c5328292e8af73730c3bc25e75406 (patch)
treef6e215a0b284412fdf10260b613feb9c2cfebba5
parentadded lastEffectiveURL (diff)
downloadpyload-900964358d3c5328292e8af73730c3bc25e75406.tar.xz
relink.us fix
-rw-r--r--module/plugins/RelinkUs.py50
1 files changed, 36 insertions, 14 deletions
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='(.*)'></iframe>", 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=['\"]([^'\"]*)['\"](.*)></iframe>", 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=['\"]([^'\"]*)['\"](.*)></iframe>", 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