发布时间:2019-09-24 08:27:17编辑:auto阅读(3109)
pytorrent是一个非常小巧的用来解析解析torrent文件python库。核心代码不足150行,却能够完备地解析torrent文件,并支持导出修改后的torrent文件。
使用演示:
import pytorrent
t=pytorrent.Torrent()
t.load("test.torrent") #your torrent file
print t.data["info"]["name"].decode("utf-8")
files=t.data["info"]["files"]
for item in files:
print item["path"][0].decode("utf-8")
t.data["info"]["name"]="my_name" #change info.
t.dump("dump.torrent") #the new torrent file
上一篇: python布尔值取反
下一篇: python计算分位数
50955
50337
40954
37819
32285
29175
28062
22893
22855
21187
1040°
1724°
1406°
1341°
1601°
1435°
2090°
3632°
3550°
2506°