2023-05-13 10:31:48 +00:00
|
|
|
#!/usr/bin/env nix-shell
|
2023-06-22 09:53:30 +00:00
|
|
|
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.sane-lib.bt ])" -p transmission
|
2023-06-22 07:24:08 +00:00
|
|
|
# vim: set filetype=python :
|
2023-05-13 10:31:48 +00:00
|
|
|
|
|
|
|
# removes a torrent and trashes its data
|
|
|
|
|
2023-06-22 07:24:08 +00:00
|
|
|
import argparse
|
2023-05-13 10:31:48 +00:00
|
|
|
|
2023-06-22 09:53:30 +00:00
|
|
|
from sane_bt import TransmissionApi
|
2023-06-22 07:24:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
TransmissionApi.add_arguments(parser)
|
|
|
|
parser.add_argument("torrent", help="numerical ID of the torrent in the transmission list (see sane-bt-show)")
|
|
|
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
executor = TransmissionApi.from_arguments(args)
|
|
|
|
torrent = args.torrent
|
|
|
|
|
|
|
|
executor.rm_torrent(torrent)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|