diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 10:46:28 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 10:46:28 +0100 |
commit | ce1c2b6b05c08b669357947e61ae40efce7fc50f (patch) | |
tree | 0b5f7996960cf35c4eface53a89eba18a37519b7 /pyload/plugin/hoster/VeehdCom.py | |
parent | Fix filename case (diff) | |
download | pyload-ce1c2b6b05c08b669357947e61ae40efce7fc50f.tar.xz |
module temp
Diffstat (limited to 'pyload/plugin/hoster/VeehdCom.py')
-rw-r--r-- | pyload/plugin/hoster/VeehdCom.py | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/pyload/plugin/hoster/VeehdCom.py b/pyload/plugin/hoster/VeehdCom.py deleted file mode 100644 index 91d7cc443..000000000 --- a/pyload/plugin/hoster/VeehdCom.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from pyload.plugin.Hoster import Hoster - - -class VeehdCom(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", "_")] - - __description__ = """Veehd.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("cat", "cat@pyload")] - - - def setup(self): - self.multiDL = True - self.req.canContinue = True - - - def process(self, pyfile): - self.download_html() - if not self.file_exists(): - self.offline() - - pyfile.name = self.get_file_name() - self.download(self.get_file_url()) - - - def download_html(self): - url = self.pyfile.url - self.logDebug("Requesting page: %s" % url) - self.html = self.load(url) - - - def file_exists(self): - if not self.html: - self.download_html() - - if '<title>Veehd</title>' in self.html: - 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.error(_("Video title not found")) - - name = m.group(1) - - # replace unwanted characters in filename - if self.getConfig('filename_spaces'): - pattern = '[^\w ]+' - else: - pattern = '[^\w.]+' - - return re.sub(pattern, self.getConfig('replacement_char'), name) + '.avi' - - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if not self.html: - self.download_html() - - m = re.search(r'<embed type="video/divx" src="(http://([^/]*\.)?veehd\.com/dl/[^"]+)"', - self.html) - if m is None: - self.error(_("Embedded video url not found")) - - return m.group(1) |