[Rhythmbox-devel] Podcast urls that have redirection fail (hack patch included)

Podcasts that have redirection in their content urls (most notably
those that use podtrac.com for advertising/statistics) fail to
download correctly.  This appears to either be an issue with gnome-vfs
or with how rhythmbox uses gnome-vfs.  I haven't had time to look at
the real problem yet, but I have thrown together a quick hack that
lets me download my podcasts.   Basically I am working from the
assumption that when there is redirection the url will look like this


In the podcast parser I add a few lines to find the last http:// and
use it from that point on as the url.  In order for it to work you
must first delete your podcast (feed only) and then re-add it.

Please note: most of the problems I have seen are caused by
podtrac.com and removing them from the picture may affect the revenue
stream for the content.
diff -u'rNF^function' rhythmbox-0.9.5/podcast/rb-podcast-parse.c rhythmbox-0.9.5.redir/podcast/rb-podcast-parse.c
--- rhythmbox-0.9.5/podcast/rb-podcast-parse.c	2006-06-16 22:51:55.000000000 -0400
+++ rhythmbox-0.9.5.redir/podcast/rb-podcast-parse.c	2006-07-06 10:19:56.000000000 -0400
@@ -271,6 +271,13 @@
 				for (; *attrs; attrs +=2) {
 					if (!strcmp (*attrs, "url")) {
 						const char *url_value = *(attrs + 1);
+						const char *temp;
+						/* attempt to fix broken redirections */
+						/* by finding the last http:// in the string */
+						while (temp = strstr((url_value+7), "http://";)) {
+							url_value = temp;
+						}
 						rb_set_item_value (ctx, "url", url_value);
 					} else if (!strcmp (*attrs, "length")) {
 						const char *length_value = *(attrs + 1);

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]