diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-09-07 23:40:50 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-09-14 10:58:42 +0200 |
commit | 887ad58e4c6c20b992311bbdf931bcd18e73d384 (patch) | |
tree | f31beb241bacca0bfea4c1acc4e9ace813755cef /module/plugins/hoster/PornhubCom.py | |
parent | [AccountManager] Fixed #733 (diff) | |
parent | [File4safe] distributing LINK_PATTERN (diff) | |
download | pyload-887ad58e4c6c20b992311bbdf931bcd18e73d384.tar.xz |
Merge branch 'stable' into 0.4.10
Conflicts:
module/plugins/Account.py
module/plugins/AccountManager.py
module/plugins/Hook.py
module/plugins/OCR.py
module/plugins/Plugin.py
module/plugins/PluginManager.py
module/plugins/ReCaptcha.py
module/plugins/accounts/Ftp.py
module/plugins/accounts/Http.py
module/plugins/internal/MultiHoster.py
module/plugins/ocr/GigasizeCom.py
module/plugins/ocr/LinksaveIn.py
module/plugins/ocr/NetloadIn.py
module/plugins/ocr/ShareonlineBiz.py
Diffstat (limited to 'module/plugins/hoster/PornhubCom.py')
-rw-r--r-- | module/plugins/hoster/PornhubCom.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/module/plugins/hoster/PornhubCom.py b/module/plugins/hoster/PornhubCom.py index 29205b381..cecdc4339 100644 --- a/module/plugins/hoster/PornhubCom.py +++ b/module/plugins/hoster/PornhubCom.py @@ -1,18 +1,22 @@ # -*- 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" + + __pattern__ = r'http://(?:www\.)?pornhub\.com/view_video\.php\?viewkey=[\w\d]+' + __description__ = """Pornhub.com hoster plugin""" __author_name__ = "jeix" __author_mail__ = "jeix@hasnomail.de" + def process(self, pyfile): self.download_html() if not self.file_exists(): @@ -28,7 +32,7 @@ class PornhubCom(Hoster): def get_file_url(self): """ returns the absolute downloadable filepath """ - if self.html is None: + if not self.html: self.download_html() url = "http://www.pornhub.com//gateway.php" @@ -51,17 +55,15 @@ class PornhubCom(Hoster): content = new_content - file_url = re.search(r'flv_url.*(http.*?)##post_roll', content).group(1) - - return file_url + return re.search(r'flv_url.*(http.*?)##post_roll', content).group(1) def get_file_name(self): - if self.html is None: + if not self.html: self.download_html() - match = re.search(r'<title[^>]+>([^<]+) - ', self.html) - if match: - name = match.group(1) + m = re.search(r'<title[^>]+>([^<]+) - ', self.html) + if m: + name = m.group(1) else: matches = re.findall('<h1>(.*?)</h1>', self.html) if len(matches) > 1: @@ -74,7 +76,7 @@ class PornhubCom(Hoster): def file_exists(self): """ returns True or False """ - if self.html is None: + if not self.html: self.download_html() if re.search(r'This video is no longer in our database or is in conversion', self.html) is not None: |