From 4060cb672f4a7d83f04f773b74a7823fd6b3b86b Mon Sep 17 00:00:00 2001 From: "Ethan J. Hadley" Date: Sat, 19 Sep 2026 21:48:51 -0600 Subject: [PATCH] Added Deno --- happy_ripper.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/happy_ripper.py b/happy_ripper.py index dbbcbd3..b7dc96c 100644 --- a/happy_ripper.py +++ b/happy_ripper.py @@ -19,9 +19,12 @@ from mutagen.id3 import ID3, APIC from flask import Flask, render_template, request, jsonify from ytmusicapi import YTMusic -MUSIC_FOLDER = os.environ.get("HAPPY_RIPPER_MUSIC_DIR", "Music") -ACCESS_URL = os.environ.get("HAPPY_RIPPER_ACCESS_URL", "https://test.test.test") +MUSIC_FOLDER: str = os.environ.get("HAPPY_RIPPER_MUSIC_DIR", "Music") +ACCESS_URL: str = os.environ.get("HAPPY_RIPPER_ACCESS_URL", "https://test.test.test") PORT = int(os.environ.get("HAPPY_RIPPER_MUSIC_PORT", 5000)) +DENO_PATH: str = os.environ.get("HAPPY_RIPPER_DENO_PATH", str(pathlib.Path.home() / ".deno/bin/deno")) + +JS_RUNTIME_KEYS = {"deno": {"path": DENO_PATH}} @dataclass @@ -101,7 +104,7 @@ def create_or_wipe_folder(path: str) -> None: def get_content_json(url: str): - with YoutubeDL({"playlist_items": "1"}) as ydl: + with YoutubeDL({"js_runtimes": JS_RUNTIME_KEYS, "playlist_items": "1"}) as ydl: return ydl.extract_info(url, download=False) @@ -109,6 +112,7 @@ def download_content(path: str, url: str, post_processor: PostProcessor) -> None try: with YoutubeDL( { + "js_runtimes": JS_RUNTIME_KEYS, "format": "bestaudio/best", "ignoreerrors": True, "restrictfilenames": True,