summaryrefslogtreecommitdiffstats
path: root/Plugins/YoutubeCom.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-05-26 00:04:33 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-05-26 00:04:33 +0200
commitd44888ca5ab15913db944d1b1646df8f103c4ba6 (patch)
treee1d9d6109cb29ae45db1fe065b8395e5f3f789eb /Plugins/YoutubeCom.py
parentchanged variable names (diff)
downloadpyload-d44888ca5ab15913db944d1b1646df8f103c4ba6.tar.xz
improved plugins
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