diff options
Diffstat (limited to 'pyload/plugins/hoster/YourfilesTo.py')
-rw-r--r-- | pyload/plugins/hoster/YourfilesTo.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/pyload/plugins/hoster/YourfilesTo.py b/pyload/plugins/hoster/YourfilesTo.py index 3bbdf0628..6a3a5c1ec 100644 --- a/pyload/plugins/hoster/YourfilesTo.py +++ b/pyload/plugins/hoster/YourfilesTo.py @@ -8,15 +8,16 @@ from pyload.plugins.base.Hoster import Hoster class YourfilesTo(Hoster): - __name__ = "YourfilesTo" - __type__ = "hoster" + __name__ = "YourfilesTo" + __type__ = "hoster" __version__ = "0.21" - __pattern__ = r'(http://)?(?:www\.)?yourfiles\.(to|biz)/\?d=[a-zA-Z0-9]+' + __pattern__ = r'(http://)?(?:www\.)?yourfiles\.(to|biz)/\?d=\w+' __description__ = """Youfiles.to hoster plugin""" - __authors__ = [("jeix", "jeix@hasnomail.de"), - ("skydancer", "skydancer@hasnomail.de")] + __license__ = "GPLv3" + __authors__ = [("jeix", "jeix@hasnomail.de"), + ("skydancer", "skydancer@hasnomail.de")] def process(self, pyfile): @@ -24,6 +25,7 @@ class YourfilesTo(Hoster): self.prepare() self.download(self.get_file_url()) + def prepare(self): if not self.file_exists(): self.offline() @@ -32,9 +34,10 @@ class YourfilesTo(Hoster): wait_time = self.get_waiting_time() self.setWait(wait_time) - self.logDebug("%s: Waiting %d seconds." % (self.__name__, wait_time)) + self.logDebug("Waiting %d seconds." % wait_time) self.wait() + def get_waiting_time(self): if not self.html: self.download_html() @@ -48,10 +51,12 @@ class YourfilesTo(Hoster): return sec + def download_html(self): url = self.pyfile.url self.html = self.load(url) + def get_file_url(self): """ returns the absolute downloadable filepath """ @@ -61,7 +66,8 @@ class YourfilesTo(Hoster): url = unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", "")) return url else: - self.fail("absolute filepath could not be found. offline? ") + self.error(_("Absolute filepath not found")) + def get_file_name(self): if not self.html: @@ -69,6 +75,7 @@ class YourfilesTo(Hoster): return re.search("<title>(.*)</title>", self.html).group(1) + def file_exists(self): """ returns True or False """ |