obtaining the url of a video with its blob key - python

I tried the code below to get the serving url for a video saved on app engine's cloud storage. It threw TransformationError.
public_url = images.get_serving_url(blob_key)
I'm using python 2.7. Is there a solution?

The images API is for processing photos/still images, not videos. Feeding it a video is very likely the reason why you're getting TransformationError.
It is possible to serve/stream videos as well, plenty of related SO material: https://stackoverflow.com/search?q=[google-app-engine]+video+streaming

Related

Automatically create and upload a Youtube video from my cloud storage

I was pondering the idea of a script/program that will auto upload to Youtube from cloud storage. I'm sure this has already been done and would appreciate it if someone could put me on the right path.
Thanks
Your are not giving a lot of detail informations e.g. what cloud you use? Maybe i'm keeping it way too simple though:
I guess this problem can be splited in to two parts:
Download to video to your local system. There are a lot of articles/documentation for all kind of cloud storage provider e.g. google cloud
Use the provided YouTube API documentation to upload your video you just fetched to your local system.
You may want to delete the video on your local file system.

How to upload images to Blogger Blogspot posts?

I'm using the API given here from Google, https://developers.google.com/blogger/docs/3.0/using . It allows managing the Blogger blogs easily. The problem is that the content that this API accepts is an HTML content. So, I must provide it with.
title
Hello, how are you doing today
...
So, to integrate an image on the post I must upload it to another image uploader service then get the URL and add it to a tag.
In contrast, if I want to upload the image directly to the Blogger UI, the image will be uploaded to Google servers.
My question is: How can I upload images to google servers as the Blogger UI do, then integrate them into my posts?
I too have been trying to work around this issue. What I did in the end is to use Google Drive API to upload the image and then get a shareable URL and embed it in the blog post.
This comes with its drawbacks, the photos are slower to load on the blog and is not accessible to crawlers. But works as far as the requirement is concerned.
If you find any way to get it done through Blogger API or through Google Photos API, please do let me know.

How to update video's creationTime using Google Photo API

all.
Can you give me some help?
I have so many videos (mp4) on Google Photo.
And some of them that shot by Casio EX-ZR200 has wrong property creationTime.
The pictures (jpg) has correct creationTime.
MP4 has minus 9 hours time lag.
I think Casio or Google do not consider UTC +9.
So, I'm fixing it.
I use python googleapiclient and Google photo API v1.
Now I have all ids of incorrect MP4.
But I can't update creationTime.
Google photo API DOES NOT have update method, right?
What should I do? What API can I use?
If I should use Picasa API or any other, can I use ids that already got by Google photos API?
Thanks
2018/06/19 update
I found a feature request on Google Issue Tracker that improve their Google Photo API.
I should be waiting for that..

Images API Python with google cloud storage

Has someone a working example how to serve images dynamically without Blobstore ? Blobstore is deprecated and I would like to use the Images API in order to crop, resize and serve images which are stored in a google cloud bucket.
At the moment I am using cloud-storage in order to serve images but it was not possible to include the Images API. An example url looks like: https://storage.googleapis.com/orbital-views.appspot.com/blabla2.png?Signature=OHLKMc64WzThGSOU3Rv8MMWz919Pjl%2FYs9Nhw4abqVTX04h4aYniC%2B%2FCtMIeh2stA70KJFdKY1YNuwhBWxDQ4CaiXy0Onn3Fy7tkW1kXw0P5EhDhKQQ27ufgUmOkYxOULo65YkfdW7fVoVeruwdTahk3I94ac4Et3Bvs4nXHW4PQqk31dLVKwYLlTkAvUArg3oiaWsAwAZUKWjfYfw9z8i68QrZubDIB8zski%2FAukPgbT5c%2B8eq8BBPbdkcS1YiL9Wz6Yl1y8VCJxM%2BVMg81IIwCfF9qoJk8Cus20PBXrDYyO7sLvLx5Dy%2BfdMxqmi%2BIZZ2JAhfdjM3oZul5cj%2B9%2Bg%3D%3D&GoogleAccessId=orbital-views%40appspot.gserviceaccount.com&Expires=1504477278
This url is generated using a signed url approach. https://cloud.google.com/storage/docs/access-control/create-signed-urls-program
My aim is to serve an image with the Images API Python.
I tried the following methods but without success.
url = images.get_serving_url(None,filename=’/gs/xxx.appspot.com/’)
blobstore_filename = '/gs{}'.format(filename)
blob_key = blobstore.create_gs_key(blobstore_filename)
url2 = images.get_serving_url(blob_key)

Accessing youtube video stream map (python)

I'm trying to write a python script that will download a youtube video, using this line of code for getting the download url:
download_url = "http://www.youtube.com/get_video?video_id={0}&t={1}&fmt=22&asv=2".format(video_id, token_value)
(video_id and token_values being info I've got from parsing youtube video url)
but this keeps downloading empty file.
Since this method is old, is there now some other form of getting download url for youtube videos?
I solved my problem (to some extent) in the meantime. I just had to access youtube video stream map and grab one of the URLs stored there and download the file. However, this works only on videos that don't have their signature encrypted. I'm still working on a solution for videos with encrypted signatures.

Categories