如何在欧盟中使用Head请求识别YouTube短裤视频
我正在使用YouTube数据API V3来提取有关我的YouTube频道的信息。 我想确定短裤,以便我可以分开分析。 我在另一项讨论中发现了一个解决方案,该解决方案是在“ https://www.youtube.com/shorts/videoid”上发出主题,因为如果不是很短的话,它应该重定向到URL一。
不幸的是,无论我是否经过短暂的响应[302]>。 我怀疑这是因为我在欧盟中,如果我尝试访问URL而不登录的URL,我将重定向到cookie同意页面: https://consent.youtube.com/m?continue=https%3A%2F%2F%2f%2f%2FWWWWW.Youtube.com2fshorts%2F-2F-2MHZGXTXSOSO; pc = yt& uxe = eomty& hl = en& src = 1
是这样吗? 如果是这样,是否有解决方法? (除了VPN之外)
预先感谢 我会很乐意在其他讨论中发表评论,而不是创建另一个主题,但我是一个没有声誉的简单潜伏者,所以我在这里无法评论的
是原始对话:我如何从youtube API数据v3 中获得YouTube短裤
I'm using YouTube Data API V3 to extract info about my YouTube channel.
I'd like to identify Shorts so I can analyze them separately.
I've found in another discussion a solution which is to do a head request at "https://www.youtube.com/shorts/videoId" as it should redirect the URL if it's not a short and it should not if it is one.
Unfortunately, regardless of if I'm passing a Short or not I get <Response [302]>.
I suspect this is because I'm in the EU and if I try to access the URL without being logged-in I'm redirected to the cookie consent page: https://consent.youtube.com/m?continue=https%3A%2F%2Fwww.youtube.com%2Fshorts%2F-2mHZGXtXSo%3Fcbrd%3D1&gl=DE&m=0&pc=yt&uxe=eomty&hl=en&src=1
Is that the case?
If so, is there any workaround? (aside from a VPN)
Thanks in advance,
I would have gladly commented on the other discussion instead of creating another topic but I'm a simple lurker with no reputation so I can't comment
Here is the original conversation: how do i get youtube shorts from youtube api data v3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
遇到了这一点,并试图识别短裤。事实证明,发送
同意的cookie值=是+
将绕过同意屏幕。在Python中,这可能看起来像:Ran into this as well trying to identify shorts. Turns out, sending a cookie value of
CONSENT=YES+
will bypass the consent screen. In Python, this might look like: