How to automatically rename files with QBittorrent

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
russco
Posts: 22
Joined: 17 Nov 2014, 17:58

How to automatically rename files with QBittorrent

Post by russco »

This works, as of today's date, and I thought I'd write this just to help anyone else who's struggling.

You don't need to have Python installed in your system.

In QBittorrent, head to Tools > Options > Downloads, and tick "Run external program on torrent completion"

Paste this code in the box:

Code: Select all

"c:\program files\filebot\filebot.exe" -script fn:amc --action duplicate --conflict skip -non-strict --log-file amc.log --def "seriesFormat=C:/media/TV/{n}/{'Season '+s}/{n} - {sxe} - {t}{'.'+lang}" "movieFormat=C:/media/Films/{n}"  unsorted=y music=y artwork=y "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L"
All you need to do is change "C:/media/TV" and "C:/media/Films" to suit your system's directories, and everything will be sorted into the right directories, and into the right seasons.

Enjoy!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to automatically rename files with QBittorrent

Post by rednoah »

:!: If --output is undefined, it'll default to the current working directory, which could be anything if called by a 3rd party tool, and it'll either be read-only breaking certain aspects of FileBot, or you'll end up moving random files into the qBT installation folder, which also isn't good.


e.g.

Code: Select all

cmd /c filebot -script fn:amc --action duplicate --conflict skip -non-strict --log-file "C:/Media/amc.log" --output "C:/Media" --def seriesFormat="{kodi}" movieFormat="{kodi}" unsorted=y music=y artwork=y "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L"

:idea: Clearly defined --output directory is recommended.

:idea: Clearly defined --log-file location is recommended.

:idea: Using Name (Year) naming and syntax is highly recommended. You will probably run into trouble later if you don't stick to the common ways of doing things.

:idea: Different users may have installed FileBot into different locations. Calling filebot via the %PATH% is recommended.
:idea: Please read the FAQ and How to Request Help.
InFerNoBeasTz
Posts: 4
Joined: 08 Aug 2021, 21:22

Re: How to automatically rename files with QBittorrent

Post by InFerNoBeasTz »

Thank you. How do I change this to Anidb rename format?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to automatically rename files with QBittorrent

Post by rednoah »

InFerNoBeasTz wrote: 08 Aug 2021, 21:44 Thank you. How do I change this to Anidb rename format?
If you're using the amc script then please read the Change how files will be organized and renamed section in the manual for details and examples.
:idea: Please read the FAQ and How to Request Help.
aether
Posts: 1
Joined: 20 Feb 2024, 16:38

Re: How to automatically rename files with QBittorrent

Post by aether »

Sorry to necro an old thread, but will this preserve the torrent files to seed, or will qbitorrent be unable to view them once they've been renamed?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to automatically rename files with QBittorrent

Post by rednoah »

aether wrote: 20 Feb 2024, 16:40 Sorry to necro an old thread, but will this preserve the torrent files to seed, or will qbitorrent be unable to view them once they've been renamed?
FileBot itself does not communicate with qBT in any way whatsoever. If files are moved, then qBT will no longer find them.

You'll what to use --action hardlink to keep the file both at the original file path for seeding and at the new file path for library. See Hardlinks - Atomic Moves - TRaSH Guides for details.
:idea: Please read the FAQ and How to Request Help.
Post Reply