V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
spiderT
V2EX  ›  问与答

在 Azure 上使用 YoutubeExplode / yt-dlp 获取 YouTube 字幕被判定为机器人,如何解决?

  •  
  •   spiderT · Apr 29 · 936 views
    我在开发一个后端服务(部署在 Microsoft Azure ),用于获取 YouTube 视频字幕。

    在本地开发环境一切正常,但部署到 Azure 后,请求经常失败,并返回类似错误:

    "Sign in to confirm you're not a bot"

    目前尝试的方案包括:
    - 使用 YoutubeExplode ( C#)
    - 使用 yt-dlp 作为 fallback

    现象如下:
    - 相同代码在本地(家庭网络 IP )可以正常获取字幕
    - 部署到 Azure Container Apps / App Service 后频繁被拦截
    - 即使降低请求频率,问题仍然存在
    - 添加 User-Agent 或 headers 也无法完全解决

    我怀疑是 Azure 的数据中心 IP 被 YouTube 判定为高风险流量。

    想请教以下问题:
    1. 这是由于 Azure IP 段被 YouTube 风控系统识别导致的吗?
    2. 在云环境中访问 YouTube ,有没有相对稳定的生产级方案?
    3. 是否必须使用 cookies (登录态)才能稳定获取字幕?
    4. 使用代理(例如 residential proxy )是否是可行方案?



    感谢帮助!
    7 replies    2026-04-30 04:26:32 +08:00
    msg7086
        1
    msg7086  
       Apr 29
    这有啥好怀疑的,谁家好人坐在数据中心里用机房 IP 看油管啊。
    pike0002
        2
    pike0002  
       Apr 29
    用代理相对比较稳定,azure 被认为是数据中心这种很容易被屏蔽,包括 digital ocean 等等
    spiderT
        3
    spiderT  
    OP
       Apr 29
    @pike0002 感谢,我去找一些代理供应商
    sillydaddy
        4
    sillydaddy  
       Apr 29
    YouTube 明显风控严格了。yt-dlp 下载都必须要登录用 cookie 了。
    sodesga
        5
    sodesga  
       Apr 29
    cobalt 早就要求油管登录才能下了,挂个代理试试。
    Biggoldfish
        6
    Biggoldfish  
       Apr 29
    这不就是机器人,被 flag 属于 WAI 吗
    spiderT
        7
    spiderT  
    OP
       Apr 30
    已解决(用了代理),感谢回复
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2320 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 01:36 · PVG 09:36 · LAX 18:36 · JFK 21:36
    ♥ Do have faith in what you're doing.