mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-06 20:04:51 +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
|
# * @date 2023-06-21 22:12:27
|
||||||
# * @projectName MissKatyPyro
|
# * @projectName MissKatyPyro
|
||||||
# * Copyright ©YasirPedia All rights reserved
|
# * Copyright ©YasirPedia All rights reserved
|
||||||
|
import requests
|
||||||
import sys
|
import sys
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from os import environ
|
from os import environ
|
||||||
|
|
@ -12,6 +13,15 @@ LOGGER = getLogger("MissKaty")
|
||||||
|
|
||||||
dotenv.load_dotenv("config.env", override=True)
|
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", ""):
|
if API_ID := environ.get("API_ID", ""):
|
||||||
API_ID = int(API_ID)
|
API_ID = int(API_ID)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue