GNOME Bugzilla – Bug 619207
Support Web-M videos
Last modified: 2010-08-09 22:02:21 UTC
"use YouTube's search feature and append &webm=1 to the URL, like this: http://www.youtube.com/results?search_query=web&webm=1" From: http://googlesystem.blogspot.com/2010/05/how-to-play-webm-video-on-youtube.html
This would have to wait until all YouTube videos have been re-encoded in WebM format. The change would then be a simple one to the get_fmt_param() function in totem-youtube.c.
Created attachment 166523 [details] [review] Use Web-M videos when available Prefer Web-M videos, to MP4 videos, and MP4 videos to FLV, or mobile videos.
Just need to figure out the possible bitrates for the videos, to fill in the get_best_uri() function.
*** Bug 614845 has been marked as a duplicate of this bug. ***
The different formats are listed in: http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs
My patch for this is almost complete. I've figured out what the problem is with certain formats: cookies. When we request the video page to extract the format map, YouTube sets some cookies, which are stored in a SoupCookieJar owned by the GVFS HTTP daemon. Since we request multiple video pages for each search, we send the cookies back to YouTube for all except one of the videos, which modifies the playback URIs we're given. The modified playback URIs require the same cookies to be sent to return the video. However, Totem uses souphttpsrc to get the video from the playback URI, which uses a different SoupCookieJar, so doesn't send back the correct (or any) cookies. Probably the best solution is to prefer giosrc to souphttpsrc, so that the video downloads use the correct cookies.
commit 55ff6cec4ecd42e85dd271e90461c8b4ac139efa Author: Philip Withnall <philip@tecnocode.co.uk> Date: Sun Aug 1 17:47:06 2010 +0100 Bug 619207 — Support Web-M videos Support all YouTube's video formats in the YouTube plugin. Closes: bgo#619207 src/plugins/youtube/totem-youtube.c | 69 ++++++++++++++++++++++++++++++++--- 1 files changed, 64 insertions(+), 5 deletions(-)
Tim, what would be the best way to prefer giosrc over souphttpsrc for YouTube videos? It there any reason that giosrc is ranked as a secondary element anyway? I was thinking about just changing the plugin rankings on activation of the YouTube plugin, but that would introduce a GStreamer dependency to the plugin.
Bastien, do you want me to commit the patch to gnome-2-30 as well?
Hmm, I would be happy if we could manage to get the cookie problem sorted out. souphttpsrc can have its cookies set: cookies : HTTP request cookies flags: readable, writable Boxed pointer of type "GStrv" The only problem left would be reading them from gio's http backend's cookie jar.
(In reply to comment #10) > The only problem left would be reading them from gio's http backend's cookie > jar. That's quite a big problem. As far as I know, there's no provision in the GIO API for retrieving information like that. The cookie jar is only stored in memory, and isn't exposed outside the HTTP backend.
Right, we might need to use soup directly then, instead of going through GIO for that. I had a similar problem when using GIO but wanting to change the user-agent (for totem-pl-parser ITMS support).
(In reply to comment #12) > Right, we might need to use soup directly then, instead of going through GIO > for that. > > I had a similar problem when using GIO but wanting to change the user-agent > (for totem-pl-parser ITMS support). That would be possible, but would still require some way of injecting the cookies in the souphttpsrc in the pipeline created by playbin2.
(In reply to comment #13) <snip> > That would be possible, but would still require some way of injecting the > cookies in the souphttpsrc in the pipeline created by playbin2. We can add an accessor for that to the bacon widget, just as we have for the user-agent configuration, or we could always load the libsoup-gnome cookies in the video widget.
New suggested solution: use libsoup directly in resolve_t_param(), instead of going through GIO. Do not store any cookies and hence don't transmit any cookies back to the server. This should hopefully get the videos working again and improve privacy. If it doesn't work, we can always try storing the cookies and passing them to bvw to request the videos anyway.
Created attachment 167406 [details] [review] Use libsoup directly to load video pages in the YouTube plugin Here's a patch which does exactly that, and seems to work. It needs a bit more testing of cancellation before it can be committed, though.
Comment on attachment 166523 [details] [review] Use Web-M videos when available (Marking old patch as obsolete.)
commit d61fd2d66bc4d45d0d8c86848599c8385f06e4a1 Author: Philip Withnall <philip@tecnocode.co.uk> Date: Mon Aug 9 09:53:09 2010 +0100 Use libsoup directly to load video pages in the YouTube plugin This means we can ignore cookies, and don't encounter the cookie sharing problem we previously had between libsoup and gvfs. Closes: bgo#619207 configure.in | 7 +++++ src/plugins/youtube/Makefile.am | 5 +++- src/plugins/youtube/totem-youtube.c | 51 ++++++++++++++++++++++++---------- 3 files changed, 47 insertions(+), 16 deletions(-)
Cherry-picked into gnome-2-30 and gnome-2-32 too.