Renaming the default folder of a torrent while adding

Discussion of Transmission that doesn't fit in the other categories
Post Reply
someuser
Posts: 2
Joined: Sat Feb 08, 2020 3:21 pm

Renaming the default folder of a torrent while adding

Post by someuser »

I'm using this client for Windows to control transmission running on my raspberry pi: https://github.com/transmission-remote-gui

However, I don't add my torrents through this client. I have written a python script which automatically add torrents I save in a particular folder on my shared drive. The python script calls the transmission-remote command line with -a argument to add torrents.

While adding torrents from the GUI client, there is an option called save as. This renames the default folder of the torrent. So if the torrent's files are stored in a folder, this option will change the name to whatever I want. I want to use this functionality in my python script. But I'm not able to find the options for this.

Basically what I want to do is, if the torrent has a TV show with files structured like this:
tv.show.name.s01/s01e01.mkv
tv.show.name.s01/s01e02.mkv

I want to save it in the folder like this:
tv.show.name/season01/s01e01.mkv
tv.show.name/season01/s01e02.mkv

However, currently if I specify the path using the -w argument as base_path/tv.show.name/season01, then the files get saved in base_path/tv.show.name/season01/tv.show.name.s01/s01e01.mkv

The original folder name is still used after the path specified by me using the -w argument.

How to achieve this using command line arguments?
killemov
Posts: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Renaming the default folder of a torrent while adding

Post by killemov »

someuser wrote: Sat Feb 08, 2020 3:42 pm I'm using this client for Windows to control transmission running on my raspberry pi: https://github.com/transmission-remote-gui

However, I don't add my torrents through this client. I have written a python script which automatically add torrents I save in a particular folder on my shared drive. The python script calls the transmission-remote command line with -a argument to add torrents.

While adding torrents from the GUI client, there is an option called save as. This renames the default folder of the torrent. So if the torrent's files are stored in a folder, this option will change the name to whatever I want. I want to use this functionality in my python script. But I'm not able to find the options for this.

Basically what I want to do is, if the torrent has a TV show with files structured like this:
tv.show.name.s01/s01e01.mkv
tv.show.name.s01/s01e02.mkv

I want to save it in the folder like this:
tv.show.name/season01/s01e01.mkv
tv.show.name/season01/s01e02.mkv

However, currently if I specify the path using the -w argument as base_path/tv.show.name/season01, then the files get saved in base_path/tv.show.name/season01/tv.show.name.s01/s01e01.mkv

The original folder name is still used after the path specified by me using the -w argument.

How to achieve this using command line arguments?
There are two paths involved:
  • The download path that is either configured in Transmission or entered at download.
  • The folder path that is part of the torrent structure.
Changing the download path is usually safe, it does not have to be unique. Changing the path within the torrent structure comes with risk. In your case the show name is the download path and the season folder is part of the torrent structure. So if you have the first season of 10 TV shows they would all show as season01. Meaning there is no visual way to differentiate. There is a python based program called SickChill that helps you manage TV shows.
someuser
Posts: 2
Joined: Sat Feb 08, 2020 3:21 pm

Re: Renaming the default folder of a torrent while adding

Post by someuser »

Thanks Killemov. I eventually switched to using the RPC interface through the python requests library. The rename option is available there, even though it happens only after adding and not at the time of adding the torrent. I was able to use that and achieve my objective.
telldunkin
Posts: 1
Joined: Fri Jul 24, 2020 1:09 pm

Re: Renaming the default folder of a torrent while adding

Post by telldunkin »

You can copy all files and folders to a new destination and rename them.
Post Reply