File size: 1,765 Bytes
d9a2e76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

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)