summaryrefslogtreecommitdiffstats
path: root/Plugins/YoutubeCom.py
diff options
context:
space:
mode:
authorGravatar spoob <spoob@gmx.de> 2009-09-04 15:13:57 +0200
committerGravatar spoob <spoob@gmx.de> 2009-09-04 15:13:57 +0200
commit6b5d39a18461a45e53fd4048e1ac6a5cbd075b8c (patch)
tree12c44e446f2d82785572b2577a39a96e741c34a9 /Plugins/YoutubeCom.py
parentpyLoad RC (diff)
downloadpyload-6b5d39a18461a45e53fd4048e1ac6a5cbd075b8c.tar.xz
clean root folder
Diffstat (limited to 'Plugins/YoutubeCom.py')
-rw-r--r--Plugins/YoutubeCom.py63
1 files changed, 0 insertions, 63 deletions
diff --git a/Plugins/YoutubeCom.py b/Plugins/YoutubeCom.py
deleted file mode 100644
index 7428f532d..000000000
--- a/Plugins/YoutubeCom.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-from Plugin import Plugin
-
-class YoutubeCom(Plugin):
-
- def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "YoutubeCom"
- props['type'] = "hoster"
- props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=.*"
- 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
- self.html = self.req.load(url)
-
- def get_file_url(self):
- """ returns the absolute downloadable filepath
- """
- if self.html == None:
- self.download_html()
-
- videoId = self.parent.url.split("v=")[1].split("&")[0]
- videoHash = re.search(r', "t": "([^"]+)"', self.html).group(1)
- 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):
- 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"
- name = re.search(file_name_pattern, self.html).group(1).replace("/", "") + file_suffix
-
- name = name.replace("&amp;", "&")
- return name
-
- def file_exists(self):
- """ 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