server/net: use yt-dlp instead of youtube-dl

youtube-dl no longer even gets URLs properly, so switch to yt-dlp as a
drop-in replacement for it.
This commit is contained in:
Zak B. Elep 2023-08-17 20:41:50 +08:00
parent 7a82e9d581
commit c292b96f06
3 changed files with 3 additions and 3 deletions

View file

@ -29,7 +29,7 @@ RUN apk --no-cache add \
"coloredlogs==5.0" \
"pyheif==0.6.1" \
"heif-image-plugin>=0.3.2" \
youtube_dl \
yt-dlp \
"pillow-avif-plugin>=1.1.0" \
&& apk --no-cache del py3-pip

View file

@ -12,4 +12,4 @@ pyRFC3339>=1.0
pytz>=2018.3
pyyaml>=3.11
SQLAlchemy>=1.0.12, <1.4
youtube_dl
yt-dlp

View file

@ -64,7 +64,7 @@ def download(url: str, use_video_downloader: bool = False) -> bytes:
def _get_youtube_dl_content_url(url: str) -> str:
cmd = ["youtube-dl", "--format", "best", "--no-playlist"]
cmd = ["yt-dlp", "--format", "best", "--no-playlist"]
if config.config["user_agent"]:
cmd.extend(["--user-agent", config.config["user_agent"]])
cmd.extend(["--get-url", url])