forked from rDrama/rDrama
Switch youtube_dl for yt_dlp (#178)
See #3. Tested by uploading anthem to test account and playing it back. Co-authored-by: vasya <vasya34@proton.me> Reviewed-on: rDrama/rDrama#178 Co-authored-by: vasya <vasya@noreply.fsdfsd.net> Co-committed-by: vasya <vasya@noreply.fsdfsd.net>master
parent
eae7aec5f8
commit
63f9d02abc
|
@ -19,7 +19,6 @@ COPY requirements.txt /requirements.txt
|
||||||
COPY scripts/startup_docker_chat.sh /s
|
COPY scripts/startup_docker_chat.sh /s
|
||||||
|
|
||||||
RUN pip3 install -r /requirements.txt
|
RUN pip3 install -r /requirements.txt
|
||||||
RUN pip3 install youtube-dl
|
|
||||||
|
|
||||||
RUN mkdir /images
|
RUN mkdir /images
|
||||||
RUN mkdir /chat_images
|
RUN mkdir /chat_images
|
||||||
|
|
|
@ -5,7 +5,7 @@ from shutil import copyfile
|
||||||
|
|
||||||
import pyotp
|
import pyotp
|
||||||
import requests
|
import requests
|
||||||
import youtube_dl
|
import yt_dlp
|
||||||
|
|
||||||
from sqlalchemy.orm import load_only
|
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}"])
|
try: ydl.download([f"https://youtube.com/watch?v={id}"])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e, flush=True)
|
print(e, flush=True)
|
||||||
|
|
|
@ -31,3 +31,4 @@ user-agents
|
||||||
psycopg2-binary
|
psycopg2-binary
|
||||||
yattag
|
yattag
|
||||||
webptools
|
webptools
|
||||||
|
yt_dlp
|
||||||
|
|
Loading…
Reference in New Issue