v3 api returns blocked content even with videoEmbedable = True

前端 未结 4 808
深忆病人
深忆病人 2020-12-21 04:03

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 dis

相关标签:
4条回答
  • 2020-12-21 04:34

    I assume it wasn't there 2.5 years ago, but the current API does have indication for regional block, when requesting contentDetails. here's a response for such request for 2 videos, the first one is blocked and the second one is not. Note the regionRestriction key:

    {u'etag': u'"iDqJ1j7zKs4x3o3ZsFlBOwgWAHU/ZqEbAZJ-JFnYX3v37ZRuhK8FFN8"',
     u'items': [{u'contentDetails': {u'caption': u'false',
        u'definition': u'sd',
        u'dimension': u'2d',
        u'duration': u'PT2M5S',
        u'licensedContent': False,
        u'regionRestriction': {u'blocked': [u'NU',
          u'BY',
          u'NP',
          u'NR',
          u'WS',
          u'TD',
          u'SY',
          u'NZ',
          u'NE',
          .
          .
          .
          u'TG']}},
       u'etag': u'"iDqJ1j7zKs4x3o3ZsFlBOwgWAHU/hM4srkgNUiZj2GtAhLDFoFrHnlk"',
       u'id': u'WGf4mSBoCzQ',
       u'kind': u'youtube#video'},
      {u'contentDetails': {u'caption': u'false',
        u'definition': u'sd',
        u'dimension': u'2d',
        u'duration': u'PT17M2S',
        u'licensedContent': False},
       u'etag': u'"iDqJ1j7zKs4x3o3ZsFlBOwgWAHU/JNjXh3lMwcaC9gtbzM-KmOQLh44"',
       u'id': u'Tw75Dt8fBBs',
       u'kind': u'youtube#video'}],
     u'kind': u'youtube#videoListResponse',
     u'pageInfo': {u'resultsPerPage': 2, u'totalResults': 2}}
    
    0 讨论(0)
  • 2020-12-21 04:35

    You can also filter by syndication if you are accessing from a mobile device. Last but not the least there are region specific blockages.

    0 讨论(0)
  • 2020-12-21 04:50

    Maybe you need to also include the filter for videoSyndicated. I don't know for sure though; it's a little confusing to me.

    0 讨论(0)
  • 2020-12-21 04:59

    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.

    0 讨论(0)
提交回复
热议问题