M
M
Master Ruby2019-04-15 19:38:38
YouTube
Master Ruby, 2019-04-15 19:38:38

The program does not work, what address should I use?

Guys, hello! There is the following code:

import json
from urllib.request import urlopen
url = "https://gdata.youtube.com/feeds/api/standardfeeds/top_rated?alt=json"
response = urlopen(url)
contents = responce.read()
text = contents.decode ('utf8')
data = json.loads(text)
for video in data['feed']['entry'][0:6]:
    print(video['title']['$t'])

The fact is that it does not work, as I understand it, the url address is not relevant, tell me how to fix the situation ?!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question