diff --git a/README.md b/README.md index 4479767..79f1907 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,7 @@ MLLM 模型主要用于自动切片后的切片标题生成,此功能默认关 - `title` 标题模板。 - `description` 简介模板。 +- `tid` 视频分区,请参考 [bilitool tid](https://bilitool.timerring.com/tid.html) 文档。 - `gift_price_filter = 1` 表示过滤价格低于 1 元的礼物。 - `reserve_for_fixing = false` 表示如果视频出现错误,重试失败后不保留视频用于修复,推荐硬盘空间有限的用户设置 false。 - `upload_line = "auto"` 表示自动探测上传线路并上传,如果需要指定固定的线路,可以设置为 `bldsa`、`ws`、`tx`、`qn`、`bda2`。 diff --git a/bilive.toml b/bilive.toml index 1516f80..a0cbbfe 100644 --- a/bilive.toml +++ b/bilive.toml @@ -17,6 +17,7 @@ inference_model = "small" # If you choose "deploy", you should download the infe # You can change the title as you like, eg. title = "{date}直播" # Key words: {artist}, {date}, {title}, {source_link} description = "录制请征求主播同意,若未经同意就录制,所引起的任何法律问题均由该违规录制的 b 站账号承担。" # Key words: {artist}, {date}, {title}, {source_link} +tid = # The tid of the video, see https://bilitool.timerring.com/tid.html gift_price_filter = 1 # The gift whose price is less than this value will be filtered, unit: RMB reserve_for_fixing = false # If encounter MOOV crash error, delete the video or reserve for fixing upload_line = "auto" # The upload line to be used, default None is auto detect(recommended), if you want to specify, it can be "bldsa", "ws", "tx", "qn", "bda2". diff --git a/src/config.py b/src/config.py index ac8aaaa..68bd2e8 100644 --- a/src/config.py +++ b/src/config.py @@ -62,6 +62,7 @@ INFERENCE_MODEL = config.get("asr", {}).get("inference_model") TITLE = config.get("video", {}).get("title") DESC = config.get("video", {}).get("description") +TID = config.get("video", {}).get("tid") GIFT_PRICE_FILTER = config.get("video", {}).get("gift_price_filter") RESERVE_FOR_FIXING = config.get("video", {}).get("reserve_for_fixing") UPLOAD_LINE = config.get("video", {}).get("upload_line") diff --git a/src/upload/generate_upload_data.py b/src/upload/generate_upload_data.py index 80f2718..d2368fe 100644 --- a/src/upload/generate_upload_data.py +++ b/src/upload/generate_upload_data.py @@ -12,12 +12,13 @@ from src.upload.extract_video_info import ( ) import subprocess import json +from src.config import TID def generate_video_data(video_path): title = generate_title(video_path) desc = generate_desc(video_path) - tid = 138 + tid = TID tag = generate_tag(video_path) source = generate_source(video_path) cover = "" @@ -41,7 +42,7 @@ def generate_slice_data(video_path): ) parsed_output = json.loads(output) title = parsed_output["format"]["tags"]["generate"] - tid = 138 + tid = TID tag = "直播切片" return title, tid, tag except Exception as e: