Pythonlibtorrent提取种⼦⽂件中的信息
如:
ﻀ
ﻞBlood and Ties 2013 1080p BluRay x264 DTS HD MA 5.1-alrmothe.mkv$||$16264604081@||@cover.jpg$||$49333@||@nfo.nfo$||$3553@||@ﻷﻓﺟﻮدة.txt$||$448@||@For $||$359
⽤的时候⽤ @||@ $||$ 分割⼀下就可以了
import libtorrent as lt
import os
文件名提取
info = lt.torrent_info('t')
info_hash = info.info_hash()
name = info.name()
total_size = al_size()
creation_date = ation_date()
num_files = info.num_files()
files = info.files()
items = dict([(file.size,file.path) for file in files]).items()
items.sort(reverse=True)
files = os.path.split(items[0][1])[-1]+"$||$"+str(items[0][0])
for i in items[1:5]:
files = files+"@||@"+os.path.split(i[1])[-1]+"$||$"+str(i[0])
print info_hash, name, total_size, creation_date.date(), num_files ,file
输出:
f2143efa661c547126665877e1a071ca6932e945 Blood and Ties 2013 1080p BluRay x264 DTS HD MA 5.1-alrmothe 16264658397 None 21 Blood and
ﻞ
Ties 2013 1080p BluRay x264 DTS HD MA 5.1-alrmothe.mkv$||$16264604081@||@cover.jpg$||$49333@||@nfo.nfo$||$3553@||@ﻷﻓ
ﻀﺟﻮدة.txt$||$448@||@For $||$359
发布评论