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>