Original
I am trying to get top 10 videos in my channel from YouTube, so I followed the sample code from Google: https://developers.google.com/youtube/analytics/v1/code_samples/python#retrieve_top_10_videos_by_viewcount
I have installed all packages and downloaded client secrets. I typed python get_json.py in command line. (The sample script is renamed to get_json.py) This is what is showing up in command line:
WARNING:root:This function, oauth2client.tools.run(), and the use of the gflags library are deprecated and will be removed in a future version of the library.
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.readonly+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyt-analytics.readonly&
redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&response_type=code&client_id=849986408789-otj3v9ghdlrr24nag9c4bepei6fo0vvm.apps.googleusercontent.com&access_type=offline
If your browser is on a different machine then exit and re-run this application with the command-line parameter
--noauth_local_webserver
Then my browser pops up and I am getting this invalid_client error. Did I miss anything?
Update
I added a name in "product name" in Google API Console and reset my client secret. It works now.
It seems like you set your credentials in Google Developer Console wrong. If you are running it from a local machine, you should pick "installed application" or if from a webserver, you should specify the redirect_uri.
Also make sure YT Analytics API is turned on in the console for this project.
Related
I have followed around 5 tutorials on using NSSM to run a python script residing on a network drive. It creates the service, I can edit the service but when I start the service I get the following error:
Unexpected status SERVICE_STOPPED in response to START control
When I try starting the Windows-10 service from Services I get the following error:
Services error during start
I have changed the path to the python script from the full network path to a mapped network path and that did not change anything.
I have also tried using Task Scheduler which worked once in a while and was intermittent and I also tried the pywin32 method as posted here but it fails to start the service as well.
I figured it out. On my remote VM it does not allow Local System Account to be set as the Log on. It required me to add an admin user name and password. It's running now.
when I try to use python + Selenium to run my code, the error message shows in the terminal during the program is running, it has no effect of my program, but sort of annoying, does anyone have any solution to tell me why the error shows, and how to disable the error message.
my network is located in China, and our network policy disables the access to Google, is the may the cause?
[21792:15920:1230/144009.402:ERROR:gcm_channel_status_request.cc(145)] GCM channel request failed.
anyway, thanks in advance.
Note: This is not a definitive answer; it is very rough conclusions drawn from a quick investigation.
GCN is Google Cloud Messaging. It appears that the Selenium Chrome extension is using GCN. See for example https://pushwizard.com/chrome-gcm-messaging.
I see these messages when my Python Selenium Chrome application is sleeping and I hibernate the machine. It may occur at other times.
I surmise that the Selenium Python backend is using GCN and uses a ping or keep-alive type of message to find out if the Chrome browser is still there. I further surmise that since my Python application takes much less memory than the Chrome browser, my app wakes up first, pings the browser, and reports that there was no response.
Since it's not causing a problem this is enough for me.
Google Cloud Messaging is deprecated - you should use Firebase Cloud Messaging instead.
You may need to update your selenium webdriver for chrome.
Since your access to google ( and I think google services too ) is disabled this also could be the issue. To test this, you should go and implement the selenium application with firefox (or any other non chromium based browser) ; which shouldn't use google services inherently. ( but i am not 100% sure about that )
I've been following this guide:
https://developers.google.com/drive/v3/web/quickstart/python
and did everything up to the
python quickstart.py
part. When I do that it opens up a new browser (oddly not my default browser but whatever) and I get the OAuth screen, but once I click "Allow" it gives me a "localhost didn't send any data" error. The shell has:
/Library/Python/2.7/site-packages/oauth2client/_helpers.py:255:
UserWarning: Cannot access /Users/timothy.tran/.credentials/drive-
python-quickstart.json: No such file or directory
warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
0:297: execution error:
What does this mean and how can I fix it?
It means it cannot access this file:
Cannot access /Users/timothy.tran/.credentials/drive-
python-quickstart.json
because:
No such file or directory
I just got this quickstart running a while ago. When you click the oauth link generated by python commandline and it opens a random browser, copy that link and paste it in the browser where your gmail account (which you're also using in your google dev console) is currently logged-in. Let me know if you're still stuck after this.
Also I don't think you need a localhost to run this. If anything, I'd used a python virtual environment.
When I try to run volttron through Eclipse it gives me this message at the end:
volttron.platform.web INFO: Web server not started
In the run configurations, the arguments I gave at first was -vv --developer-mode. It didn't recognize it, neither did it recognise -vv -developer-mode. The message was:
usage: main.py [OPTION]...
main.py: error: unrecognized arguments: --developer-mode
When I remover developer-mode it gives me the first message.
I am using Ubuntu, Luna eclipse.
Developer mode has been removed and is no longer needed.
To achieve the equivalent of the old developer mode do this:
volttron-ctl auth add
Leave ever answer blank except for this:
credentials []: /.*/
This will setup the platform to allow agents to connect without proper credentials which is needed for running an agent in a debugger.
You can find out more here: http://volttron.readthedocs.io/en/develop/devguides/agent_development/index.html
The web server message is just informing you that the VOLTTRON platform web server is not setup to start. This is not an error condition.
Th web server is used for platform discovery, the common agent restful API, and a few other features, none of which required for normal operation.
I deployed a bottle website on Azure but it shows 500 (internal error) and I can’t see the log. I refer to https://github.com/Microsoft/PTVS/wiki/Azure-Remote-Debugging to debug my project but it failed.
It shows the error message as below.
could not attach to python.exe process on Azure web site at testpybottleapp.azurewebsites.net.
Error retrieving websocket debug proxy information from web.config.
And when I try to open http://testpybottleapp.azurewebsites.net/ptvsd it said ptvsd not existed.
Have you considered using VorlonJS as well? It's a remote website debugger which may help in this case.
Alternatively, could you try grabbing a similar VM from VMDepot, uploading that, and seeing if you have the same issue? That could help us troubleshoot and understand if the issue lies in the VM itself, or one of the configuration settings.
If we want to use the remote debug on Azure for python website, we should set the publish mode as "debug". And then we should enable websocket.
Meanwhile I suggest you can try to use the debug=>Attach to Process and input wss://WSGI_PTVSD_SECRET#WEBSITE_NAME.azurewebsites.net/ptvsd. When the process (Python.exe) is shown,you can click the "Attach". Then you can open your website http://WEBSITE_NAME.azurewebsites.net in browser.
If you visit the URL like "http://mysite.azurewebsites.net/ptvsd" and get the "ptvsd not existed" error, Please double check these points:
You should publish your website as Debug mode not release mode.
Make sure the 'WSGI_PTVSD_SECRET' in local is same as the Azure website .