fix: bilibili

This commit is contained in:
xtaodada 2022-11-18 19:45:47 +08:00
parent 7b5a0f7a46
commit b7350d719e
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
3 changed files with 4 additions and 1 deletions

View File

@ -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:

View File

@ -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"):

View File

@ -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