diff options
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hooks/ClickAndLoad.py | 4 | ||||
-rw-r--r-- | module/plugins/hoster/YoutubeCom.py | 17 |
2 files changed, 17 insertions, 4 deletions
diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 83a328276..f7c12356b 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -36,7 +36,7 @@ class ClickAndLoad(Hook): self.props = props self.port = int(self.core.config['webinterface']['port']) - if not self.core.config['webinterface']['activated']: + if self.core.config['webinterface']['activated']: forwarder('127.0.0.1', 9666, '127.0.0.1', self.port) thread.start_new_thread(asyncore.loop, ()) @@ -109,4 +109,4 @@ class sender(asyncore.dispatcher): def handle_close(self): self.close() - self.receiver.close()
\ No newline at end of file + self.receiver.close() 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 |