diff options
Diffstat (limited to 'module/plugins/hoster/PornhubCom.py')
-rw-r--r-- | module/plugins/hoster/PornhubCom.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/module/plugins/hoster/PornhubCom.py b/module/plugins/hoster/PornhubCom.py index 45dc12929..1bb787f09 100644 --- a/module/plugins/hoster/PornhubCom.py +++ b/module/plugins/hoster/PornhubCom.py @@ -1,17 +1,21 @@ # -*- coding: utf-8 -*- import re + from module.plugins.Hoster import Hoster class PornhubCom(Hoster): - __name__ = "PornhubCom" - __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?pornhub\.com/view_video\.php\?viewkey=[\w\d]+' - __version__ = "0.5" + __name__ = "PornhubCom" + __type__ = "hoster" + __version__ = "0.50" + + __pattern__ = r'http://(?:www\.)?pornhub\.com/view_video\.php\?viewkey=\w+' + __description__ = """Pornhub.com hoster plugin""" - __author_name__ = "jeix" - __author_mail__ = "jeix@hasnomail.de" + __license__ = "GPLv3" + __authors__ = [("jeix", "jeix@hasnomail.de")] + def process(self, pyfile): self.download_html() @@ -21,10 +25,12 @@ class PornhubCom(Hoster): pyfile.name = self.get_file_name() self.download(self.get_file_url()) + def download_html(self): url = self.pyfile.url self.html = self.load(url) + def get_file_url(self): """ returns the absolute downloadable filepath """ @@ -40,7 +46,7 @@ class PornhubCom(Hoster): post_data += "\x02\x00\x02\x2d\x31\x02\x00\x20" post_data += "add299463d4410c6d1b1c418868225f7" - content = self.req.load(url, post=str(post_data)) + content = self.load(url, post=str(post_data)) new_content = "" for x in content: @@ -53,6 +59,7 @@ class PornhubCom(Hoster): return re.search(r'flv_url.*(http.*?)##post_roll', content).group(1) + def get_file_name(self): if not self.html: self.download_html() @@ -69,6 +76,7 @@ class PornhubCom(Hoster): return name + '.flv' + def file_exists(self): """ returns True or False """ |