Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

How do I get a YouTube video URL encoded FMT from the YouTube API?

$
0
0

I want to download youtube videos in c language by getting video info there is an example to getvideo information.

https://www.googleapis.com/youtube/v3/videos?id=QIlI7YquuRY&part=snippet&videoDefinition=any&key={your_youtube_api_key}

which only gives me channel_id, title, description, etag, thumbnail_url.

{"kind": "youtube#videoListResponse","etag": "Nuvv5Gz7yoeUK9claaky2AhQBG4","items": [    {"kind": "youtube#video","etag": "xHzMRqajx2fsI41qEOaDanW6TDc","id": "QIlI7YquuRY","snippet": {"publishedAt": "2020-12-07T16:04:22Z","channelId": "UCeVMnSShP_Iviwkknt83cww","title": "How I Learned to Type Really Fast (150 Words/Minute)","description": "How to learn touch typing: In this video I will discuss about how I learnt to type as fast as 150 wpm. This video will give you an exact roadmap needed to type at the speed of 150wpm. You will need the discussed tools along with adequate practice to crack fast typing. \n►Checkout my English channel here: https://www.youtube.com/ProgrammingWithHarry\n►Click here to subscribe - https://www.youtube.com/channel/UCeVMnSShP_Iviwkknt83cww\n\nBest Hindi Videos For Learning Programming:\n►Learn Python In One Video - https://www.youtube.com/watch?v=ihk_Xglr164\n\n►Python Complete Course In Hindi - https://www.youtube.com/playlist?list=PLu0W_9lII9agICnT8t4iYVSZ3eykIAOME\n\n►C Language Complete Course In Hindi -  \nhttps://www.youtube.com/playlist?list=PLu0W_9lII9aiXlHcLx-mDH1Qul38wD3aR&disable_polymer=true\n\n►JavaScript Complete Course In Hindi - \n https://www.youtube.com/playlist?list=PLu0W_9lII9ajyk081To1Cbt2eI5913SsL\n\n►Learn JavaScript in One Video - https://www.youtube.com/watch?v=onbBV0uFVpo\n\n►Learn PHP In One Video - https://www.youtube.com/watch?v=xW7ro3lwaCI\n\n►Django Complete Course In Hindi -  \nhttps://www.youtube.com/playlist?list=PLu0W_9lII9ah7DDtYtflgwMwpT3xmjXY9\n\n►Machine Learning Using Python - https://www.youtube.com/playlist?list=PLu0W_9lII9ai6fAMHp-acBmJONT7Y4BSG\n\n►Creating & Hosting A Website (Tech Blog) Using Python - https://www.youtube.com/playlist?list=PLu0W_9lII9agAiWp6Y41ueUKx1VcTRxmf\n\n►Advanced Python Tutorials - https://www.youtube.com/playlist?list=PLu0W_9lII9aiJWQ7VhY712fuimEpQZYp4\n\n►Object Oriented Programming In Python - https://www.youtube.com/playlist?list=PLu0W_9lII9ahfRrhFcoB-4lpp9YaBmdCP\n\n►Python Data Science and Big Data Tutorials - https://www.youtube.com/playlist?list=PLu0W_9lII9agK8pojo23OHiNz3Jm6VQCH\n\nFollow Me On Social Media\n►Website (created using Flask) - http://www.codewithharry.com\n►Facebook - https://www.facebook.com/CodeWithHarry\n►Instagram - https://www.instagram.com/codewithharry/\n►Personal Facebook A/c - https://www.facebook.com/geekyharis\nTwitter - https://twitter.com/Haris_Is_Here","thumbnails": {"default": {"url": "https://i.ytimg.com/vi/QIlI7YquuRY/default.jpg","width": 120,"height": 90          },"medium": {"url": "https://i.ytimg.com/vi/QIlI7YquuRY/mqdefault.jpg","width": 320,"height": 180          },"high": {"url": "https://i.ytimg.com/vi/QIlI7YquuRY/hqdefault.jpg","width": 480,"height": 360          },"standard": {"url": "https://i.ytimg.com/vi/QIlI7YquuRY/sddefault.jpg","width": 640,"height": 480          },"maxres": {"url": "https://i.ytimg.com/vi/QIlI7YquuRY/maxresdefault.jpg","width": 1280,"height": 720          }        },"channelTitle": "CodeWithHarry","categoryId": "27","liveBroadcastContent": "none","localized": {"title": "How I Learned to Type Really Fast (150 Words/Minute)","description": "How to learn touch typing: In this video I will discuss about how I learnt to type as fast as 150 wpm. This video will give you an exact roadmap needed to type at the speed of 150wpm. You will need the discussed tools along with adequate practice to crack fast typing. \n►Checkout my English channel here: https://www.youtube.com/ProgrammingWithHarry\n►Click here to subscribe - https://www.youtube.com/channel/UCeVMnSShP_Iviwkknt83cww\n\nBest Hindi Videos For Learning Programming:\n►Learn Python In One Video - https://www.youtube.com/watch?v=ihk_Xglr164\n\n►Python Complete Course In Hindi - https://www.youtube.com/playlist?list=PLu0W_9lII9agICnT8t4iYVSZ3eykIAOME\n\n►C Language Complete Course In Hindi -  \nhttps://www.youtube.com/playlist?list=PLu0W_9lII9aiXlHcLx-mDH1Qul38wD3aR&disable_polymer=true\n\n►JavaScript Complete Course In Hindi - \n https://www.youtube.com/playlist?list=PLu0W_9lII9ajyk081To1Cbt2eI5913SsL\n\n►Learn JavaScript in One Video - https://www.youtube.com/watch?v=onbBV0uFVpo\n\n►Learn PHP In One Video - https://www.youtube.com/watch?v=xW7ro3lwaCI\n\n►Django Complete Course In Hindi -  \nhttps://www.youtube.com/playlist?list=PLu0W_9lII9ah7DDtYtflgwMwpT3xmjXY9\n\n►Machine Learning Using Python - https://www.youtube.com/playlist?list=PLu0W_9lII9ai6fAMHp-acBmJONT7Y4BSG\n\n►Creating & Hosting A Website (Tech Blog) Using Python - https://www.youtube.com/playlist?list=PLu0W_9lII9agAiWp6Y41ueUKx1VcTRxmf\n\n►Advanced Python Tutorials - https://www.youtube.com/playlist?list=PLu0W_9lII9aiJWQ7VhY712fuimEpQZYp4\n\n►Object Oriented Programming In Python - https://www.youtube.com/playlist?list=PLu0W_9lII9ahfRrhFcoB-4lpp9YaBmdCP\n\n►Python Data Science and Big Data Tutorials - https://www.youtube.com/playlist?list=PLu0W_9lII9agK8pojo23OHiNz3Jm6VQCH\n\nFollow Me On Social Media\n►Website (created using Flask) - http://www.codewithharry.com\n►Facebook - https://www.facebook.com/CodeWithHarry\n►Instagram - https://www.instagram.com/codewithharry/\n►Personal Facebook A/c - https://www.facebook.com/geekyharis\nTwitter - https://twitter.com/Haris_Is_Here"        },"defaultAudioLanguage": "hi"      }    }  ],"pageInfo": {"totalResults": 1,"resultsPerPage": 1  }}

but I want URL encoded FMT stream map to download video.Here my code is simple to get request.

here is code.

#include <stdio.h>#include <curl/curl.h>#include <math.h>#include <stdbool.h>#include "get_video_ID.h"char youtube_id[1024];int main(int argc,char* argv[]){    CURL *curl;    FILE *fp;    CURLcode res;    char* original_link = argv[1];    strcpy(youtube_id,get_video_id(original_link)); // to extract the video id from url and store it in youtube_id    char url[1024] = "https://www.googleapis.com/youtube/v3/videos?part=snippet&key={your_youtube_api_key}&videoDefinition=any&id=";    strcat(url,youtube_id); // to append the youtube_id    char outfilename[FILENAME_MAX] = "api_data.txt";    curl = curl_easy_init();                                                                                                                                                                                                                                                               if (curl)    {        fp = fopen(outfilename,"wb");        curl_easy_setopt(curl, CURLOPT_URL, url);        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER,false);        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, NULL);         curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);        res = curl_easy_perform(curl);        curl_easy_cleanup(curl);        fclose(fp);    }       return 0;}

Anyone can help me about this.

I want the following information.

• Thumbnails

• Video length

• View count

• Average rating

• URL encoded FMT stream map

• Watermarks

• Keywords

• Author

• Status

• Video ID

• Title

to download and get details about video.


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>