diff options
Diffstat (limited to 'Plugins/YoutubeChannel.py')
-rw-r--r-- | Plugins/YoutubeChannel.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Plugins/YoutubeChannel.py b/Plugins/YoutubeChannel.py new file mode 100644 index 000000000..1a0af757e --- /dev/null +++ b/Plugins/YoutubeChannel.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +import re + +from Plugin import Plugin + +class YoutubeChannel(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "YouTubeChannel" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/user/*" + props['version'] = "0.1" + props['description'] = """Youtube.com Channel Download Plugin""" + props['author_name'] = ("RaNaN") + props['author_mail'] = ("RaNaN@pyload.org") + self.props = props + self.parent = parent + self.html = None + + def download_html(self): + self.html = "Not needed" + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + self.user = re.search(r"/user/(.+)", self.parent.url).group(1) + url = "http://gdata.youtube.com/feeds/api/users/" + self.user + "/uploads?max-results=50" + + return url + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + rep = self.req.load(url) + self.links = re.findall(r"href\='(http:\/\/www.youtube.com\/watch\?v\=[^']+)", rep)
\ No newline at end of file |