summaryrefslogtreecommitdiffstats
path: root/Plugins/YoutubeCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/YoutubeCom.py')
-rw-r--r--Plugins/YoutubeCom.py24
1 files changed, 10 insertions, 14 deletions
diff --git a/Plugins/YoutubeCom.py b/Plugins/YoutubeCom.py
index 2c019aa7c..7224323bb 100644
--- a/Plugins/YoutubeCom.py
+++ b/Plugins/YoutubeCom.py
@@ -13,14 +13,14 @@ class YoutubeCom(Plugin):
self.plugin_pattern = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=(.*)"
self.plugin_type = "hoster"
self.plugin_config = {}
- pluginProp = {}
+ pluginProp = {}
pluginProp ['name'] = "YoutubeCom"
pluginProp ['version'] = "0.1"
pluginProp ['format'] = "*.py"
pluginProp ['description'] = """Youtube Plugin"""
pluginProp ['author'] = "spoob"
pluginProp ['author_email'] = "spoob@pyload.org"
- self.pluginProp = pluginProp
+ self.pluginProp = pluginProp
self.parent = parent
self.html = None
self.html_old = None #time() where loaded the HTML
@@ -45,22 +45,18 @@ class YoutubeCom(Plugin):
"""
if self.html == None:
self.download_html()
- if not self.want_reconnect:
- videoId = re.search(self.plugin_pattern, self.parent.url).group(3)
- videoHash = re.search(r', "t": "([^"]+)"', self.html).group(1)
- file_url = 'http://youtube.com/get_video?video_id=' + videoId + '&t=' + videoHash + '&fmt=18'
- return file_url
- else:
- return False
+
+ videoId = re.search(self.plugin_pattern, self.parent.url).group(3)
+ videoHash = re.search(r', "t": "([^"]+)"', self.html).group(1)
+ file_url = 'http://youtube.com/get_video?video_id=' + videoId + '&t=' + videoHash + '&fmt=18'
+ return file_url
def get_file_name(self):
if self.html == None:
self.download_html()
- if not self.want_reconnect:
- file_name_pattern = r"<title>YouTube - (.*)</title>"
- return re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.mp4'
- else:
- return self.parent.url
+
+ file_name_pattern = r"<title>YouTube - (.*)</title>"
+ return re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.mp4'
def file_exists(self):
""" returns True or False