Youtube API v3 upload get Video Link - youtube

I am new to the Youtube API.
I am trying to use it to upload a file through my page on youtube.
Everything is working, and the File gets uploaded.
Now i want to display the link to the Video, so i can save it in the database. Its also enough if i can log it in the console and make an ajax call to save in the db.
The point is, i dont know how to get it.
I am using exactly the code form here:https://developers.google.com/youtube/v3/code_samples/javascript

You have it already, it's the video id in the response after you upload.
https://developers.google.com/youtube/v3/docs/videos#resource
Then the url is like this - https://www.youtube.com/watch?v=id

Related

Processing stuck at 7 percent

I'm trying to upload a video using the API. I can successfully authenticate, upload and create a video and receive a video id. But when I query the processing status using https://api.dailymotion.com/video/{VideoId}?fields=status%2Ctitle%2Cpublishing_progress URL, it keeps returning "publishing_progress": 7 no matter how long I wait.
If I try to upload the same video using the website directly it will process it just fine.
I wonder if anyone else has encountered this issue and know how to solve it.
I think there is an issue with the source URL you associated to the video.
Have you correctly filled the URL field at the video creation (STEP 4.) with the URL returned by the API when you uploaded your video (on STEP 3.)?
If so, you would encourage you to contact our support with more details to dig further into possible issues

Videos Uploaded with rails ActiveStorage to AWS S3 are downloaded instead of playing when calling (clicking) on the link generated

this is kinda tricky.. let's make this clearer :
I'm using a ruby on rails app as back-end for my mobile application, when i upload a video from my ruby app Dashboard and store it on AWS S3 Storage it works perfectly, and when i retrieve the URL for the video it works as well , the thing when i click it it automatically download the video instead of playing it, i checked the meta data of the object inside my AWS Console it has the ( System defined Content-Type video/mp4 ) but as the attached screenshot show it doesn't recognize it as a video (as type is - as of null )
my response is always as JSON since i use the ruby app for the web services and the dashboard only ( i get the correct response )
PS: the video uploaded manually from the AWS Console plays when u open the link.
this is the difference between the video uploaded using my ruby app and the video uploaded manually which is highlighted in red
Look into how to set S3 Content Disposition with the library you're using. You'll need to probably do this when you're uploading the file, or you might be able to coerce it at request time when generating the link to the asset.

YouTube data API change video id

I need to change video I'd, so the URL got changed. Is it possible? As far as I can see from docs - its not supported... So is there any other way to change video URL programmatically?
Example:
When I uploaded video i received URL: youtube.com/watch?v=EMSGJdnDN8U Now (next day) I want to keep uploaded video on server, but i don't want URL youtube.com/watch?v=EMSGJdnDN8U to be available anymore, but the original video should be available on youtube.com/watch?=nEwUrL100500 (new url) and so on...
Of course I know that i can reupload video and delete original one but i dont like that solution.
Sorry, I don’t think so. The video id is a very important identifier for YouTube and it’s very unlikely that they give you control over it.

Twilio Chat - How do i display upload progress of media?

I am trying to upload a picture to a channel using the code in this link:
const formData = new FormData();
formData.append('file', $('#formInputFile')[0].files[0]);
// get desired channel (for example, with getChannelBySid promise)
chatClient.getChannelBySid(channelSid).then(function(channel) {
// send media with all FormData parsed atrtibutes
channel.sendMessage(formData);
});
File is uploaded and image is shared successfully, but i would like to show upload progress to the user. How can i do it?
Also, while displaying images, is there a way to get thumbnail of the image first so as to not download the entire image unless user wants to see it?
No examples of the upload progress code is provided in Github sample project.
Twilio developer evangelist here.
I'm afraid that it is currently not possible to get progress events with the JavaScript API. Also, there is no thumbnails of images available either, you can get the image URL using message.media.getContentUrl() and that only resolves the promise with a single URL and doesn't take options.

How to get video id from new share url pattern

I see YouTube app updated new function to share videos with the url like this:
https://www.youtube.com/shared?ci=8A940MXKFmQ
My app is using YouTube API/videos/list to get video informations and it required the Video ID field.
How can we get youtube video id from the url above.
Thanks
This is maybe not a good way to do it, but since there seems to be no API for that, check this:
https://github.com/rg3/youtube-dl/commit/4080530624eda994d535e1a01c38ddd6d9aa3805
What they do is fetching the content and search for the meta tag with the name videoId. Again: Not a good way, maybe this approach stops working in a month or a year or maybe never.

Resources