Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

How can I programmatically get information on why a YouTube video was removed?

$
0
0

I am collecting some information about YouTube videos using their API. Sometimes, I query a video metadata (using youtube.videos().list call) and get an empty reply back. For instance:

{'kind': 'youtube#videoListResponse', 'etag': 'YIUPVpxNjppyCWOZfL-19gLb7uk', 'items': [], 'pageInfo': {'totalResults': 0, 'resultsPerPage': 0}}

However, it does not tell me why the video is no longer accessible. For instance, this video https://www.youtube.com/watch?v=xr4LCD3Gel4 shows the message "This video has been removed for violating YouTube's Community Guidelines" when you load it in the browser, and I'd like to get this information.

Is there an API call or some other trick for collecting the reason a video is not available, besides loading the webpage and scraping the error message?

Specifically, I tried running this YouTube API query (python):

import googleapiclient.discoveryyoutube = googleapiclient.discovery.build("youtube", "v3", developerKey = MYKEY)response = youtube.videos().list(part="contentDetails,id,snippet,statistics,status", id="xr4LCD3Gel4").execute()

Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>