diff options
author | spoob <spoob@gmx.de> | 2009-06-07 05:24:49 +0200 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2009-06-07 05:24:49 +0200 |
commit | d10502f06d8178dceec8738386b153d9936d33fe (patch) | |
tree | 0942809317f9a036ef63cd0c13e87d11d273e4ed /Plugins/YoutubeCom.py | |
parent | bluehost working, but slow (diff) | |
download | pyload-d10502f06d8178dceec8738386b153d9936d33fe.tar.xz |
added youtube max video and high quality config
Diffstat (limited to 'Plugins/YoutubeCom.py')
-rw-r--r-- | Plugins/YoutubeCom.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Plugins/YoutubeCom.py b/Plugins/YoutubeCom.py index 0d738d52d..2d8567a28 100644 --- a/Plugins/YoutubeCom.py +++ b/Plugins/YoutubeCom.py @@ -11,13 +11,14 @@ class YoutubeCom(Plugin): props['name'] = "YoutubeCom" props['type'] = "hoster" props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=.*" - props['version'] = "0.1" + props['version'] = "0.2" props['description'] = """Youtube.com Video Download Plugin""" props['author_name'] = ("spoob") props['author_mail'] = ("spoob@pyload.org") self.props = props self.parent = parent self.html = None + self.read_config() def download_html(self): url = self.parent.url @@ -31,7 +32,10 @@ class YoutubeCom(Plugin): videoId = self.parent.url.split("v=")[1].split("&")[0] videoHash = re.search(r', "t": "([^"]+)"', self.html).group(1) - file_url = 'http://youtube.com/get_video?video_id=' + videoId + '&t=' + videoHash + '&fmt=18' + quality = "" + if self.config['high_quality']: + quality = "&fmt=18" + file_url = 'http://youtube.com/get_video?video_id=' + videoId + '&t=' + videoHash + quality return file_url def get_file_name(self): @@ -39,7 +43,10 @@ class YoutubeCom(Plugin): self.download_html() file_name_pattern = r"<title>YouTube - (.*)</title>" - return re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.mp4' + file_suffix = ".flv" + if self.config['high_quality']: + file_suffix = ".mp4" + return re.search(file_name_pattern, self.html).group(1).replace("/", "") + file_suffix def file_exists(self): """ returns True or False |