Gdrive - Need mp3 direct permanent url to play it in wordpress site - google-drive-api

I have large audio files to be played in my wordpress site. As my server being shared hosting, streaming has become much slow. I am thought of uploading the mp3 in gdrive and give the mp3 url in wordpress.
I have followed the below process-
1
clicked on download mp3 from gdrive, took the address, gave &type=.mp3 to the last. It worked for a day, but from next day onwards my audio doesn't play in my site. I am thinking that google is changing the url on daily basis dynamically.
2
thought of using the shared public link. But that takes me to google's download page. What all I need is a direct permanent link with mp3 extension for streaming purposes. This is not serving the purpose.
Any other approach in getting the permanent url with mp3 extension? Thanks.

Have you tried this URL ?
https://drive.google.com/uc?export=download&id=YOUR_FILE_ID
Check also this page for another way; but you must use the Drive API. The idea is to use the webViewLink url provided by the Drive API.

Related

Attach/reattach subtitles to video in Google Drive

I have a directory of video files in my Google Drive that I would like to attach subtitles to, and keep the subtitles updated regularly.
I am aware that this can be achieved through the in-browser Google Drive interface, by manually right-clicking on each video to "Manage caption tracks" and then locating the subtitles file (format: .vtt) in my Google Drive. However, I noticed that when I update the subtitles file later, the video does not "refresh" its access to it, but instead continues to display an older version of the subtitles .vtt file.
Is there a way to add and/or update the subtitles track using the Google Drive API? For background, I use PyDrive, and when I look at the GoogleDriveFile properties for one of my videos with subtitles, I don't see any parameters that look like the subtitles file or a link to the subtitles file, or any other parameters like the language code (en for English, etc.).
At the moment there are no API methods to do this. The Drive API documentation doesn't show any. Also, the metadata for Drive files does not include anything related to captions/subtitles. This means that adding these subtitles is probably done on a different "layer" unique to the Drive player that doesn't affect the files at all, and an API has not been considered for it.
There's also this issue tracker post requesting this feature, but it seems that it was shot down as they want Drive to focus more on file sharing. This may or may not change in the future.
As an alternative you could consider importing your videos from Drive to YouTube since the YouTube API does have methods to manage captions.
Google also has an API called Transcoder. I'm not familiar with it but after reviewing the documentation it seems that it allows you to transcode videos and add subtitles to them. This would be more complex and would probably require you to download, transcode, and reupload the videos which would end up with built-in subs, but it is something that you could potentially fully automate with APIs.

Link specific time of video hosted in Google Cloud

I have a video hosted on a Google Cloud bucket that can be publicly accessed. I've previously been able to host a video on Google Drive and create a link that would start playing the video from a specific timestamp (https://webapps.stackexchange.com/questions/99936/is-there-a-way-to-link-to-a-specific-position-inside-a-video-on-google-drive)
How can I do a similar thing with Google Cloud videos? Adding ?t=XXs to the end of the URL does not work.
Cloud Storage links aren't actually streaming video. They're just downloading the file, and the browser is playing it as the file content is downloaded. So you won't be able to seek to a specific time by simply specifying a time in the query string. If you want true video streaming with seeking and adaption to the speed of the connection, you should use a video streaming service.
Cloud Storage is where you have saved your video on the cloud. Depending on your app's programming language, there are tools available to you by google client library for that language where you can determine the starting point of video stream. For example, if you use Node.js the following code will start the video from a specific start to end point within video.
let f = fs.createReadStream("myVideo.mp4", {start, end});

Google Drive Api Stream large files (>25MB)

I'm having a web app and I want to stream a large video file from google drive in html5 video tag.
I have tried with a direct link. Something like this:
"https://drive.google.com/uc?export=download&confirm=&id=" + id;
It works for small files but for files larger than 25mb there is a virus scan and I can't bypass it.
I know that I can download it and stream it from a server but I want to know if there is a way to stream it directly from google drive without having a copy on my server.
Does anyone knows a way or have any idea how I can do that?

File Monitoring and Upload via Google Chrome Extension

I am trying to build a Google Chrome Extension which does the following -
1) Gets activated when someone visits my site say http://example.com
2) When someone downloads a file from my site , http://example.com, it starts monitoring that file for changes.
3) If the user edits and saves that file, it uploads the modified file back to the system.
My site is a niche document management system for a particular industry. Users dont want to downloads files, edit and then re-upload again. They want the files to be uploaded as soon as they save on their side. Its mostly for .docx, .xlsx files.
I tried to look at the Google chrome apis, but couldnt locate the appropriate ones. Any help would be useful.
Thanks!
As per your description, I believe chrome.downloads is what you want.
Use the chrome.downloads API to programmatically initiate, monitor, manipulate, and search for downloads.
To monitor, you could listen to chrome.downloads.onCreated and chrome.downloads.onChanged

getting videos in google drive (and Microsoft onedrive) to show in a video tag?

I have a website that has a web page with a html5 video-tag, and the user can supply a URL, and it will play in the video-tag.
The webpage uses JavaScript commands that control the video-tag - for instance, it can pause the video, move to a different point in the video, etc.
It works fine with the cloud. Videos stored on Microsoft Azure can be used, for instance (Azure gives you a way to get a URL to any video on your cloud storage, and streams it too).
However, I have users that store videos on Google-drive, and also on Microsoft One-Drive.
From what I can see, I can play these videos, but only in a page (probably with Google's own player in it) on their site.
It seems that there is no way to get a URL to these videos that I can put in a video tag.
Without the ability to do that, I can't use the javascript commands that work with the html5 video-tag.
Is there any workaround?
Or am I missing something?
Thanks.
For playing videos that are stored in google-drive using your app:
you need oauth2 credentials to access the user's drive, but assuming you have the oauth part covered :
you can create a drive application as a google appengine app and deploy it in a part of your website.
enable the drive-sdk and set the open-url to your website (that you have verified)
-> basically this tells drive to redirect towards your website whenever the user clicks on the video (from his drive)
when drive redirects to your website a json file will be sent, you'll have informations such as fileId from there i think you can execute the method files().get() to retrieve the necessary information for you to play the video
I advise you to take a look at this course in codeschool.