Answer the question
In order to leave comments, you need to log in
How to display certain categories of Youtube videos using the API?
Good morning people, the situation is such a script is connected to YouTube through the API, the script performs the function of outputting videos by category:
public $channels = array(
"music" => array( "id" => 10, "name" => "Music", "slug" => "music"),
"sports" => array( "id" => 17, "name" => "Sports", "slug" => "sports"),
"movies" => array( "id" => 30, "name" => "Movies", "slug" => "movies"),
"gaming" => array( "id" => 20, "name" => "Gaming", "slug" => "gaming"),
"people" => array( "id" => 22, "name" => "People & Blog", "slug" => "people"),
"comedy" => array( "id" => 23, "name" => "Comedy", "slug" => "comedy"),
"news" => array( "id" => 25, "name" => "News & Politics", "slug" => "news"),
"animation" => array( "id" => 1, "name" => "Film & Animation", "slug" => "animation"),
"auto-vehicles" => array( "id" => 2, "name" => "Autos & Vehicles", "slug" => "auto-vehicles"),
"howto" => array( "id" => 26, "name" => "Howto & Style", "slug" => "howto"),
"science" => array( "id" => 28, "name" => "Science & Technology", "slug" => "science"),
);
Answer the question
In order to leave comments, you need to log in
$this->url = " https://www.googleapis.com/youtube/v3/videos?key={... >key}&chart=mostPopular∂=$part&maxResults={$this->limit}&videoCategoryId={ $this->channels[$q]["id"]}®ionCode=en";
/includes/Youtube.class.php at the end you just need to put ru! I searched for a long time, but here it is, simple)))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question