summaryrefslogtreecommitdiffstats
path: root/Plugins/YoutubeCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/YoutubeCom.py')
-rw-r--r--Plugins/YoutubeCom.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Plugins/YoutubeCom.py b/Plugins/YoutubeCom.py
index 2d8567a28..2a8315ad5 100644
--- a/Plugins/YoutubeCom.py
+++ b/Plugins/YoutubeCom.py
@@ -4,7 +4,7 @@ import re
from Plugin import Plugin
class YoutubeCom(Plugin):
-
+
def __init__(self, parent):
Plugin.__init__(self, parent)
props = {}
@@ -19,11 +19,11 @@ class YoutubeCom(Plugin):
self.parent = parent
self.html = None
self.read_config()
-
+
def download_html(self):
url = self.parent.url
self.html = self.req.load(url)
-
+
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
@@ -37,23 +37,23 @@ class YoutubeCom(Plugin):
quality = "&fmt=18"
file_url = 'http://youtube.com/get_video?video_id=' + videoId + '&t=' + videoHash + quality
return file_url
-
+
def get_file_name(self):
if self.html == None:
self.download_html()
-
+
file_name_pattern = r"<title>YouTube - (.*)</title>"
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
+ """ returns True or False
"""
if self.html == None:
self.download_html()
if re.search(r"(.*eine fehlerhafte Video-ID\.)", self.html) != None:
return False
else:
- return True
+ return True \ No newline at end of file