When I do the PlaylistItems.insert()
method, how can I handle the videoNotFound
error? In addition, how can I handle other errors at the same time like IndexError
?
try: result = youtube.playlistItems().insert( part = "snippet", body = {"snippet": {"playlistId": MY_PLAYLIST_ID,"resourceId": {"kind": "youtube#video","videoId": MY_VIDEO_ID } } } ).execute() print(my_list[100])except: #handle videoNotFound error #handle print(my_list[100]) if it raises an Index Error