diff options
author | mkaay <mkaay@mkaay.de> | 2010-02-08 13:04:21 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-02-08 13:04:21 +0100 |
commit | 9ab155e95db32e03ca6438df12d38500f9d437f9 (patch) | |
tree | cf3ba616032324fc5be9ce572b8f239fec39ac31 /module/plugins/hoster/YoutubeCom.py | |
parent | FlashGot + ClickNLoad Support + Webif. improvm.!! pyLoad FTW !! (diff) | |
download | pyload-9ab155e95db32e03ca6438df12d38500f9d437f9.tar.xz |
fixed click'n'load, added youtube hd option
Diffstat (limited to 'module/plugins/hoster/YoutubeCom.py')
-rw-r--r-- | module/plugins/hoster/YoutubeCom.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 38a4934df..19fc1099d 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -34,10 +34,23 @@ class YoutubeCom(Plugin): videoId = self.parent.url.split("v=")[1].split("&")[0] videoHash = re.search(r', "t": "([^"]+)"', self.html).group(1) quality = "" - if self.config['high_quality']: + if self.config['quality'] == "sd": + quality = "&fmt=6" + elif self.config['quality'] == "hq": quality = "&fmt=18" + elif self.config['quality'] == "hd": + quality = "&fmt=22" file_url = 'http://youtube.com/get_video?video_id=' + videoId + '&t=' + videoHash + quality return file_url + + def verify_config(self): + q = self.get_config("quality") + if not (q == "hq" or q == "hd" or q == "sd"): + self.config["quality"] = "hd" + hq = self.get_config("high_quality") + if hq: + self.remove_config("high_quality") + self.set_config() def get_file_name(self): if self.html == None: @@ -45,7 +58,7 @@ class YoutubeCom(Plugin): file_name_pattern = r"'VIDEO_TITLE': '(.*)'," file_suffix = ".flv" - if self.config['high_quality']: + if self.config['quality'] == "hd" or self.config['quality'] == "hq": file_suffix = ".mp4" name = re.search(file_name_pattern, self.html).group(1).replace("/", "") + file_suffix |