From af322dcef8194e6cc49b1eb077d2f6b2a487ce4b Mon Sep 17 00:00:00 2001 From: Benny Date: Sun, 11 Jun 2023 12:30:05 +0200 Subject: [PATCH] add config for ssyoutube --- ytdlbot/config.py | 1 + ytdlbot/downloader.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ytdlbot/config.py b/ytdlbot/config.py index d2f18020..e059e381 100644 --- a/ytdlbot/config.py +++ b/ytdlbot/config.py @@ -64,3 +64,4 @@ RATE_LIMIT = os.getenv("RATE_LIMIT", 20) DSN = os.getenv("DSN") +SS_YOUTUBE = os.getenv("SS_YOUTUBE", "https://ytdlbot.dmesg.app?token=123456") diff --git a/ytdlbot/downloader.py b/ytdlbot/downloader.py index bc0e8d9a..d34bd9d2 100644 --- a/ytdlbot/downloader.py +++ b/ytdlbot/downloader.py @@ -26,7 +26,7 @@ import yt_dlp as ytdl from tqdm import tqdm -from config import AUDIO_FORMAT, ENABLE_ARIA2, ENABLE_FFMPEG, TG_MAX_SIZE, IPv6, TOKEN +from config import AUDIO_FORMAT, ENABLE_ARIA2, ENABLE_FFMPEG, TG_MAX_SIZE, IPv6, SS_YOUTUBE from limit import Payment from utils import adjust_formats, apply_log_formatter, current_time, sizeof_fmt @@ -247,7 +247,7 @@ def convert_audio_format(video_paths: list, bm): def download_instagram(url: str, tempdir: str): if url.startswith("https://www.instagram.com"): logging.info("Requesting instagram download link for %s", url) - api = f"https://ytdlbot.dmesg.app?token={TOKEN}&url={url}" + api = SS_YOUTUBE + f"&url={url}" res = requests.get(api).json() if isinstance(res, dict): downloadable = {i["url"]: i["ext"] for i in res["url"]}