本帖最后由 君临天下v 于 2020-8-10 22:58 编辑
[Python] 纯文本查看 复制代码
import requests
file1 = open("文件路径","rb") #种子文件
file2 = open("文件路径","rb") #封面图
file3 = open("文件路径","rb") #log文件
file4 = open("文件路径","rb") #频谱图
files = {
'torrent':(file1),
'cover':(file2),
'nfo':(file3),
'spectrum':(file4)
}
post_data = {
"small_descr": "这里填副标题",
"author":"艺术家",
"music_category": "专辑,这里是正整数序号,因为是下拉框",
"title":"名称",
"year": "发行年份",
"musictype":"类别,同样是整数序号",
"processing_sel": "地区,同样是整数序号",
"format":"格式,同样是整数序号",
"medium_sel": "媒介,同样是整数序号",
"origin":"转载写1,自制写2",
"descr":"这里是简介,符号同样转成字符串",
"cd_1":"填写曲目,当然可能有cd_2,cd_3,举一反三",
"tag_jz":"yes", #勾选禁转
"tag_yq":"yes", #勾选应求
"uplver":"yes" #勾选不要在发布者项目中显示我的用户名
}
response = requests.post(url, data=post_data, files=files)
print(response.text) #输出结果
用的requests库写的,当然没有加你的cookie,加上你的cookie才能代表你登录 |