Both the Google Play books website and the Google Play books Android application, have the ability to upload your own ebooks. I wish to perform the same thing using a script written in python3 or nodejs.
I have taken a look at the API and, it seems that it is only for retrieving information about the various books.
I am wondering whether I'll have to achieve this using something like Google Chrome CDP to use the Goolge Play Books website itself to upload books or can this be done using the API and it's undocumented?
I was able to solve this.Automated uploading to Google play books by using the website itself via selenium and it's chrome driver.
Related
i would like to use the Youtube API's with
Google Apps Scripts.
Unfortunately I am complete newbie and don't know Google Scripts.
Can someone please guide me to the link in which part of google apps
I can directly get started.
Thanks
Svenja
learn Google Apps scripts
Learn Google cloud... simple things like making projects and which permission and api you will need in ur project
Use YouTube API in Google Apps Scripts
https://developers.google.com/youtube/v3/guides/
I have searched the web for tutorials and instructions but could not find any on this... So I was hoping maybe someone here can point me in the right direction or just link some good tutorials. (By the way I am willing to make a basic YouTube client app which lets the user search for videos and than watch them...nothing too fancy).
Thanks in advance!
Oh buddy.... welcome welcome to the world of parsing JSON files and putting up with BADLY documented APIs :)
Well I was looking into this a few months ago and I managed to get it working. Here are the things you have to do:
Step 1 - OAuth 2.0 Integration
Will your app allow the user to login to YouTube so that they can comment/like/etc... videos? If so, then you will need to get the user to login to the YouTube API via your app first before they can do these kind of things. In order to do that, your app will need to use OAuth 2.0 to communicate with the YouTube API. Here is a superb library which you can use to authenticate with the YouTube API via OAuth 2.0: https://github.com/BHughes3388/BAHYouTubeOAuth
Step 2 - Keychain - Access Token storage
If you are new to OAuth authentication, then it can be daunting at first, but once you play around with it and familiarize yourself with it, you will realize that it is very easy to work with.
So overall, the way it works, is that your app contacts the API (in this case YouTube V3 API) and requests a webpage. The webpage allows the user to login to the APi and grant your app access. Once this has been done, the API will send your app an "access token". This token will need to be used in all (or most) of your API requests (it depends on the type of request).
Once you have obtained the "access token" you will then need to store it securely. Its basically a password, so you need to keep it safe. Do not do what some people do, which is to use NSUserDefaults, that is not secure at all. Instead you will need to use Keychain. This is Apple's secure encryption/storage library which can easily be used to save secure strings such as passwords.
In order to use Keychain to securely store and retrieve the "access token" when you need it, take a look at this SO post, its great: How to use Keychain for saving password like GenericKeychain sample code
Step 3 - YouTube API V3 - https://developers.google.com/youtube/v3/
Right so now, the harder bit. You need to read through the Google YouTube API V3 and go through the API reference documents to find the specific URLs which will return the data you are looking for. For example: if you want to get a list of videos from the home feed of a user or from a simple search, then take a look at this API reference page: https://developers.google.com/youtube/v3/docs/videos/list
Step 4 - Extract the video URL
Before I talk further about this step, I should mention that Google says you should present videos in a simple webview with YouTube HTML code which simply embeds the video view in your app. But in my opinion (and many other devs), this looks and works horribly....
So if you want to display YouTube video in your app via the native MPMovieplayerController, then you will need to extract the video URL first before you can do this.
When you make a request to the YouTube API for a set of video(s), you will get a JSON file back, this file contains a list of videos (videoIDs, titles, dates, etc....).
You will need to parse the JSON file for the video IDs. Once you or the app user has selected the video that they want, you will need to use then pass the video ID for that particular video to a "YouTube video link extractor" library. This library will then return a set of video file links for that video. These links can be used in conjunction with MPMovieplayerController to display the video natively.
Here is a great YouTube video file url extracter - https://github.com/runmad/RMYouTubeExtractor
Good luck :)
Is it possible to upload a video file which is stored on Google Cloud to YouTube pro-grammatically (without user intervention)? Preferably PHP.
I would like to run the application via a Cron job.
Can you point me to an example of how this is done?
Thanks in advance
You can use the YouTube Data API to upload videos to YouTube programmatically. Its documentation is at https://developers.google.com/youtube/v3/
I am not very familiar with it, but I don't think that it can read directly from Google Cloud Storage.
We have a manual process to download the performance report from youtube cms application. This report is a csv or zip that is generated weekly and gives the "view" details for every video owned by the user at a daily level.
Is there an API to download this report ? I looked at the youtube analytics api and it looks like I have to get the data for each video individually. We have a lot of videos and this will be over the quota. Is there a way to get the weekly performance report through some api ?
The current YouTube Analytics API isn't well suited for performing bulk reporting for any significant volume of videos.
There's an open feature request that you can "Star" to be notified when there's an alternative approach available. I'm afraid that I don't have any timelines to share, but it's being actively worked on.
As Jeff pointed out before, you won't be able to download a performance report from Youtube CMS using Youtube Analytics API.
You can use mechanize module in python to log in to your youtube cms account and navigate to that download URL.
browser = mechanize.Browser()
browser.open('http://cms.youtube.com')
browser.select_form(nr = 0)
browser.form['Email'] = email
browser.form['Passwd'] = password
browser.submit()
browser.open(dashboard_url) //url that you get redirected to when you login
and then you can search for reports link. then click on that. then search for the report you want and download it.
more info here:
http://www.pythonforbeginners.com/cheatsheet/python-mechanize-cheat-sheet/
i was able to download reports that i want using this module in python.
Is it possible to allow uses to upload video to my youtube account with v3 api? I want allow users to upload video through my website to youtube but not ask them to login to their youtube account. I know it was possible in v2 api. Is it also doable in v3 api?
I've tried so hard to do the same thing as you /w the v3 API. The principal difficulty is to set our credentials in the code. With the v3 API, all the old login methods are "deprecated", to lead place to oAuth V2 login method.
In the API, i've didn't found a parameter where to set credentials. I hope you can find it. Let me know if this is the case.
If you success to create an httpClient object /w your credentials, this is perfect, the code is easy after doing this.
In the case you seach the right code for the v2 version : here
Good luck :)
I'm digging into this question now, too. So far, one workaround is to use the email upload option (found within Youtube's settings once logged in).
There's a limit of 25mb here so it's probably just a temporary proof of concept but powerful enough for smaller vids (mixed with FFMpeg tools wrapped for the language of your choice, I'm using Node.js http://www.benfarrell.com/2012/06/14/morph-your-media-with-node-js/)
Ideally, I want a user to upload a vid, store it in RAM, and then get it pushed to my youtube channel. We'll see what we find...