diff options
author | Eitan Isaacson <eitan@monotonous.org> | 2011-03-21 00:36:16 -0700 |
---|---|---|
committer | Ross Burton <ross@linux.intel.com> | 2011-03-22 21:38:15 +0000 |
commit | 59e0fad3762607693a00aecf06ca1deecc05bc0b (patch) | |
tree | c2ff2f9e9431f834e364829baea1713af7a2ba0e | |
parent | 37364525ace31d05626c081df50b401bb0ecb328 (diff) | |
download | librest-59e0fad3762607693a00aecf06ca1deecc05bc0b.tar.gz |
youtube-proxy: Added youtube_proxy_set_user_auth
-rw-r--r-- | rest-extras/youtube-proxy.c | 12 | ||||
-rw-r--r-- | rest-extras/youtube-proxy.h | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/rest-extras/youtube-proxy.c b/rest-extras/youtube-proxy.c index fc824a2..9f9bedb 100644 --- a/rest-extras/youtube-proxy.c +++ b/rest-extras/youtube-proxy.c @@ -150,6 +150,15 @@ youtube_proxy_new_with_auth (const char *developer_key, NULL); } +void +youtube_proxy_set_user_auth (YoutubeProxy *proxy, + const gchar *user_auth) +{ + YoutubeProxyPrivate *priv = proxy->priv; + + priv->user_auth = g_strdup (user_auth); +} + static gchar * _construct_upload_atom_xml (GHashTable *fields) { @@ -166,7 +175,6 @@ _construct_upload_atom_xml (GHashTable *fields) rest_xml_node_add_attr (entry, "xmlns:yt", "http://gdata.youtube.com/schemas/2007"); - g_hash_table_iter_init (&iter, fields); while (g_hash_table_iter_next (&iter, &key, &value)) { @@ -215,6 +223,8 @@ _set_upload_headers (YoutubeProxy *self, if (user_agent) soup_message_headers_append (headers, "User-Agent", user_agent); + g_print ("%s\n", priv->user_auth); + user_auth_header = g_strdup_printf ("GoogleLogin auth=%s", priv->user_auth); soup_message_headers_append (headers, "Authorization", user_auth_header); devkey_header = g_strdup_printf ("key=%s", priv->developer_key); diff --git a/rest-extras/youtube-proxy.h b/rest-extras/youtube-proxy.h index 2b4673a..b2bde90 100644 --- a/rest-extras/youtube-proxy.h +++ b/rest-extras/youtube-proxy.h @@ -72,6 +72,9 @@ RestProxy* youtube_proxy_new (const gchar *developer_key); RestProxy* youtube_proxy_new_with_auth (const gchar *developer_key, const gchar *user_auth); +void youtube_proxy_set_user_auth (YoutubeProxy *proxy, + const gchar *user_auth); + typedef void (*YoutubeProxyUploadCallback)(YoutubeProxy *proxy, const gchar *payload, const GError *error, |