【问题标题】:Youtube data API to check whether video ID is a shortYoutube data API to check whether video ID is a short
【发布时间】:2022-12-28 07:24:00
【问题描述】:

It seems the youtube data api is missing the functionality to check whether a video id is a short. Another way to check whether it is a short is by checking the response code of the following public url: https://www.youtube.com/shorts/:videoId (303 = regular video, 200 = short), but this could easily result in ratelimits and if used on a worker node like cloudflare workers, google will flag the request as suspicious.

Is there another way to check whether a video is a short?

【问题讨论】:

  • Check this answer - video samples: k4Tgwk0H9q0, ouf0ozwnU84
  • @MarcoAurelioFernandezReyes Thanks for the reply! I did stumble upon that post, and looked at the code of their workaround, which is unfortunately the same as checking the URL I listed above
  • In that case, I suggest you to post a ticket on Issue Tracker
  • I went and added an issue to request official API support for this BTW.

标签: youtube-api


【解决方案1】:

I was also looking for answers to this question and stumbled upon this post. Another workaround for the lack of direct API functionality would be to use duration from 'contentDetails.duration.' As of this comment, shorts are limited to 60 seconds and, if they are in the right format, they'll be converted to shorts automatically. Not pretty, but it should get the job done since the likelihood of someone uploading a video in the wrong format at that duration is pretty low.

【讨论】:

    猜你喜欢
    • 2018-01-12
    • 2022-12-02
    • 1970-01-01
    • 2021-05-05
    • 2022-12-16
    • 2017-05-01
    • 1970-01-01
    • 2022-12-19
    • 2022-12-02
    相关资源
    最近更新 更多