mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 09:44:50 +00:00
Tes YT Cookies with yt-dlp
This commit is contained in:
parent
3a689eb363
commit
b588910150
1 changed files with 10 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue