r25130 - in /desktop/unstable/totem/debian: changelog patches/82_youtube_api.patch patches/series

joss at users.alioth.debian.org joss at users.alioth.debian.org
Thu Sep 16 15:10:48 UTC 2010


Author: joss
Date: Thu Sep 16 15:10:44 2010
New Revision: 25130

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=25130
Log:
82_youtube_api.patch: patch from upstream git to fix youtube plugin, 
since the youtube API has changed *again* (sigh).

Added:
    desktop/unstable/totem/debian/patches/82_youtube_api.patch
Modified:
    desktop/unstable/totem/debian/changelog
    desktop/unstable/totem/debian/patches/series

Modified: desktop/unstable/totem/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/totem/debian/changelog?rev=25130&op=diff
==============================================================================
--- desktop/unstable/totem/debian/changelog [utf-8] (original)
+++ desktop/unstable/totem/debian/changelog [utf-8] Thu Sep 16 15:10:44 2010
@@ -1,6 +1,11 @@
 totem (2.30.2-3) UNRELEASED; urgency=low
 
+  [ Emilio Pozuelo Monfort ]
   * Really ship the UPnP plugin in totem-coherence.
+
+  [ Josselin Mouette ]
+  * 82_youtube_api.patch: patch from upstream git to fix youtube plugin, 
+    since the youtube API has changed *again* (sigh).
 
  -- Emilio Pozuelo Monfort <pochu at debian.org>  Tue, 01 Jun 2010 22:41:19 +0200
 

Added: desktop/unstable/totem/debian/patches/82_youtube_api.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/totem/debian/patches/82_youtube_api.patch?rev=25130&op=file
==============================================================================
--- desktop/unstable/totem/debian/patches/82_youtube_api.patch (added)
+++ desktop/unstable/totem/debian/patches/82_youtube_api.patch [utf-8] Thu Sep 16 15:10:44 2010
@@ -1,0 +1,90 @@
+From b172b8be2cffdf4e9f445e2a44c2e7de04293163 Mon Sep 17 00:00:00 2001
+From: Philip Withnall <philip at tecnocode.co.uk>
+Date: Fri, 23 Jul 2010 17:32:38 +0000
+Subject: Bug 625013 — Can't play "GUADEC 2010 STATE OF THE UNION Teaser"
+
+YouTube changed the page format again, necessitating a change in the way
+video URIs are scraped from the playback page. Closes: bgo#625013
+---
+diff --git a/src/plugins/youtube/totem-youtube.c b/src/plugins/youtube/totem-youtube.c
+index 61199bd..45a2698 100644
+--- a/src/plugins/youtube/totem-youtube.c
++++ b/src/plugins/youtube/totem-youtube.c
+@@ -394,14 +394,6 @@ impl_deactivate	(TotemPlugin *plugin, TotemObject *totem)
+ 		g_regex_unref (self->regex);
+ }
+ 
+-static const gchar *
+-get_fmt_param (TotemYouTubePlugin *self)
+-{
+-	if (bacon_video_widget_get_connection_speed (self->bvw) >= 10)
+-		return "&fmt=18";
+-	return "";
+-}
+-
+ typedef struct {
+ 	TotemYouTubePlugin *plugin;
+ 	guint tree_view;
+@@ -510,29 +502,32 @@ resolve_t_param_cb (GObject *source_object, GAsyncResult *result, TParamData *da
+ 
+ 	video_id = gdata_youtube_video_get_video_id (GDATA_YOUTUBE_VIDEO (data->entry));
+ 
+-	/* Check for the t parameter, which is now in a JavaScript array on the video page */
++	/* Check for the fmt_url_map parameter */
+ 	g_regex_match (self->regex, contents, 0, &match_info);
+ 	if (g_match_info_matches (match_info) == TRUE) {
+-		gchar *t_param, *s;
+-		const gchar *fmt_param;
+-		GString *video_uri_string;
++		gchar *fmt_url_map_escaped, *fmt_url_map;
++		gchar **mappings, **i;
+ 
+ 		/* We have a match */
+-		s = g_match_info_fetch (match_info, 1);
+-		t_param = g_uri_unescape_string (s, NULL);
+-		if (t_param == NULL)
+-			t_param = s;
+-		else
+-			g_free (s);
+-		fmt_param = get_fmt_param (self);
+-
+-		video_uri_string = g_string_new ("http://www.youtube.com/get_video?video_id=");
+-		g_string_append_uri_escaped (video_uri_string, video_id, NULL, TRUE);
+-		g_string_append (video_uri_string, "&t=");
+-		g_string_append_uri_escaped (video_uri_string, t_param, NULL, TRUE);
+-		g_string_append (video_uri_string, fmt_param);
+-
+-		video_uri = g_string_free (video_uri_string, FALSE);
++		fmt_url_map_escaped = g_match_info_fetch (match_info, 1);
++		fmt_url_map = g_uri_unescape_string (fmt_url_map_escaped, NULL);
++		g_free (fmt_url_map_escaped);
++
++		/* The fmt_url_map parameter is in the following format:
++		 *   fmt1|uri1,fmt2|uri2,fmt3|uri3,...
++		 * where fmtN is an identifier for the audio and video encoding and resolution as described here:
++		 * (http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs) and uriN is the playback URI for that format. */
++		mappings = g_strsplit (fmt_url_map, ",", 0);
++
++		for (i = mappings; *i != NULL; i++) {
++			/* For the moment we just take the first format we get */
++			gchar **mapping = g_strsplit (*i, "|", 2);
++			video_uri = g_strdup (mapping[1]);
++			g_strfreev (mapping);
++			break;
++		}
++
++		g_strfreev (mappings);
+ 	} else {
+ 		GDataMediaContent *content;
+ 
+@@ -854,7 +849,7 @@ search_button_clicked_cb (GtkButton *button, TotemYouTubePlugin *self)
+ 		 * cycles repeatedly creating new regexes for each video whose t param we resolve. */
+ 		/* We're looking for a line of the form:
+ 		 * var swfHTML = (isIE) ? "<object...econds=194&t=vjVQa1PpcFP36LLlIaDqZIG1w6e30b-7WVBgsQLLA3s%3D&rv.6.id=OzLjC6Pm... */
+-		self->regex = g_regex_new ("swfHTML = .*&t=([^&]+)&", G_REGEX_OPTIMIZE, 0, NULL);
++		self->regex = g_regex_new ("swfHTML = .*&fmt_url_map=([^&]+)&", G_REGEX_OPTIMIZE, 0, NULL);
+ 		g_assert (self->regex != NULL);
+ 
+ 		/* Set up the GData service (needed for the tree views' queries) */
+--
+cgit v0.8.3.1

Modified: desktop/unstable/totem/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/totem/debian/patches/series?rev=25130&op=diff
==============================================================================
--- desktop/unstable/totem/debian/patches/series [utf-8] (original)
+++ desktop/unstable/totem/debian/patches/series [utf-8] Thu Sep 16 15:10:44 2010
@@ -2,4 +2,5 @@
 70_bbc_plugin.patch
 80_webm.patch
 81_mpegts.patch
+82_youtube_api.patch
 90_autotools.patch




More information about the pkg-gnome-commits mailing list