shoogle | Use the Google API from the shell
kandi X-RAY | shoogle Summary
kandi X-RAY | shoogle Summary
Use the Google API from the shell. An example, get the long URL using the urlshortener service:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Run the CLI
- Get method from service
- Get a service by its id
- Build a request from a service
- Get authorization code
- Context manager to temporarily replace stdin
- Callback when the page loads the authorization code
- Get a logger
shoogle Key Features
shoogle Examples and Code Snippets
Community Discussions
Trending Discussions on shoogle
QUESTION
Can (and perhaps should) I be able to delete a youtube video with the youtube data api using only an ad hoc generated access token for authorization in a "no user interaction" solution.
I am attempting to use the google youtube data api for the relatively simple task of deleting one of my existing youtube videos then uploading a new one to replace it.
Edited this to original I've looked again at the shoogle https://pypi.python.org/pypi/shoogle/0.1.0 package which:
- Exposes agnostically all the services in the API.
- Provides infrastructure for the Oauth2 authentication (console or QT/GTK browser).
- Shows info so you can build the JSON requests.
- Credentials for scopes (separated by profiles) are stored for later use.
It may be worth a closer look. It operates as a shell command requires python 3. But before I install python 3 and try to figure it out it would be great to learn more about it but I can find nothing on SO and not much besides the git-hub and python package site. If there is anyone using it or can provide direction it would be great to hear.
Original Post Continued
Most of the scopes are to "Manage your YouTube videos/account" but it is unclear how the api would know from my google client id (which I used to generate a re-usable refresh token) which youtube channel(s) I own. Could I delete any video regardless of ownership, doesn't seem like I could. So my concern is that I will expend a lot of effort on a solution I ultimately can't use. This project is for my weather station website to be able to link to a high resolution time lapse video of the last hours weather hosted on youtube, basically a hobbyist project.
The use of the api requires: a sign up to the Google Cloud Platform, quotas which may have some cost, using oauth2 which I am slowly figuring out. None of these are necessarily show stoppers but but seems like a heavy handed solution. Still it is, at this time, the only method I've found to accomplish the delete portion of the task.
I could probably accomplish something acceptable using Dropbox but youtube is the de facto standard for video sharing and I'd like to make it part of my solution if I can.
...ANSWER
Answered 2018-Jan-21 at 23:58The answer is yes. Or at least one viable solution.
Using the youtube data api python samples https://developers.google.com/youtube/v3/code_samples/python and the delete example in this post Deleting a video from youtube YouTube Data API v3 and python I was able to both delete and upload youtube videos after running the scripts once to generate and store an authorization code. The first run returns a url to your google account and after "Allowing" access to the application a code is returned which the application stores for later use.
I had mistakenly canceled the apps when I received the the "Allow" message thinking this was required for each run. After several re-readings of many posts and examining the samples I realized the authorization code could and was being saved for later use.
There are other solutions which seem to wrap api functionality into command line solutions which are also viable but after resolving my confusion about how the youtube api and oauth2 work they are also useful solutions.
QUESTION
The command line application shoogle (https://github.com/tokland/shoogle) which exposes google api services at a terminal command line requires python3 but the ubuntu 16 default python is 2.7.
I have tried alias and calling the shoogle app from subprocess in a python3 shell but (of course) the os still provides the default. I have been reluctant to make system wide changes to .bashrc or PYTHONPATH e.g. as so many other resource expect 2.7. But I am currently using this on a virtual machine so if it does break I can recover. That seems the only option but impractical in a production environment.
I've found very little shoogle help online (the author suggests SO etc. for support) so if any one has any experience with shoogle or suggestions to get the requiured python version I'd be happy to hear.
Running shoogle from a python3 interpreter finds the 2.7 files:
...ANSWER
Answered 2018-Jan-21 at 19:17Using @Surest Texans suggestions I uninstalled the shoogle app and used pip3 install to reinstall. Now the application works as expected when called from the command line.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install shoogle
You can use shoogle like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page