2023-05-13 10:31:48 +00:00
|
|
|
#!/usr/bin/env nix-shell
|
2023-06-22 23:33:49 +00:00
|
|
|
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.sane-lib.bt ])" -p sane-scripts.lib.bt.propagatedBuildInputs
|
2023-06-22 07:24:08 +00:00
|
|
|
# vim: set filetype=python :
|
2023-05-13 10:31:48 +00:00
|
|
|
|
2023-06-22 07:24:08 +00:00
|
|
|
import argparse
|
2023-06-22 23:48:00 +00:00
|
|
|
import logging
|
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():
|
2023-06-22 23:48:00 +00:00
|
|
|
logging.basicConfig()
|
|
|
|
logging.getLogger().setLevel(logging.INFO)
|
|
|
|
|
2023-06-22 22:37:02 +00:00
|
|
|
parser = argparse.ArgumentParser(description="remove a torrent and trash its data")
|
2023-06-22 07:24:08 +00:00
|
|
|
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()
|
2023-06-22 22:25:13 +00:00
|
|
|
bt_api = TransmissionApi.from_arguments(args)
|
2023-06-22 07:24:08 +00:00
|
|
|
torrent = args.torrent
|
|
|
|
|
2023-06-22 22:25:13 +00:00
|
|
|
bt_api.rm_torrent(torrent)
|
2023-06-22 07:24:08 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|