Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
606 views
in Technique[技术] by (71.8m points)

youtube api - v3 api returns blocked content even with videoEmbedable = True

I am using v3 api and videoEmbeddable="true" in my search request.

However, when I try to play the video(s) on my webpage, it says the content is blocked to be displayed on this site. Watch it on Youtube.

Is there a parameter that I can use which will not return non-embeddable videos?

*EDIT *

Video Response:

{u'items': [{u'snippet': {u'title': u'Jerez - Yamaha Preview'}, u'contentDetails': {u'definition': u'hd', u'contentRating': {u'ytRating': u'ytAllAudiences'}, u'caption': u'false', u'duration': u'PT1M21S', u'licensedContent': True, u'dimension': u'2d'}, u'status': {u'publicStatsViewable': True, u'privacyStatus': u'public', u'uploadStatus': u'processed', u'license': u'youtube', u'embeddable': True}, u'id': u'aaR72Xf_4wc'}]}

Query:

return yt_service_v3.videos().list(
  id='aaR72Xf_4wc',
  part="id,snippet,contentDetails,status",
  fields="items(id,snippet(title),contentDetails,status)",
).execute()

This video is not embeddable on my webpage and in the response there is nothing to suggest that this video is not embeddable.

I request both contentDetails and status. I am not requesting via mobile device

Please provide pointers.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

A small subset of videos have domain-level whitelists or blacklists applied to them by their content owners. Those restrictions are not reflected in API responses.

This is what you're seeing with aaR72Xf_4wc and the relevant portion of the blog post about playback restrictions is

There are even more subtle restrictions that occasionally come into play. Not all of these are currently queryable via the API. For instance, some videos are only playable on a certain set of domains.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...