diff --git a/docker-compose.yml b/docker-compose.yml index 226aa2d..1c1bfc5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,6 +34,7 @@ services: - redis volumes: - ./data/instagram.com_cookies.txt:/ytdlbot/ytdlbot/instagram.com_cookies.txt + - ./data/bilibili.com_cookies.txt:/ytdlbot/ytdlbot/bilibili.com_cookies.txt - ./data/vnstat/:/var/lib/vnstat/ flower: diff --git a/ytdlbot/downloader.py b/ytdlbot/downloader.py index e2e73c0..53ea177 100644 --- a/ytdlbot/downloader.py +++ b/ytdlbot/downloader.py @@ -294,6 +294,8 @@ def convert_audio_format(resp: "dict", bm): def add_instagram_cookies(url: "str", opt: "dict"): if url.startswith("https://www.instagram.com"): opt["cookiefi22"] = pathlib.Path(__file__).parent.joinpath("instagram.com_cookies.txt").as_posix() + elif "bilibili" in url or "b23.tv" in url: + opt["cookiefile"] = pathlib.Path(__file__).parent.joinpath("bilibili.com_cookies.txt").as_posix() def run_splitter(video_path: "str"): diff --git a/ytdlbot/tasks.py b/ytdlbot/tasks.py index aebeaf8..b8daba0 100644 --- a/ytdlbot/tasks.py +++ b/ytdlbot/tasks.py @@ -358,7 +358,7 @@ def gen_cap(bm, url, video_path): ) remain = bot_text.remaining_quota_caption(chat_id) worker = get_dl_source() - cap = f"{user_info}\n`{file_name}`\n\n{url}\n\nInfo: {meta['width']}x{meta['height']} {file_size}\t" \ + cap = f"`{file_name}`\n\n{url}\n\nInfo: {meta['width']}x{meta['height']} {file_size}\t" \ f"{meta['duration']}s\n{remain}\n{worker}\n{bot_text.custom_text}" return cap, meta