Skip to content

Commit d9a3890

Browse files
authored
fix: resolve list error (#173)
fix #172
1 parent 5e5efe7 commit d9a3890

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,12 @@ pip install -r requirements.txt
137137
138138
在配置文件 `src/config.py` 中,`SLICE_DURATION` 以秒为单位设置切片时长(不建议超过 1 分钟),在项目的自动切片功能需要使用到智谱的 [`GLM-4V-PLUS`](https://bigmodel.cn/dev/api/normal-model/glm-4) 模型,请自行[注册账号](https://www.bigmodel.cn/invite?icode=shBtZUfNE6FfdMH1R6NybGczbXFgPRGIalpycrEwJ28%3D)并申请 API Key,填写到 `src/config.py` 文件中对应的 `Your_API_KEY` 中。
139139

140-
#### 4. biliup-rs 登录
140+
#### 4. biliup & bilitool 登录
141141

142142
首先按照 [biliup-rs](https://github.com/biliup/biliup-rs) 登录b站,登录脚本在 `src/upload/biliup` ,登录产生的`cookies.json`保留在该文件夹下即可。
143143

144+
然后同样通过 `bilitool login` 扫码登录(biliup 的 list 对应 api 已经失效,因此我写了 [bilitool](https://github.com/timerring/bilitool) 工具作为替换)。
145+
144146
[常见问题收集](https://timerring.github.io/bilive/biliup.html)
145147

146148
#### 5. 启动自动录制

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ tiktoken==0.4.0
1111
torch==1.11.0
1212
triton==3.1.0
1313
zhconv==1.4.3
14+
bilitool
1415
zhipuai

src/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# ============================ Your configuration ============================
99
GPU_EXIST=False
1010
# Can be pipeline, append, merge
11-
MODEL_TYPE = "pipeline"
11+
MODEL_TYPE = "append"
1212
Inference_Model = "small"
1313
# ============================ The video slice configuration ==================
1414
AUTO_SLICE = False

src/upload/upload.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ def upload_video(upload_path, yaml_file_path):
6161
def find_bv_number(target_str, my_list):
6262
for element in my_list:
6363
if target_str in element:
64-
parts = element.split('\t')
64+
parts = element.split('|')
6565
if len(parts) > 0:
66-
return parts[0]
66+
return parts[1].strip()
6767
return None
6868

6969
def read_append_and_delete_lines(file_path):
@@ -97,10 +97,10 @@ def read_append_and_delete_lines(file_path):
9797
return
9898
else:
9999
query = generate_title(upload_video_path)
100-
result = subprocess.check_output(f"{SRC_DIR}/upload/biliup" + " -u " + f"{SRC_DIR}/upload/cookies.json" + " list", shell=True)
100+
result = subprocess.check_output("bilitool" + " list", shell=True)
101+
# print(result.decode("utf-8"), flush=True)
101102
upload_list = result.decode("utf-8").splitlines()
102-
limit_list = upload_list[:30]
103-
bv_result = find_bv_number(query, limit_list)
103+
bv_result = find_bv_number(query, upload_list)
104104
if bv_result:
105105
print(f"BV number is: {bv_result}", flush=True)
106106
append_upload(upload_video_path, bv_result)

0 commit comments

Comments
 (0)