summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/XHamsterCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-15 16:25:41 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-15 16:25:41 +0200
commit5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 (patch)
treeb3f80dbd9e759747f9c2acb60f614c5daa7af69e /module/plugins/hoster/XHamsterCom.py
parentFix class definition (diff)
downloadpyload-5060e4c6374a5116d0d8b02528f910f8c5f8bcf9.tar.xz
Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics
Diffstat (limited to 'module/plugins/hoster/XHamsterCom.py')
-rw-r--r--module/plugins/hoster/XHamsterCom.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/module/plugins/hoster/XHamsterCom.py b/module/plugins/hoster/XHamsterCom.py
index 0f0371f21..b5b548620 100644
--- a/module/plugins/hoster/XHamsterCom.py
+++ b/module/plugins/hoster/XHamsterCom.py
@@ -42,13 +42,13 @@ class XHamsterCom(Hoster):
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
- if self.html is None:
+ if not self.html:
self.download_html()
flashvar_pattern = re.compile('flashvars = ({.*?});', re.DOTALL)
json_flashvar = flashvar_pattern.search(self.html)
- if json_flashvar is None:
+ if not json_flashvar:
self.fail("Parse error (flashvars)")
j = clean_json(json_flashvar.group(1))
@@ -66,7 +66,7 @@ class XHamsterCom(Hoster):
if self.desired_fmt == ".mp4":
file_url = re.search(r"<a href=\"" + srv_url + "(.+?)\"", self.html)
- if file_url is None:
+ if not file_url:
self.fail("Parse error (file_url)")
file_url = file_url.group(1)
long_url = srv_url + file_url
@@ -87,21 +87,21 @@ class XHamsterCom(Hoster):
return long_url
def get_file_name(self):
- if self.html is None:
+ 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 file_name is None:
+ if not file_name:
file_name_pattern = r"<h1 >(.*)</h1>"
file_name = re.search(file_name_pattern, self.html)
- if file_name is None:
+ 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 file_name is None:
+ 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 file_name is None:
+ if not file_name:
return "Unknown"
return file_name.group(1)
@@ -109,7 +109,7 @@ class XHamsterCom(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"(.*Video not found.*)", self.html) is not None:
return False