Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[YouTube] Advent of player JS that needs a full-strength JS runtime #33186

@dirkf

Description

@dirkf

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2025.05.05
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones

Verbose log

... to come ...

Description

Since your webbrowser's HTML5 video player isn't good enough for YT, every video page that you open downloads a 2MB JS module. yt-dl wouldn't care about it except that accessing the video content requires some of this code to be run, in particular to resolve the signature and n-sig challenges without which the video download won't succeed. We were able to do this thanks to a minimal JS interpreter module JSInterp within yt-dl.

Currently, a new style of player JS is beginning to be sent where the challenge code is no longer modular but is hooked into other code throughout the player JS.

In the past yt-dl and yt-dlp projects have maintained the JSInterp module in the face of novel challenge features, but this doesn't seem to be practical now. Even if JSInterp could run the new player JS code you might have to wait orders of magnitude longer for your YT video.

yt-dlp is initially solving this problem in two ways:

The same solutions can be implemented in yt-dl, but for the yt-dl use-case to support watching videos on platforms that have no, or can have no, browser, deno (basically, a headless browser JS) is equally impractical. A more lightweight solution should be sought.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions