I'm trying to make an app which will give you the url of the first video that comes up when you search something on youtube.
for example :
you write "c#" into a textbox and it outputs "https://www.youtube.com/watch?v=GhQdlIFylQ8" (link of the first video that comes up)
This is basically how I want the code to look like :
private async void button1_Click(object sender, EventArgs e)
{
output_textbox.Text = GetUrl(input_textbox);
}
string GetUrl(string input)
{
// ???
}
Read the documentation of the youtube api.
To solve your problem you can use the code from "Search by keyword" and change the value of the MaxResults variable to 1.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments