T
T
Tony Mahony2015-05-27 06:09:37
YouTube
Tony Mahony, 2015-05-27 06:09:37

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"),
      );

but there, by default, display only American, music, top, news, etc. How can I make it display Russian news, top, music, etc?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
europa1988, 2016-05-15
@europa1988

$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 question

Ask a Question

731 491 924 answers to any question