Add auth to ytdlp

This commit is contained in:
2025-04-09 18:55:52 +02:00
parent fdccde6137
commit 0e860fe6a9
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -120,6 +120,9 @@ SPOTIFY_CTRL = spotipy.Spotify(
client_secret=authTokens[2],
)
)
REMOTE_HOST_NAME = "youtube"
authTokens = netrc_mod.authenticators(REMOTE_HOST_NAME)
YOUTUBE_AUTH = [authTokens[0],authTokens[2]]
WORD_REACTIONS = DATA["word_reactions"]
CYCLIC_WORDS = DATA["cyclic_words"]
+4
View File
@@ -16,6 +16,7 @@ from constants import (
MUSIC_FOLDER,
SEND_MP3,
SPOTIFY_CTRL,
YOUTUBE_AUTH,
)
from spotify_dl import spotify
from spotify_dl import youtube as youtube_download
@@ -161,6 +162,7 @@ async def get_file(ctx, source, link):
file_name_f=file_name_f,
multi_core=0,
proxy="",
YT_AUTH = YOUTUBE_AUTH
)
_ = await coro
logger.info("YT-DL done")
@@ -203,6 +205,8 @@ async def get_file(ctx, source, link):
else:
dir_path = "/home/pi/RetroPie/mp3/Youtube"
ydl_opts = {
"username": YOUTUBE_AUTH[0],
"password": YOUTUBE_AUTH[1],
"proxy": "",
"default_search": "ytsearch",
"format": "bestaudio/best",