summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/VeehdCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-07 23:40:50 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 10:58:42 +0200
commit887ad58e4c6c20b992311bbdf931bcd18e73d384 (patch)
treef31beb241bacca0bfea4c1acc4e9ace813755cef /module/plugins/hoster/VeehdCom.py
parent[AccountManager] Fixed #733 (diff)
parent[File4safe] distributing LINK_PATTERN (diff)
downloadpyload-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/VeehdCom.py')
-rw-r--r--module/plugins/hoster/VeehdCom.py34
1 files changed, 18 insertions, 16 deletions
diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py
index 22fc4b207..66c258439 100644
--- a/module/plugins/hoster/VeehdCom.py
+++ b/module/plugins/hoster/VeehdCom.py
@@ -1,20 +1,24 @@
# -*- coding: utf-8 -*-
import re
+
from module.plugins.Hoster import Hoster
class VeehdCom(Hoster):
- __name__ = 'VeehdCom'
- __type__ = 'hoster'
+ __name__ = "VeehdCom"
+ __type__ = "hoster"
+ __version__ = "0.23"
+
__pattern__ = r'http://veehd\.com/video/\d+_\S+'
__config__ = [("filename_spaces", "bool", "Allow spaces in filename", False),
("replacement_char", "str", "Filename replacement character", "_")]
- __version__ = '0.23'
+
__description__ = """Veehd.com hoster plugin"""
__author_name__ = "cat"
__author_mail__ = "cat@pyload"
+
def _debug(self, msg):
self.logDebug('[%s] %s' % (self.__name__, msg))
@@ -36,7 +40,7 @@ class VeehdCom(Hoster):
self.html = self.load(url)
def file_exists(self):
- if self.html is None:
+ if not self.html:
self.download_html()
if '<title>Veehd</title>' in self.html:
@@ -44,13 +48,14 @@ class VeehdCom(Hoster):
return True
def get_file_name(self):
- if self.html is None:
+ if not self.html:
self.download_html()
- match = re.search(r'<title[^>]*>([^<]+) on Veehd</title>', self.html)
- if not match:
+ m = re.search(r'<title[^>]*>([^<]+) on Veehd</title>', self.html)
+ if m is None:
self.fail("video title not found")
- name = match.group(1)
+
+ name = m.group(1)
# replace unwanted characters in filename
if self.getConfig('filename_spaces'):
@@ -58,20 +63,17 @@ class VeehdCom(Hoster):
else:
pattern = '[^0-9A-Za-z\.]+'
- name = re.sub(pattern, self.getConfig('replacement_char'),
- name)
- return name + '.avi'
+ return re.sub(pattern, self.getConfig('replacement_char'), name) + '.avi'
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
- if self.html is None:
+ if not self.html:
self.download_html()
- match = re.search(r'<embed type="video/divx" src="(http://([^/]*\.)?veehd\.com/dl/[^"]+)"',
+ m = re.search(r'<embed type="video/divx" src="(http://([^/]*\.)?veehd\.com/dl/[^"]+)"',
self.html)
- if not match:
+ if m is None:
self.fail("embedded video url not found")
- file_url = match.group(1)
- return file_url
+ return m.group(1)