summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar spoob <spoob@gmx.de> 2009-06-07 14:47:13 +0200
committerGravatar spoob <spoob@gmx.de> 2009-06-07 14:47:13 +0200
commit10e72bdba4f856e5cccd3feaafa910948e1411b3 (patch)
tree2b90bb5d8942f157b9a7302a0d0441d707f61dba
parentadded youtube max video and high quality config (diff)
downloadpyload-10e72bdba4f856e5cccd3feaafa910948e1411b3.tar.xz
fixed #7
-rw-r--r--Plugins/YoutubeChannel.py30
-rw-r--r--pluginconfig2
2 files changed, 19 insertions, 13 deletions
diff --git a/Plugins/YoutubeChannel.py b/Plugins/YoutubeChannel.py
index a1204c086..9d1ee2211 100644
--- a/Plugins/YoutubeChannel.py
+++ b/Plugins/YoutubeChannel.py
@@ -24,21 +24,27 @@ class YoutubeChannel(Plugin):
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)
- max_videos = ""
- if self.config['max_videos']:
- max_videos = "?max-results=" + self.config['max_videos']
- url = "http://gdata.youtube.com/feeds/api/users/" + self.user + "/uploads" + max_videos
- 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)
+ self.user = re.search(r"/user/(.+)", self.parent.url).group(1)
+ max_videos = self.config['max_videos']
+ if not max_videos:
+ new_links = None
+ temp_links = []
+ start_index = 1
+ while(new_links != []):
+ url = "http://gdata.youtube.com/feeds/api/users/" + self.user + "/uploads?max-results=50&start-index=" + str(start_index)
+ rep = self.req.load(url)
+ new_links = re.findall(r"href\='(http:\/\/www.youtube.com\/watch\?v\=[^']+)", rep)
+ if new_links != []:
+ temp_links.extend(new_links)
+ start_index += 50
+ self.links = temp_links
+ else:
+ url = "http://gdata.youtube.com/feeds/api/users/" + self.user + "/uploads?max-results=" + max_videos
+ rep = self.req.load(url)
+ self.links = re.findall(r"href\='(http:\/\/www.youtube.com\/watch\?v\=[^']+)", rep)
diff --git a/pluginconfig b/pluginconfig
index 0b72f9716..a4ebc74cc 100644
--- a/pluginconfig
+++ b/pluginconfig
@@ -6,4 +6,4 @@ password = pass
high_quality = True
[YoutubeChannel]
#type False for no limitation
-max_videos = 50
+max_videos = False