Skip to content

Commit

Permalink
Tes YT Cookies with yt-dlp
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirarism committed Aug 11, 2024
1 parent 3a689eb commit b588910
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions misskaty/vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -12,6 +13,15 @@

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:
Expand Down

0 comments on commit b588910

Please sign in to comment.