to login to a googlecl service with different username / e-mail address use:
google <service> list --user <e-mail>
Anthony and c_korn, I'm sorry I missed your comments before. I must have
missed the update email for this thread.
If your YouTube account is linked to a Google account, you'll want to use
google youtube <task> --user <google account>
as kaipitu said, and that should work. To avoid specifying --user every
time, you can add it to your config file (see ConfigurationOptions in the
wiki)
the --owner flag, on the other hand, takes a YouTube account name, hence
--owner RoseOfTheOcean working.
as of 0.9.11, if you have an extra argument on the command line without an
option attached to it, it will be interpreted as the name of the video you
want to list. So
google youtube list RoseOfTheOcean
will list all videos you own with a title that starts with "RoseOfTheOcean"
The ExampleScripts page has been overhauled to include many more examples.
I still haven't found an answer for having trouble with YouTube accounts
linked to Google Apps accounts. YouTube accounts linked to regular Google
accounts should work fine.
Ok, so I just did the following:
google youtube list RoseOfTheOcean --user <email>
It prints an URL in the terminal and opens an URL in my browser which fails
to load.
Then I delete everything after the &hd in the printed URL and open it.
After granting the app access the following commands work:
google youtube list RoseOfTheOcean
google youtube list --owner RoseOfTheOcean
Progress! Could you give me the following information?
- URL that is printed
- How exactly the original URL failed. It just never loaded, or was there
an error page?
- URL that you used that worked
- Type of Google account being used (one through Apps, or just a regular
account, etc.)
- version of GoogleCL you're using
- version of gdata you're using
Thanks a lot!
gogglecl now recognizes my user as being registered.
How can I undo this?
I think I have a regular google account. I just registered using my email
address.
googlecl: 0.9.11
python-gdata: 2.0.8
Pass --force-auth and --verbose on the command line. --force-auth will redo
the authentication process, and --verbose will tell you what username is
used.
$ google youtube list RoseOfTheOcean --force-auth --verbose --user
c_k...@gmx.de
Gdata will be imported from /usr/lib/pymodules/python2.6/gdata/__init__.pyc
Your pythonpath: None
Initialized googlecl.service.BaseServiceCL
missing_reqs: ['fields']
Option convert: True
Option delimiter: ,
Option fields: title,url-site
Option force_auth: True
Option hostid: korn@ubuntu
Option src: []
Option user: c_k...@gmx.de
Option verbose: True
args: [u'RoseOfTheOcean']
Forcing retrieval of new token
Token invalid! {'status': 401, 'body': '<HTML>\n<HEAD>\n<TITLE>User
authentication required.</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF"
TEXT="#000000">\n<H1>User authentication required.</H1>\n<H2>Error
401</H2>\n</BODY>\n</HTML>\n', 'reason': 'User authentication required.'}
Removed invalid token
Scopes being requested:
['http://gdata.youtube.com/feeds/api/', 'http://uploads.gdata.youtube.com/feeds/api', 'http://gdata.youtube.com/action/GetUploadToken', 'https://www.googleapis.com/auth/userinfo#email']
Please log in and/or grant access via your browser at
https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4%2FMbeCDodWGq9T_2rUYLZ32-DcMm2h&hd=gmx.de
then hit enter.opera: Activated running instance
Writing access token to
/home/korn/.local/share/googlecl/access_t...@gmx.de
Using regex: RoseOfTheOcean
Retrieved 0 entries, returning 0 of them
Wrong URL:
https://www.google.com/a/gmx.de/ServiceLogin2?continue=https%3A%2F%2Fwww.google.com%2Fa%2Fgmx.de%2FOAuthAuthorizeToken%3Foauth_token%3D4%252FMbeCDodWGq9T_2rUYLZ32-DcMm2h%26hd%3Dgmx.de&passive=true&service=apps&btmpl=authsub
Printed URL:
https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4%2FMbeCDodWGq9T_2rUYLZ32-DcMm2h&hd=gmx.de
Working URL:
https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4%2FMbeCDodWGq9T_2rUYLZ32-DcMm2h
google youtube list --owner RoseOfTheOcean
This works now.
Thanks a lot. Have you had similar problems with any other GoogleCL
services, like docs or picasa commands?
jensholmpic -- can you remove the "$hd=mnml.dk" at the end of that URL, and
see if that fixes the problem? Thanks.
@comment 20:
Already tried that, following one of the first posts, that did not fix the
problem.
Issue 326 has been merged into this issue.
I'm having the same problem with my apps account - (which also has a google
account with the same name).
If I try a vanilla gmail account it works OK.
Is this likely to be a conflict between the two types of account?
OK, I managed to resolve the problem.
I logged out of both the google apps version of my account, and my google
account.
Reran the command in Google CL, which directed me to a login page for me
Google Apps account automatically. I ignored this, and copied the url that
appears at the command line, but removed the HD parameter. I was then asked
which account I'd like to use: the Google Apps one, or the Google Account.
I picked the Google Account, and hey presto, it works.
i would like to add to danwools' solution.
log out of both accounts, get the url.
login to youtube, and then visit the url without the HD parameter.
works like a charm now
Same issue (GoogleCL 0.9.13).
I have regular account (NOT tied to Apps) with email as username
(us...@example.com) and linked Youtube account (Tubeuser).
1) --user Tubeuser
google youtube post video.avi --user Tubeuser
Please log in and/or grant access via your browser at
https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4%2FUmkr3WSSz6oGb7sjrV4vW2y_rABp&hd=default
then hit enter.
You specified account Tubeuser but granted access for us...@example.com.
Please log out of pishit...@studio-41.com and grant access with Tubeuser.
2) --user us...@example.com
google youtube post video.avi --user us...@example.com --owner Tubeuser
redirects to
https://www.google.com/a/example.com/ServiceLogin2?continue=https%3A%2F%2Fwww.google.com%2Fa%2Fexample.com%2FOAuthAuthorizeToken%3Foauth_token%3D4%252FXyh3OJTAHEWXR5alNtsCfX8v6rjv%26hd%3Dexample.com&passive=true&service=apps&btmpl=authsub
with Server Error (no Apps account)
No URL tricks (like removing &hd=...) does not work because I cannot login
to my Youtube account from https://www.google.com/accounts/...