Answer the question
In order to leave comments, you need to log in
Why does an error appear, are supernatural forces involved in this?
import requests, json
key = ""
req = json.loads(requests.get("https://www.googleapis.com/youtube/v3/search?key=%sU&channelId=UCgxTPTFbIbCWfTR9I2-5SeQ&part=snippet,id&order=date&maxResults=50" % key).text)
for i in req['items']:
print "videoId: ", i['id']['videoId']
Traceback (most recent call last):
File "/Users/seal/PycharmProjects/Randomtube/app.py", line 5, in <module>
videoId: 3D6m4WFBt5A
print "videoId: ", i['id']['videoId']
videoId: yO1A6Y5acpY
KeyError: 'videoId'
videoId: v3nvOKDwgvg
videoId: YKTBY35152w
videoId: Hf7IqZ_KF7w
videoId: e1Rf2zobcaw
videoId: OyV9W_IXatE
videoId: Yasjlu1iTT0
videoId: xyYZlR_Ibmc
videoId: jI8_ddgB_aQ
videoId: 52SW1YfqWio
videoId: lN_zQRh4WZ4
videoId: kAMB14V7iT8
videoId: w-ZF78sczFg
videoId: ISmCwHXfqFs
videoId: fWlbTggRKqU
videoId: jBYFIQ1rx-M
videoId: lgW5yc9NxQA
videoId: eYRsmBJJhis
videoId: dhIfakVqX9A
videoId: rnl5O2BLilc
videoId: FsbMDpTQupE
videoId:
Process finished with exit code 1
Traceback (most recent call last):
File "/Users/seal/PycharmProjects/Randomtube/app.py", line 5, in <module>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question