Add some pre-existing scripts.

This commit is contained in:
Lukáš Kucharczyk
2020-07-30 15:44:20 +02:00
parent 848694ed11
commit e1434f1a1e
9 changed files with 181 additions and 0 deletions
Executable
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
from bencodepy import decode_from_file
import os
filename = 'Another - TV Series [2012] - Blu-ray MKV h264 10-bit 1080p FLAC 2.0 Softsubs (Coalgirls).50781.torrent'
folder = '/home/lukas/Torrents/'
fullpath = os.path.join(folder,filename)
print(f"Full path to file: {fullpath}.")
print(f"File exists: {os.path.lexists(fullpath)}")
torrent_pieces = decode_from_file(fullpath)[b'info'][b'files']
for torrent_piece in torrent_pieces:
print(torrent_piece[b'path'][0].decode("utf-8"))