Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script does not start #27

Closed
rubenmuradyan opened this issue May 16, 2015 · 13 comments
Closed

Script does not start #27

rubenmuradyan opened this issue May 16, 2015 · 13 comments

Comments

@rubenmuradyan
Copy link

Trying to upload video, getting the following error:

[root@dwarkin youtube]# youtube-upload --title="aa" --credentials-file=/data/yt_secret/client_secret.json Full_House_anons_21_18.05_aysor.mov.mp4
Using client secrets: /usr/share/youtube_upload/client_secrets.json
Using credentials file: /data/yt_secret/client_secret.json
Traceback (most recent call last):
File "/usr/bin/youtube-upload", line 181, in
sys.exit(lib.catch_exceptions(EXIT_CODES, main, sys.argv[1:]))
File "/usr/lib/python2.6/site-packages/youtube_upload/lib.py", line 37, in catch_exceptions
fun(_args, *_kwargs)
File "/usr/bin/youtube-upload", line 178, in main
run_main(parser, options, args)
File "/usr/bin/youtube-upload", line 133, in run_main
get_code_callback=get_code_callback)
File "/usr/lib/python2.6/site-packages/youtube_upload/auth/init.py", line 39, in get_resource
credentials = _get_credentials(flow, storage, get_code_callback)
File "/usr/lib/python2.6/site-packages/youtube_upload/auth/init.py", line 28, in _get_credentials
existing_credentials = storage.get()
File "/usr/lib/python2.6/site-packages/oauth2client/client.py", line 374, in get
return self.locked_get()
File "/usr/lib/python2.6/site-packages/oauth2client/file.py", line 79, in locked_get
credentials = Credentials.new_from_json(content)
File "/usr/lib/python2.6/site-packages/oauth2client/client.py", line 281, in new_from_json
module = data['_module']
KeyError: '_module'
[root@dwarkin youtube]#

OS: Centos 6.6
Installed according the README.md
I think, that I've missed something during the installation.

Thank you.

@lasconic
Copy link

I got the same on MacOSX 10.10 using the default python install. Apparently it's due to the latest google API... I fixed it with pip install -I google-api-python-client==1.3.2

@rubenmuradyan
Copy link
Author

Thanks for the answer, lasconic.
Your solution didn't help in my case. :-(
I've uninstalled my google-api-python-client, which apparently was 1.4.0, and installed 1.3.2.
The error output is the same.

@tokland
Copy link
Owner

tokland commented May 19, 2015

Cannot reproduce. If you use the default secret file, does it work? in that case, compare the contents of client_secret.json with the one included in the package. Make sure you are using the "application" type when generating the JSON file.

@rubenmuradyan
Copy link
Author

Thanks for the answer, tokland.
It didn't work with the dist supplied credentials too. Here is the output:
[root@dwarkin youtube]# youtube-upload --title="aa" --credentials-file=/data/yt_secret/client_secrets.json Full_House_anons_21_18.05_aysor.mov.mp4
Using client secrets: /usr/share/youtube_upload/client_secrets.json
Using credentials file: /data/yt_secret/client_secrets.json
Traceback (most recent call last):
File "/usr/bin/youtube-upload", line 181, in
sys.exit(lib.catch_exceptions(EXIT_CODES, main, sys.argv[1:]))
File "/usr/lib/python2.6/site-packages/youtube_upload/lib.py", line 37, in catch_exceptions
fun(_args, *_kwargs)
File "/usr/bin/youtube-upload", line 178, in main
run_main(parser, options, args)
File "/usr/bin/youtube-upload", line 133, in run_main
get_code_callback=get_code_callback)
File "/usr/lib/python2.6/site-packages/youtube_upload/auth/init.py", line 39, in get_resource
credentials = _get_credentials(flow, storage, get_code_callback)
File "/usr/lib/python2.6/site-packages/youtube_upload/auth/init.py", line 28, in _get_credentials
existing_credentials = storage.get()
File "/usr/lib/python2.6/site-packages/oauth2client/client.py", line 374, in get
return self.locked_get()
File "/usr/lib/python2.6/site-packages/oauth2client/file.py", line 79, in locked_get
credentials = Credentials.new_from_json(content)
File "/usr/lib/python2.6/site-packages/oauth2client/client.py", line 281, in new_from_json
module = data['_module']
KeyError: '_module'
You have new mail in /var/spool/mail/root
[root@dwarkin youtube]#

Is there any additional info, that may help you in investigating this issue?

@tokland
Copy link
Owner

tokland commented May 19, 2015

Did you try to delete the file being used in the --credentials-file option?

I am using these versions:

$ pip list
google-api-python-client (1.4.0)
httplib2 (0.9.1)
ipython (3.1.0)
oauth2client (1.4.7)
pip (1.5.6)
pyasn1 (0.1.7)
pyasn1-modules (0.0.5)
rsa (3.1.4)
setuptools (3.6)
simplejson (3.6.5)
six (1.9.0)
uritemplate (0.6)
wsgiref (0.1.2)

@rubenmuradyan
Copy link
Author

Yup. I've tried to rename it too. No success.
Here's my pip list
[root@dwarkin youtube]# pip list
argparse (1.3.0)
cas (0.15)
distribute (0.6.10)
ethtool (0.6)
freeipa (2.0.0.alpha.0)
gdata (2.0.18)
google-api-python-client (1.4.0)
httplib2 (0.9.1)
iniparse (0.3.1)
iotop (0.3.2)
ipapython (3.0.0)
iwlib (1.0)
kerberos (1.1)
lxml (2.2.3)
matplotlib (0.99.1.1)
netaddr (0.7.5)
nose (0.10.4)
numpy (1.4.1)
oauth2client (1.4.9)
paramiko (1.7.5)
pyasn1 (0.1.7)
pyasn1-modules (0.0.5)
pycrypto (2.0.1)
pycurl (7.19.0)
pygpgme (0.1)
pyOpenSSL (0.10)
python-dateutil (1.4.1)
python-default-encoding (0.1)
python-ldap (2.3.10)
python-nss (0.13)
pytz (2010h)
rsa (3.1.4)
simplejson (3.6.5)
six (1.9.0)
SSSDConfig (1.11.6)
uritemplate (0.6)
urlgrabber (3.9.1)
wsgiref (0.1.2)
youtube-upload (0.8.0)
yum-metadata-parser (1.1.2)
[root@dwarkin youtube]#

The only significant difference is that I have no ipython, which equieres python > 2.7.0, and I have 2.6.6. Can it be an issue?

@tokland
Copy link
Owner

tokland commented May 21, 2015

I just tested with 2.6.6, it works for me. You'll have to debug the google module yourself (if you know some python) or wait for some other MacOs user to do it.

@rubenmuradyan
Copy link
Author

I'm on CentOS 6.6
Perhaps it is better to downgrade to 0.7.3, that was working?

@tokland
Copy link
Owner

tokland commented May 22, 2015

CentOS, ok. Well, yes, but 0.7.3 is API v1, not useful on the long run.

Can you check the contents of $HOME/.youtube-upload-credentials.json? Once prettified (http://www.jspretty.com/), it should look something like this (note there is a key _module):

{
    "_module": "oauth2client.client",
    "token_expiry": "2015-05-22T14:27:43Z",
    "access_token": "1a29.ewFSUNrN1doUNMMFDRUXpcMQdiSvyEF0twUlZ0a48N4FMq-Qbqz7iYpDyWsemJ6MtXAoY9cvrGxG1w",
    "token_uri": "https://accounts.google.com/o/oauth2/token",
    "invalid": false,
    "token_response": {
        "access_token": "1a29.ewFSUNrN1doUNMMFDRUXpcMQdiSvyEF0twUlZ0a48N4FMq-Qbqz7iYpDyWsemJ6MtXAoY9cvrGxG1w",
        "token_type": "Bearer",
        "expires_in": 3600
    },
    "client_id": "111313852664-tir6o945mdn2bouorhpalkecrg23dng9.apps.googleusercontent.com",
    "id_token": null,
    "client_secret": "1dRh9GAzr9Z4sTk_km9HrrcI",
    "revoke_uri": "https://accounts.google.com/o/oauth2/revoke",
    "_class": "OAuth2Credentials",
    "refresh_token": "3/4-6LEF-3qUxz1G4Jng23y1XReASfDjbXxJRBQp6n9tUMEudVrK5jSpoR30zcRFq6",
    "user_agent": null
}

@rubenmuradyan
Copy link
Author

I do not have this file in $HOME
What shall I do to create/generate it?

@tokland
Copy link
Owner

tokland commented May 22, 2015

Sorry, if are using --credentials-file=/data/yt_secret/client_secrets.json, then check /data/yt_secret/client_secrets.json. This file is generated the first time you authenticate. Did you authenticate at least once?

@rubenmuradyan
Copy link
Author

I think I completely messed with this key.
Mine looks like this.
{
"installed": {
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"client_secret": "**********************",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"client_email": "",
"redirect_uris": ["urn:ietf:wg:oauth:2.0:oob", "oob"],
"client_x509_cert_url": "",
"client_id": "**
*****************************************************************",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs"
}
}

Thank you very much tokland, I will try to fix it.

@tokland
Copy link
Owner

tokland commented May 24, 2015

Then it's clear, this is a client secret file, not the credentials file...

@tokland tokland closed this as completed May 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants