YouTube-dl has a JavaScript interpreter written in 870 lines of Python

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • youtube-dl

    Command-line program to download videos from YouTube.com and other video sites

  • Yeah, it's essentially used as a javascript expression solver. You can see the full extent of its capabilities in the testsuite: https://github.com/ytdl-org/youtube-dl/blob/master/test/test...

    The specific site modules in youtube-dl will take care to extract the bare minimum necessary to solve whatever challenge.

  • PyMiniRacer

    PyMiniRacer is a V8 bridge in Python.

  • Cue libv8-node+mini_racer from which PyMiniRacer was born. It is non-trivial but not as hard as one might think.

    The most painful part is the libv8 build system and Google tooling, which makes it an absolute PITA for libv8 consumers that are not Chrome.

    This is why the libv8 gem was atrocious to keep up to date and to build for several platforms, and why libv8-node was born, because the node build system and source distribution are actually sane.

    Disclaimer: worked at Sqreen, now maintainer of libv8-node and collaborator of mini_racer

    https://github.com/sqreen/PyMiniRacer

    https://github.com/rubyjs/mini_racer

    https://github.com/rubyjs/libv8-node

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • yt-dlp

    A feature-rich command-line audio/video downloader

  • tube-get

    A tube-site downloader

  • To understand why, I have a far simpler tool that focuses on a subset of sites (adult content video aggregators)

    https://github.com/kristopolous/tube-get

    It too deals with this problem but does so in a way that'd be easy to maliciously sabotage

    Look right about here https://github.com/kristopolous/tube-get/blob/master/tube-ge...

    Add to why this exists, this was originally written between about 2010-2015 or so so it technically predates the yt-* ecosystem.

    The tool still works fine and it's not a strict subset of yt-dlp or YouTube-dl because being a different approach, although it's overall site coverage is smaller, I've had it be a "second try" system when yt-* fails and it comes up with success maybe about half the time

  • quickjs

    Thin Python wrapper of https://bellard.org/quickjs/ (by PetterS)

  • pyduktape

    Embed the Duktape JS interpreter in Python

  • dukpy

    Simple JavaScript interpreter for Python

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Duktape

    Duktape - embeddable Javascript engine with a focus on portability and compact footprint

  • I was expecting this to be about Duktape <https://github.com/svaarala/duktape>, but heh, for sure no. I'd bet $1 there's no way youtube-dl would switch, but I wonder if yt-dlp would?

  • InsideReCaptcha

    Reverse-engineering the new “captchaless” ReCaptcha system...

  • While they likely wouldn't do a zero-day, their JS files, particularly for automated captchas, do push the boundaries of whatever JS engine they're executed inside. See https://github.com/neuroradiology/InsideReCaptcha#the-analys... and note that this analysis is 8 years old. While there's minimal risk if you're either using a full-fledged modern JS engine or a limited-subset interpreter like the OP, an older or non-optimized spec-compliant JS engine might hit pathological performance cases and result in you DOSing yourself.

  • mini_racer

    Minimal embedded v8

  • Cue libv8-node+mini_racer from which PyMiniRacer was born. It is non-trivial but not as hard as one might think.

    The most painful part is the libv8 build system and Google tooling, which makes it an absolute PITA for libv8 consumers that are not Chrome.

    This is why the libv8 gem was atrocious to keep up to date and to build for several platforms, and why libv8-node was born, because the node build system and source distribution are actually sane.

    Disclaimer: worked at Sqreen, now maintainer of libv8-node and collaborator of mini_racer

    https://github.com/sqreen/PyMiniRacer

    https://github.com/rubyjs/mini_racer

    https://github.com/rubyjs/libv8-node

  • libv8-node

    Package libv8 from Node

  • Cue libv8-node+mini_racer from which PyMiniRacer was born. It is non-trivial but not as hard as one might think.

    The most painful part is the libv8 build system and Google tooling, which makes it an absolute PITA for libv8 consumers that are not Chrome.

    This is why the libv8 gem was atrocious to keep up to date and to build for several platforms, and why libv8-node was born, because the node build system and source distribution are actually sane.

    Disclaimer: worked at Sqreen, now maintainer of libv8-node and collaborator of mini_racer

    https://github.com/sqreen/PyMiniRacer

    https://github.com/rubyjs/mini_racer

    https://github.com/rubyjs/libv8-node

  • Playwright

    Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

  • By the way there is also Playwright [1] and it has Python bindings too [2].

    [1]: https://playwright.dev/

    [2]: https://playwright.dev/python/docs/intro

  • mpv

    🎥 Command line video player

  • It's unfortunate, https://github.com/mpv-player/mpv/issues/8655#issuecomment-1...:

    > Youtube now throttles requests of more than 10MB at a time, yt-dlp works around it by making many requests of 10MB using Range HTTP headers (yt-dlp calls it the http-chunk-size), but ffmpeg which does the downloading for mpv doesn't support that yet.

    I want to change mpv or yt-dlp to support range-based video URLs (eg. appending &range=333999644-335298975&rn=5&rbuf=0 to URLs) which speed up stream seeking and probably eliminate throttling altogether, but I haven't taken the time to look into how to achieve it. For anyone interested, I have an open bug report at https://github.com/mpv-player/mpv/issues/10601, and have found https://satadalsengupta.github.io/docs/papers/2017_nossdav_y... describing these parameters.

  • nitter

    Alternative Twitter front-end

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts