Tes YT Cookies with yt-dlp

This commit is contained in:
Yasir Aris M 2024-08-11 20:18:28 +07:00 committed by GitHub
parent 3a689eb363
commit b588910150
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,6 +2,7 @@
# * @date 2023-06-21 22:12:27
# * @projectName MissKatyPyro
# * Copyright ©YasirPedia All rights reserved
import requests
import sys
from logging import getLogger
from os import environ
@ -12,6 +13,15 @@ LOGGER = getLogger("MissKaty")
dotenv.load_dotenv("config.env", override=True)
if YT_COOKIES := environ.get("YT_COOKIES"):
response = requests.get(YT_COOKIES)
if response.status_code == 200:
with open('cookies.txt', 'w') as file:
file.write(response.text)
LOGGER.info("Success download YT Cookies")
else:
LOGGER.info("Failed download YT Cookies")
if API_ID := environ.get("API_ID", ""):
API_ID = int(API_ID)
else: