I have an issue, i am trying to make Python search for videos through the Youtube API, a part of the code doesn't work. When i try to get the tags of the video, it gives me an error.
So far i have used the example from Google "search_by_keyword". It has worked well. I have however changed it a little. What i want is Python to give me video IDs with the tags in that video. I tried debugging, by making it print the whole "snippet" part of the table, it appears that "tags" are not found at all in "snippet"
only a bit of the code have been added, the rest is working find.
for search_result in search_response.get("items", []):
if search_result["id"]["kind"] == "youtube#video":
videos.append("%s (%s)" % (search_result["snippet"]["tags"],
search_result["id"]["videoId"]))
print ("Videos:\n", "\n".join(videos), "\n")
At
videos.append("%s (%s)" % (search_result["snippet"]["tags"]
i expect it here to give me the tags of the video, but it only comes up with a traceback error "keyerror: tags".
Trying to make it print the whole "snippet" part, gives me everything but "tags" AND "categoryid"
I think the question comes down to: Where do i find the "tags" element in the data table?