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

YouTube captions API returns inaccurate data

$
0
0

I'm using the YouTube V3 API to check if a video has any captions. The example video I'm using in this case is ID TM3sNH7c5B4.

My request looks like this:

def get_youtube_caption_info(client, video_id):    caption_request = client.captions().list(            part='snippet,id',            videoId=video_id,        )    caption_response = caption_request.execute()    return bool(caption_response.get('items'))

The client is configured as such:

client = googleapiclient.discovery.build('youtube', 'v3', developerKey="XXXXXXXXXXXXXX")

It keeps returning True for this video even though the YouTube video player does not show any options for captions:

youtube settings screenshot

I added a debugger and this is what the caption_response object looks like:

{'etag': 'NdGxn_2Z1vhRrxgcbKpxtLQFSRs','items': [{'etag': 'tOfKO2jRztEqtGHfb_d6vQK_iKU','id': 'Gu_N5R6RDRgeXbUUjChlxQGFyZrSXyjtBetX-fj5KDE=','kind': 'youtube#caption','snippet': {'audioTrackType': 'unknown','isAutoSynced': False,'isCC': False,'isDraft': False,'isEasyReader': False,'isLarge': False,'language': 'en','lastUpdated': '2020-10-06T10:28:19.545342Z','name': '','status': 'serving','trackKind': 'asr','videoId': 'TM3sNH7c5B4'}}],'kind': 'youtube#captionListResponse'}

It looks like the video player should be showing an option for auto-captions but there's nothing there. Is this a bug on the YouTube side or am I missing something?


Viewing all articles
Browse latest Browse all 3831

Trending Articles



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