Lythimus / rsshandler

Automatically exported from code.google.com/p/rsshandler
0 stars 0 forks source link

[PATCH] Option to download all videos from a channel, instead of only the last 50 #38

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This program generates a feed of the last 50 videos, which is great for 
tracking new videos in a channel. However, sometimes you find a channel where 
you would like to watch the older videos, and have them downloaded in iTunes 
and on your phone for offline watching.

So, I added an option to generate a feed of all videos, by iterating the 
"start-index" parameter in the GData URL to get all the video links in batches 
of 50. You will see a new radio button in the GUI to select this option.

Patch is attached.

Only tested with channel feeds, haven't tried with other types of feeds such as 
playlists or whatever.

Original issue reported on code.google.com by grr...@gmail.com on 19 May 2011 at 5:21

Attachments:

GoogleCodeExporter commented 8 years ago
can you enhance this patch to respect the value for totalresults that the gdata 
api returns?  For example:

http://gdata.youtube.com/feeds/base/users/raywilliamjohnson/uploads?alt=rss&v=2&
orderby=published

<openSearch:totalResults>316</openSearch:totalResults><openSearch:startIndex>1</
openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage>

The gdata API throws a 400 error when you request a start-index greater than 
that number.

Original comment by jeromeku...@gmail.com on 30 May 2011 at 6:48

GoogleCodeExporter commented 8 years ago
Oh hey, thanks for reviewing and applying the other patches.

Sorry for the late repply, I don't check my Gmail account very often...

Your idea to use totalresults instead of relying on the error is excellent, I 
would gladly implement it.

Unfortunately, I think this whole patch should be rejected for now because I 
found other problems with it. Since it uses blind string splicing to construct 
a single feed from multiple feeds, it will sometimes create invalid XML if 
different pages of results uses different XML namespaces.

There is no way to fix this until RSS Handler is enhanced to use proper XML 
parsing everywhere instead or regex/string splicing. That way, when multiple 
feeds are merged into one using the DOM API, they will automatically drag in 
their corresponding XML namespaces into the merged feed.

I may work on adding proper XML parsing if I get some time in the following 
weeks.

P.S.
What formatting style do you prefer for patches? Some parts of the code use 
2-space indent, but other parts use tab-indent. Let me know which one is the 
"official" one.

Original comment by grr...@gmail.com on 15 Jun 2011 at 2:55