diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-07-20 03:25:14 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-07-20 03:25:14 +0200 |
commit | 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 (patch) | |
tree | 20d379639d14a2b69deaa9e0376e33312b5bb994 /module/plugins/hoster/XHamsterCom.py | |
parent | [ShareRapidCom] Fix https://github.com/pyload/pyload/issues/694 (diff) | |
download | pyload-05d258d98dd8c2faf0b769840fa1e3c4acccdce8.tar.xz |
Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9
Diffstat (limited to 'module/plugins/hoster/XHamsterCom.py')
-rw-r--r-- | module/plugins/hoster/XHamsterCom.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/module/plugins/hoster/XHamsterCom.py b/module/plugins/hoster/XHamsterCom.py index d11520cd5..9c93d4ee1 100644 --- a/module/plugins/hoster/XHamsterCom.py +++ b/module/plugins/hoster/XHamsterCom.py @@ -66,7 +66,7 @@ class XHamsterCom(Hoster): if self.desired_fmt == ".mp4": file_url = re.search(r"<a href=\"" + srv_url + "(.+?)\"", self.html) - if not file_url: + if file_url is None: self.fail("Parse error (file_url)") file_url = file_url.group(1) long_url = srv_url + file_url @@ -90,21 +90,21 @@ class XHamsterCom(Hoster): if not self.html: self.download_html() - file_name_pattern = r"<title>(.*?) - xHamster\.com</title>" - file_name = re.search(file_name_pattern, self.html) - if not file_name: - file_name_pattern = r"<h1 >(.*)</h1>" - file_name = re.search(file_name_pattern, self.html) - if not file_name: - file_name_pattern = r"http://[www.]+xhamster\.com/movies/.*/(.*?)\.html?" - file_name = re.match(file_name_pattern, self.pyfile.url) - if not file_name: - file_name_pattern = r"<div id=\"element_str_id\" style=\"display:none;\">(.*)</div>" - file_name = re.search(file_name_pattern, self.html) - if not file_name: + pattern = r"<title>(.*?) - xHamster\.com</title>" + name = re.search(pattern, self.html) + if name is None: + pattern = r"<h1 >(.*)</h1>" + name = re.search(pattern, self.html) + if name is None: + pattern = r"http://[www.]+xhamster\.com/movies/.*/(.*?)\.html?" + name = re.match(file_name_pattern, self.pyfile.url) + if name is None: + pattern = r"<div id=\"element_str_id\" style=\"display:none;\">(.*)</div>" + name = re.search(pattern, self.html) + if name is None: return "Unknown" - return file_name.group(1) + return name.group(1) def file_exists(self): """ returns True or False |