summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/config/plugin_default.xml1
-rw-r--r--module/plugins/decrypter/YoutubeChannel.py31
-rwxr-xr-xpyLoadCore.py1
3 files changed, 20 insertions, 13 deletions
diff --git a/module/config/plugin_default.xml b/module/config/plugin_default.xml
index 773e4e46f..43c220516 100644
--- a/module/config/plugin_default.xml
+++ b/module/config/plugin_default.xml
@@ -27,6 +27,7 @@
<YoutubeChannel>
<!-- False for no limitation -->
<max_videos>False</max_videos>
+ <video_groups name="Video Groups" type="str" input="uploads;favorites">uploads,favorites</video_groups>
</YoutubeChannel>
<SerienjunkiesOrg>
<preferredHoster>RapidshareCom,UploadedTo,NetloadIn,FilefactoryCom</preferredHoster>
diff --git a/module/plugins/decrypter/YoutubeChannel.py b/module/plugins/decrypter/YoutubeChannel.py
index 27a4ff8a7..2a3ae337f 100644
--- a/module/plugins/decrypter/YoutubeChannel.py
+++ b/module/plugins/decrypter/YoutubeChannel.py
@@ -13,7 +13,7 @@ class YoutubeChannel(Plugin):
props['name'] = "YoutubeChannel"
props['type'] = "container"
props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/user/*"
- props['version'] = "0.3"
+ props['version'] = "0.4"
props['description'] = """Youtube.com Channel Download Plugin"""
props['author_name'] = ("RaNaN", "Spoob")
props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org")
@@ -34,16 +34,21 @@ class YoutubeChannel(Plugin):
max_videos = 1000 #max video a user can upload
page = 0
temp_links = []
- for start_index in range(1, int(max_videos), 50):
- max_results = max_videos - page * 50
- if max_results > 50:
- max_results = 50
- url = "http://gdata.youtube.com/feeds/api/users/" + self.user + "/uploads?max-results=" + str(max_results) + "&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)
- else:
- break
- page += 1
+ if "," in self.config['video_groups']:
+ video_groups = self.config['video_groups'].split(",")
+ else:
+ video_groups = [self.config['video_groups']]
+ for group in video_groups:
+ for start_index in range(1, int(max_videos), 50):
+ max_results = max_videos - page * 50
+ if max_results > 50:
+ max_results = 50
+ url = "http://gdata.youtube.com/feeds/api/users/%s/%s?max-results=%i&start-index=%i" % (self.user, group, max_results, start_index)
+ rep = self.req.load(str(url))
+ new_links = re.findall(r"href\='(http:\/\/www.youtube.com\/watch\?v\=[^']+)", rep)
+ if new_links != []:
+ temp_links.extend(new_links)
+ else:
+ break
+ page += 1
self.links = temp_links
diff --git a/pyLoadCore.py b/pyLoadCore.py
index b3f9b9186..0a7fef11a 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -590,6 +590,7 @@ class ServerMethods():
end = self.core.config['reconnect']['endTime'].split(":")
return self.core.compare_time(start, end)
+# And so it begins...
if __name__ == "__main__":
pyload_core = Core()
try: