Spaces:
Sleeping
Sleeping
import json | |
import requests | |
#->void | |
def task_submit_to_space(baseUrl:str,task_list:list,bili_meta:dict,allow_submit:bool,fake_headers:dict=None): | |
# 创建一个Session对象 | |
session = requests.Session() | |
if fake_headers is not None: | |
session.headers = fake_headers | |
file_list = task_list | |
allow_submit = allow_submit | |
url = baseUrl+'/execute_all_task' | |
bili_meta_data = bili_meta | |
# 构造请求参数 | |
params = { | |
'file_list': file_list, | |
'allow_submit': allow_submit, | |
'bili_meta_data':json.dumps(bili_meta_data) | |
} | |
# 发起GET请求 | |
response = session.get(url, params=params) | |
print(response.text) | |
if __name__ == '__main__': | |
bili_meta_data = { | |
"act_reserve_create": 0, | |
"copyright": 1,#2是转载 | |
"source": "", | |
"desc": '點精心设计乳猪份巷' , | |
"desc_format_id": 0, | |
"dynamic": "", | |
"interactive": 0, | |
"no_reprint": 1, | |
"open_elec": 0, | |
"origin_state": 0, | |
"subtitles": { | |
"lan": "", | |
"open": 0 | |
}, | |
"tag": "动漫解说,漫画, 标动画,动漫杂谈,恋爱,吐槽,漫画推荐", | |
"tid": 210, | |
"title": '鬼畜英雄13', | |
"up_close_danmaku": False, | |
"up_close_reply": False, | |
"up_selection_reply": False, | |
"dtime": 0 | |
} | |
task_submit_to_space(baseUrl='https://rogerxavier-moviepy-with-manga-test.hf.space', | |
task_list=["0filterImage","1removeMask", "2magiDialogCut", "3mergeDialogToVideo"] | |
,bili_meta= bili_meta_data | |
,allow_submit=True) | |