After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 596615 - Rhythmbox fails to download podcast
Rhythmbox fails to download podcast
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: Podcast
0.12.x
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on: 598505
Blocks:
 
 
Reported: 2009-09-28 15:03 UTC by Nattgew
Modified: 2010-04-10 12:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Support using g_file_input_stream_query_info() to get file information for podcasts (8.96 KB, patch)
2009-10-15 05:32 UTC, Robert Ancell
none Details | Review
Support using g_file_input_stream_query_info() to get file information for podcasts (9.01 KB, patch)
2009-10-15 05:42 UTC, Robert Ancell
committed Details | Review

Description Nattgew 2009-09-28 15:03:13 UTC
For some reason, since September 15th, Rhythmbox fails to download podcasts from "60 second science" (http://rss.sciam.com/sciam/60secsciencepodcast)

I've dug out a podcast URL from the XML for sept 25th and wget downloads the podcast fine.

Bug reported here:
https://bugs.launchpad.net/ubuntu/+source/rhythmbox/+bug/437454
Comment 1 Robert Ancell 2009-10-02 06:51:00 UTC
To reproduce:
1. Open Rhythmbox
2. Open menu Music > New Podcast Feed
3. Add feed "http://www.pheedo.com/e/b7f9489601ab23c2b3e3516d44e5ac9b/podcast.mp3?e_id=EF83BDDD-E77B-CCA5-72F76C3AD1DE71CD&ref=p_itune"

Result:
Dialog displayed:
"Error in podcast

There was a problem adding this podcast: Unable to check file type: HTTP Client Error: Forbidden.  Please verify the URL: http://www.pheedo.com/e/b7f9489601ab23c2b3e3516d44e5ac9b/podcast.mp3?e_id=EF83BDDD-E77B-CCA5-72F76C3AD1DE71CD&ref=p_itune. Would you like to add the podcast feed anyway"

Expected result:
Podcast loaded as the file can be downloaded using wget, i.e.:
wget http://www.pheedo.com/e/b7f9489601ab23c2b3e3516d44e5ac9b/podcast.mp3?e_id=EF83BDDD-E77B-CCA5-72F76C3AD1DE71CD&ref=p_itune
Note that that this download is redirected with HTTP 301 and 302 responses.
Comment 2 Robert Ancell 2009-10-02 07:14:14 UTC
The error is coming from g_file_query_info() - guessing this function does not handle HTTP redirects.
Comment 3 Robert Ancell 2009-10-06 03:15:01 UTC
This is being caused by the HTTP servers response to HEAD requests (which are generated from g_file_query_info):

GET /e/b7f9489601ab23c2b3e3516d44e5ac9b/podcast.mp3?e_id=EF83BDDD-E77B-CCA5-72F76C3AD1DE71CD&ref=p_itune HTTP/1.1
Host:

HTTP/1.1 302 Found
Date: Tue, 06 Oct 2009 03:10:54 GMT
Server: Apache
X-Powered-By: PHP/5.2.3-1ubuntu6.5
Pragma: no-cache
Cache-Control: no-cache, must-revalidate
Location: http://www.sciam.com/podcast/podcast.mp3?e_id=EF83BDDD-E77B-CCA5-72F76C3AD1DE71CD&ref=p_itune
Vary: Accept-Encoding
Content-Length: 0
Connection: close
Content-Type: text/html

HEAD /e/b7f9489601ab23c2b3e3516d44e5ac9b/podcast.mp3?e_id=EF83BDDD-E77B-CCA5-72F76C3AD1DE71CD&ref=p_itune HTTP/1.1
Host:

HTTP/1.1 403 Forbidden
Date: Tue, 06 Oct 2009 03:11:03 GMT
Server: Apache
X-Powered-By: PHP/5.2.3-1ubuntu6.5
Vary: Accept-Encoding
Connection: close
Content-Type: text/html
Comment 4 Jonathan Matthew 2009-10-06 03:32:25 UTC
Maybe we could look at better ways of handling failed HEAD requests, but the podcast download process isn't going to work very well in that case.
Comment 5 Robert Ancell 2009-10-06 03:35:10 UTC
I'm looking at how to avoid doing the HEAD requests as they're not required - you should be able to do a GET request until the headers and then decide if to continue or not (which would be more efficient anyway).  I'm guessing logically this should be achievable with g_file_input_stream_query_info () but it doesn't appear to work for HTTP streams.
Comment 6 Robert Ancell 2009-10-15 01:08:26 UTC
Bug 598505 contains a patch to gvfs to allow the headers to be requested using g_file_input_stream_query_info()
Comment 7 Robert Ancell 2009-10-15 05:32:18 UTC
Created attachment 145480 [details] [review]
Support using g_file_input_stream_query_info() to get file information for podcasts

Instead of doing a g_file_query_info_async() first it does a g_file_read_async() and if g_file_input_stream_query_info() works uses that and does the download.  If not falls back to using g_file_query_info_async() as before.

Patch to gvfs to support g_file_input_stream_query_info() for HTTP streams is in bug 598505
Comment 8 Robert Ancell 2009-10-15 05:42:26 UTC
Created attachment 145481 [details] [review]
Support using g_file_input_stream_query_info() to get file information for podcasts

Forgot to remove the existing line opening the file; it was opening it twice
Comment 9 Bastien Nocera 2009-10-16 15:21:59 UTC
Is this enough to fix adding the podcast/parsing it, or does totem-pl-parser need a similar fix?
Comment 10 Robert Ancell 2009-11-30 04:11:23 UTC
No change is required in totem-pl-parser
Comment 11 Jonathan Matthew 2009-12-28 04:17:15 UTC
Review of attachment 145481 [details] [review]:

needs a better commit message.  should be formatted like this:
  component: brief summary (bug #xxxxxx)

  longer description etc.

::: podcast/rb-podcast-manager.c
@@ +625,2 @@
 static void
+download_error (RBPodcastManagerInfo *data, GError *error, gboolean in_thread)

you don't need the in_thread parameter, just use rb_is_main_thread()

@@ +740,3 @@
+	/* If no stream information then probably using an old version of gvfs, fall back
+	 * to getting the stream information from the GFile.
+	 * This branch can be removed when this version of gvfs is released, see:

no, it can be removed when the minimum requiremend version includes this functionality. not at all the same thing for rhythmbox.
Comment 12 Jonathan Matthew 2010-04-10 12:49:08 UTC
I updated this and pushed it as commit dfc275f