madscheme/introducing-python

YouTube API is old

koki0702 opened this issue · 1 comments

YouTube API is old. So the source code which is related to YouTube API doesn't work (youtube.py and youtube2.py).

  • intro/youtube2.py
import requests
url = "https://gdata.youtube.com/feeds/api/standardfeeds/top_rated?alt=json"
response = requests.get(url)
data = response.json()
for video in data['feed']['entry'][0:6]:
    print(video['title']['$t'])

I prepared dummy API for YouTube (#5).