GNOME Bugzilla – Bug 723091
Youtube support for Google provider
Last modified: 2021-07-05 10:59:21 UTC
Hi! I am using gnome-online-accounts in GNOME Shell 3.10.2.1. In purview of "Share to youtube" feature for Cheese, I'd like to add youtube permissions to the existing Google account authentication in g-o-a. Please excuse if I am not using the right technical terms. I'd like some help in implementing this, for groundwork, I am building g-o-a from git master and looking at the codebase.
Look at get_scope in src/goabackend/goagoogleprovider.c Where is the corresponding cheese bug? Are you coordinating with totem? I think Bastien is working on a "access my Youtube account" in totem.
(In reply to comment #1) > Look at get_scope in src/goabackend/goagoogleprovider.c > > Where is the corresponding cheese bug? Are you coordinating with totem? I think > Bastien is working on a "access my Youtube account" in totem. I'm not planning it in the short-term, though there's bug 722422 for Grilo.
Created attachment 267497 [details] [review] Add Youtube permissions Please review, thanks.
Review of attachment 267497 [details] [review]: ::: src/goabackend/goagoogleprovider.c @@ +148,3 @@ + + /* Google Youtube access */ + "https://www.googleapis.com/auth/youtube.upload"; There needs to be a new capability to go with that.
(In reply to comment #4) > Review of attachment 267497 [details] [review]: > > ::: src/goabackend/goagoogleprovider.c > @@ +148,3 @@ > + > + /* Google Youtube access */ > + "https://www.googleapis.com/auth/youtube.upload"; > > There needs to be a new capability to go with that. Oh! I am not sure how to go about this, can you give me the general plan here? By "capability" do you mean that I have to create the code and UI that switches ON/OFF for youtube in gnome-online-acounts module? Please excuse for my lack of proper technical terms.
(In reply to comment #5) > (In reply to comment #4) > > Review of attachment 267497 [details] [review] [details]: > > > > ::: src/goabackend/goagoogleprovider.c > > @@ +148,3 @@ > > + > > + /* Google Youtube access */ > > + "https://www.googleapis.com/auth/youtube.upload"; > > > > There needs to be a new capability to go with that. > > Oh! I am not sure how to go about this, can you give me the general plan here? > > By "capability" do you mean that I have to create the code and UI that switches > ON/OFF for youtube in gnome-online-acounts module? Please excuse for my lack of > proper technical terms. Exactly. Look at the patch that added "Pocket" support, which shows you how to add your new capability (likely named "Video").
Created attachment 267548 [details] [review] Add Youtube permissions Please review, thanks. Tested, working.
Review of attachment 267548 [details] [review]: I can't see the changes to data/dbus-interfaces.xml. You need to add a new interface for videos, and a property to disable it. Something like: <property name="VideosDisabled" type="b" access="readwrite"/> ... and ... <interface name="org.gnome.OnlineAccounts.Videos"> </interface> There are lots of examples in that file. ::: src/goabackend/goagoogleprovider.c @@ +145,3 @@ + "https://www.googleapis.com/auth/googletalk " + + /* Google Youtube access */ Drop the "access", bump the credentials generation, and a new _VIDEOS feature to the list of provider features. @@ +329,3 @@ gboolean chat_enabled; gboolean documents_enabled; + gboolean youtube_enabled; This should be "video", not "youtube". @@ +472,3 @@ goa_account_set_chat_disabled (account, !chat_enabled); goa_account_set_documents_disabled (account, !documents_enabled); + goa_account_set_youtube_disabled (account, !youtube_enabled); Same - "video", not "youtube". @@ +500,1 @@ } Same - "video", not "youtube". @@ +569,1 @@ } Same - "video", not "youtube". @@ +580,3 @@ g_variant_builder_add (builder, "{ss}", "ChatEnabled", "true"); g_variant_builder_add (builder, "{ss}", "DocumentsEnabled", "true"); + g_variant_builder_add (builder, "{ss}", "YoutubeEnabled", "true"); Same - "video", not "youtube".
Created attachment 268047 [details] [review] Add Video permissions (In reply to comment #8) > I can't see the changes to data/dbus-interfaces.xml. > You need to add a new interface for videos, and a property to disable it. > Something like: > <property name="VideosDisabled" type="b" access="readwrite"/> > ... and ... > <interface name="org.gnome.OnlineAccounts.Videos"> > </interface> > ::: src/goabackend/goagoogleprovider.c > @@ +145,3 @@ > + "https://www.googleapis.com/auth/googletalk " > + > + /* Google Youtube access */ > > Drop the "access", Done. > bump the credentials generation, > and a new _VIDEOS feature to the list of provider features. I don't know what you mean by these instructions. Could you please explain? > @@ +329,3 @@ > gboolean chat_enabled; > gboolean documents_enabled; > + gboolean youtube_enabled; > > This should be "video", not "youtube". All instances of "youtube" changed to "video".
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-online-accounts/-/issues/ Thank you for your understanding and your help.