/usr/bin/btrename.bittornado is in bittornado 0.3.18-10ubuntu4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #! /usr/bin/python
# Written by Henry 'Pi' James
# see LICENSE.txt for license information
from sys import *
from os.path import *
try:
from hashlib import sha1 as sha
except ImportError:
from sha import sha
from BitTornado.bencode import *
NAME, EXT = splitext(basename(argv[0]))
VERSION = '20021119'
print '%s %s - change the suggested filename in a .torrent file' % (NAME, VERSION)
print
if len(argv) != 3:
print '%s file.torrent new.filename.ext' % argv[0]
print
exit(2) # common exit code for syntax error
metainfo_file = open(argv[1], 'rb')
metainfo = bdecode(metainfo_file.read())
metainfo_file.close()
print 'old filename: %s' % metainfo['info']['name']
metainfo['info']['name'] = argv[2]
print 'new filename: %s' % metainfo['info']['name']
metainfo_file = open(argv[1], 'wb')
metainfo_file.write(bencode(metainfo))
metainfo_file.close
print
print 'done.'
print
|