Skip to content

Commit

Permalink
feat: 支持弹幕下载
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoaer committed Dec 5, 2023
1 parent de6eaeb commit 1686c1a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 11 additions & 13 deletions processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from asyncio import Semaphore, create_subprocess_exec
from asyncio.subprocess import DEVNULL

from bilibili_api import favorite_list, video
from bilibili_api import ass, favorite_list, video
from bilibili_api.exceptions import ResponseCodeException
from loguru import logger
from tortoise import Tortoise
Expand Down Expand Up @@ -236,18 +236,16 @@ async def process_favorite_item(
fav_item.name,
)
if process_subtitle:
pass
# # 写入字幕,上游库获取字幕有 bug,暂时不做实现
# if not await aexists(fav_item.subtitle_path):
# await ass.make_ass_file_danmakus_protobuf(
# v, 0, str(fav_item.subtitle_path.resolve())
# )
# else:
# logger.info(
# "Subtitle of {} {} already exists, skipped.",
# fav_item.bvid,
# fav_item.name,
# )
if not await aexists(fav_item.subtitle_path):
await ass.make_ass_file_danmakus_protobuf(
v, 0, str(fav_item.subtitle_path.resolve())
)
else:
logger.info(
"Subtitle of {} {} already exists, skipped.",
fav_item.bvid,
fav_item.name,
)
if process_video:
if await aexists(fav_item.video_path):
fav_item.downloaded = True
Expand Down

0 comments on commit 1686c1a

Please sign in to comment.