From 63f9d02abc98ff5f6ee90b930852bce16a104562 Mon Sep 17 00:00:00 2001 From: vasya Date: Sat, 5 Aug 2023 01:48:47 +0000 Subject: [PATCH] Switch youtube_dl for yt_dlp (#178) See #3. Tested by uploading anthem to test account and playing it back. Co-authored-by: vasya Reviewed-on: https://fsdfsd.net/rDrama/rDrama/pulls/178 Co-authored-by: vasya Co-committed-by: vasya --- Dockerfile | 1 - files/routes/settings.py | 4 ++-- requirements.txt | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7d0f87228..e647a12f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,6 @@ COPY requirements.txt /requirements.txt COPY scripts/startup_docker_chat.sh /s RUN pip3 install -r /requirements.txt -RUN pip3 install youtube-dl RUN mkdir /images RUN mkdir /chat_images diff --git a/files/routes/settings.py b/files/routes/settings.py index fd7debf50..3d782e48e 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -5,7 +5,7 @@ from shutil import copyfile import pyotp import requests -import youtube_dl +import yt_dlp from sqlalchemy.orm import load_only @@ -824,7 +824,7 @@ def _change_song_youtube(vid, id): }], } - with youtube_dl.YoutubeDL(ydl_opts) as ydl: + with yt_dlp.YoutubeDL(ydl_opts) as ydl: try: ydl.download([f"https://youtube.com/watch?v={id}"]) except Exception as e: print(e, flush=True) diff --git a/requirements.txt b/requirements.txt index d13548686..96d797c5d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,3 +31,4 @@ user-agents psycopg2-binary yattag webptools +yt_dlp