#!/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"))