[librest] youtube-proxy: Added youtube_proxy_set_user_auth



commit 59e0fad3762607693a00aecf06ca1deecc05bc0b
Author: Eitan Isaacson <eitan monotonous org>
Date:   Mon Mar 21 00:36:16 2011 -0700

    youtube-proxy: Added youtube_proxy_set_user_auth

 rest-extras/youtube-proxy.c |   12 +++++++++++-
 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,



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