diff options
author | Jeix <devnull@localhost> | 2010-09-24 18:33:33 +0200 |
---|---|---|
committer | Jeix <devnull@localhost> | 2010-09-24 18:33:33 +0200 |
commit | c4225b283b38fded39bf61d0996d0d8578eeeddb (patch) | |
tree | 138eca82c8da53841c7da6f7a3fa936331d5e30b /module/plugins | |
parent | freakshare waiting fix (diff) | |
download | pyload-c4225b283b38fded39bf61d0996d0d8578eeeddb.tar.xz |
youporn fix and YourfilesTo support
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hoster/YoupornCom.py | 30 | ||||
-rw-r--r-- | module/plugins/hoster/YourfilesTo.py | 80 |
2 files changed, 93 insertions, 17 deletions
diff --git a/module/plugins/hoster/YoupornCom.py b/module/plugins/hoster/YoupornCom.py index fb9ef5a02..b90da4f83 100644 --- a/module/plugins/hoster/YoupornCom.py +++ b/module/plugins/hoster/YoupornCom.py @@ -8,29 +8,25 @@ class YoupornCom(Hoster): __name__ = "YoupornCom" __type__ = "hoster" __pattern__ = r"http://(www\.)?youporn\.com/watch/.+" - __version__ = "0.1" + __version__ = "0.2" __description__ = """Youporn.com Video Download Hoster""" __author_name__ = ("willnix") __author_mail__ = ("willnix@pyload.org") - def __init__(self, parent): - Hoster.__init__(self, parent) - self.parent = parent + def setup(self): self.html = None - self.html_old = None #time() where loaded the HTML - self.time_plus_wait = None #time() + wait in seconds - - def set_parent_status(self): - """ sets all available Statusinfos about a File in self.parent.status - """ - if self.html is None: - self.download_html() - self.parent.status.filename = self.get_file_name() - self.parent.status.url = self.get_file_url() - self.parent.status.wait = self.wait_until() + + def process(self, pyfile): + self.pyfile = pyfile + + if not self.file_exists(): + self.offline() + + self.pyfile.name = self.get_file_name() + self.download(self.get_file_url()) def download_html(self): - url = self.parent.url + url = self.pyfile.url self.html = self.load(url, post={"user_choice":"Enter"}, cookies=False) def get_file_url(self): @@ -39,7 +35,7 @@ class YoupornCom(Hoster): if self.html is None: self.download_html() - file_url = re.search(r'(http://download.youporn.com/download/\d*/.*\?download=1&ll=1&t=dd)">', self.html).group(1) + file_url = re.search(r'(http://download.youporn.com/download/\d*/(?:flv/)?.*\?save=1)">', self.html).group(1) return file_url def get_file_name(self): diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py new file mode 100644 index 000000000..84e61e272 --- /dev/null +++ b/module/plugins/hoster/YourfilesTo.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+import urllib
+from module.plugins.Hoster import Hoster
+from time import time
+
+class YourfilesTo(Hoster):
+ __name__ = "YourfilesTo"
+ __type__ = "hoster"
+ __pattern__ = r"(http://)?(www\.)?yourfiles\.to/\?d=[a-zA-Z0-9]+"
+ __version__ = "0.2"
+ __description__ = """Youfiles.to Download Hoster"""
+ __author_name__ = ("jeix", "skydancer")
+ __author_mail__ = ("jeix@hasnomail.de", "skydancer@hasnomail.de")
+
+ def setup(self):
+ self.html = None
+ self.multiDL = False
+
+ def process(self,pyfile):
+ self.pyfile = pyfile
+ self.prepare()
+ self.download(self.get_file_url())
+
+ def prepare(self):
+ if not self.file_exists():
+ self.offline()
+
+ self.pyfile.name = self.get_file_name()
+
+ wait_time = self.get_waiting_time()
+ self.setWait(wait_time)
+ self.log.debug("%s: Waiting %d seconds." % (self.__name__,wait_time))
+ self.wait()
+
+ def get_waiting_time(self):
+ if self.html == None:
+ self.download_html()
+
+ #var zzipitime = 15;
+ m = re.search(r'var zzipitime = (\d+);', self.html)
+ if m:
+ sec = int(m.group(1))
+ else:
+ sec = 0
+
+ return sec
+
+ def download_html(self):
+ url = self.pyfile.url
+ self.html = self.load(url, cookies=True)
+
+ def get_file_url(self):
+ """ returns the absolute downloadable filepath
+ """
+ url = re.search(r"var bla = '(.*?)';", self.html).group(1)
+ url = urllib.unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", ""))
+ return url;
+
+ def get_file_name(self):
+ if self.html == None:
+ self.download_html()
+
+ return re.search("<title>(.*)</title>", self.html).group(1)
+
+ def file_exists(self):
+ """ returns True or False
+ """
+ if self.html == None:
+ self.download_html()
+
+ if re.search(r"HTTP Status 404", self.html) != None:
+ return False
+ else:
+ return True
+
+
+
|