From acc46fc3497a66a427b795b4a22c6e71d69185a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 13 Dec 2014 15:56:57 +0100 Subject: Update --- pyload/plugin/hoster/MyvideoDe.py | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 pyload/plugin/hoster/MyvideoDe.py (limited to 'pyload/plugin/hoster/MyvideoDe.py') diff --git a/pyload/plugin/hoster/MyvideoDe.py b/pyload/plugin/hoster/MyvideoDe.py new file mode 100644 index 000000000..08652cdc9 --- /dev/null +++ b/pyload/plugin/hoster/MyvideoDe.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- + +import re + +from pyload.plugin.Hoster import Hoster +from pyload.utils import html_unescape + + +class MyvideoDe(Hoster): + __name = "MyvideoDe" + __type = "hoster" + __version = "0.90" + + __pattern = r'http://(?:www\.)?myvideo\.de/watch/' + + __description = """Myvideo.de hoster plugin""" + __license = "GPLv3" + __authors = [("spoob", "spoob@pyload.org")] + + + def process(self, pyfile): + self.pyfile = pyfile + self.download_html() + pyfile.name = self.get_file_name() + self.download(self.get_file_url()) + + + def download_html(self): + self.html = self.load(self.pyfile.url) + + + def get_file_url(self): + videoId = re.search(r"addVariable\('_videoid','(.*)'\);p.addParam\('quality'", self.html).group(1) + videoServer = re.search("rel='image_src' href='(.*)thumbs/.*' />", self.html).group(1) + file_url = videoServer + videoId + ".flv" + return file_url + + + def get_file_name(self): + file_name_pattern = r"

(.*)

" + return html_unescape(re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.flv') + + + def file_exists(self): + self.download_html() + self.load(str(self.pyfile.url), cookies=False, just_header=True) + if self.req.lastEffectiveURL == "http://www.myvideo.de/": + return False + return True -- cgit v1.2.3