如何使用C ++程序打开Youtube链接? [英] How Can I Open A Youtube Link Using A C++ Program?
问题描述
我有这个C ++程序,我的目标是输入一个字符串,然后我的程序将自动在youtube中查找该字符串并列出视频。但我面临一些问题 - 我正在使用system()打开youtube链接,我不知道如何在youtube搜索查询中传递我的字符串。我想我可以用我的代码更好地解释一下 - 这是我的代码。
string I;
cout<<输入i<< endl;
getline(cin,I);
if(I = =r)
{
system(start https://www.youtube.com/results?search_query=r);
}
这是问题,我希望我的程序自动通过刺痛我在youtube搜索链接中输入。我的意思是说我输入的任何字符串都应该自动传递给(search_query =输入的字符串)。
我无法做到这一点。有没有办法做到这一点?
谢谢
I have this C++ program and my goal is that i will enter a string and then my program will automatically look for that string in the youtube and list me the videos. But i am facing some problems- I am using the system() to open the youtube link and i dont know how i can pass my string in the youtube search query. I think i can better explain this with my code- Here is my code.
string I;
cout<<"Enter i"<<endl;
getline(cin,I);
if(I =="r")
{
system("start https://www.youtube.com/results?search_query=r");
}
Here is the problem, i want my program to automatically pass the sting i entered in the youtube search link . I mean to say that whatever string i enter should automatically be passed on to (search_query = string entered).
I am not being able to do that. Is there a way to do that?
Thanks
推荐答案
只需使用YouTube API:
https://developers.google.com/youtube/ [ ^ ]
我建议您使用.NET :
https://developers.google.com/youtube/v3/code_samples / dotnet#search_by_keyword [ ^ ]
所有这些以及更多内容都可通过简单的Google搜索获得。
Simply use the YouTube API:
https://developers.google.com/youtube/[^]
I suggest you use .NET:
https://developers.google.com/youtube/v3/code_samples/dotnet#search_by_keyword[^]
All this and much more is available via a simple Google search.
这篇关于如何使用C ++程序打开Youtube链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!