summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/hoster/VeehdCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/hoster/VeehdCom.py')
-rw-r--r--pyload/plugins/hoster/VeehdCom.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/pyload/plugins/hoster/VeehdCom.py b/pyload/plugins/hoster/VeehdCom.py
index 396588dfd..440993a67 100644
--- a/pyload/plugins/hoster/VeehdCom.py
+++ b/pyload/plugins/hoster/VeehdCom.py
@@ -6,8 +6,8 @@ from pyload.plugins.base.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+'
@@ -15,16 +15,15 @@ class VeehdCom(Hoster):
("replacement_char", "str", "Filename replacement character", "_")]
__description__ = """Veehd.com hoster plugin"""
- __authors__ = [("cat", "cat@pyload")]
+ __license__ = "GPLv3"
+ __authors__ = [("cat", "cat@pyload")]
- def _debug(self, msg):
- self.logDebug("[%s] %s" % (self.__name__, msg))
-
def setup(self):
self.multiDL = True
self.req.canContinue = True
+
def process(self, pyfile):
self.download_html()
if not self.file_exists():
@@ -33,11 +32,13 @@ class VeehdCom(Hoster):
pyfile.name = self.get_file_name()
self.download(self.get_file_url())
+
def download_html(self):
url = self.pyfile.url
- self._debug("Requesting page: %s" % (repr(url),))
+ self.logDebug("Requesting page: %s" % url)
self.html = self.load(url)
+
def file_exists(self):
if not self.html:
self.download_html()
@@ -46,24 +47,26 @@ class VeehdCom(Hoster):
return False
return True
+
def get_file_name(self):
if not self.html:
self.download_html()
m = re.search(r'<title[^>]*>([^<]+) on Veehd</title>', self.html)
if m is None:
- self.fail("video title not found")
+ self.error(_("Video title not found"))
name = m.group(1)
# replace unwanted characters in filename
if self.getConfig('filename_spaces'):
- pattern = '[^0-9A-Za-z\.\ ]+'
+ pattern = '[^\w ]+'
else:
- pattern = '[^0-9A-Za-z\.]+'
+ pattern = '[^\w.]+'
return re.sub(pattern, self.getConfig('replacement_char'), name) + '.avi'
+
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
@@ -73,6 +76,6 @@ class VeehdCom(Hoster):
m = re.search(r'<embed type="video/divx" src="(http://([^/]*\.)?veehd\.com/dl/[^"]+)"',
self.html)
if m is None:
- self.fail("embedded video url not found")
+ self.error(_("Embedded video url not found"))
return m.group(1)