Sorting qBittorrent Queue with Tampermonkey

Sorting qBittorrent Queue with Tampermonkey
qBittorrent Web UI

Managing a media server like Plex on unRAID with tools like Radarr, Sonarr, Lidarr, and Readarr has been a game changer for automating media acquisition. But with automation comes the challenge of handling multiple simultaneous downloads in qBittorrent, especially when the individual downloads range from just a few MB to over 100GB.

Affiliate Disclosure: This post contains affiliate links. If you click and sign up or make a purchase, I may earn a commission, at no extra cost to you. Thank you for your support!

For me, prioritizing smaller downloads has always been important. Here’s why:

  • My unRAID setup is optimized to use a fast NVMe cache, specifically 2x Samsung 990 PRO NVMe M.2 SSDs in RAID 1. This allows faster downloads, but I need the download to complete while still on cache to ensure file verification is almost instant.
  • Sometimes I’m waiting on a small single or album, and I don’t want to wait hours for massive downloads to finish first.

While those with faster internet and drive setups might not notice, my 100 MBit connection often isn’t solely available to qBittorrent, meaning large downloads can slow the queue. Manually sorting downloads by size in qBittorrent was tedious until I discovered the "Set qBittorrent Queue Order" userscript for the Tampermonkey extension on Chrome-based browsers.

Here’s how I optimized my download process:

  1. Install the Tampermonkey extension.
  2. Add the "Set qBittorrent Queue Order" script from Greasyfork.
  3. Update the // @match http://localhost:8080/ line in the userscript to match my qBittorrent installtion.
  4. Disable my custom qBittorrent UI, VueTorrent, and refresh the qBittorrent Web UI.

The script adds an easy-to-spot orange button to the UI.

Tempermonkey "Set qBittorrent Queue order" Userscript Button
Tampermonkey "Set qBittorrent Queue order" Userscript Button

I can sort downloads by size by clicking the "Remaining" column, prioritizing the smallest files. Then, I just hit the "Set Queue Order" button, and the script takes over.

For added flexibility, I use the Extensity extension to quickly enable/disable Tampermonkey when needed.

While not groundbreaking, this script has significantly streamlined managing my qBittorrent downloads, helping me clear my queue faster and enjoy content without unnecessary delays.

If you’ve found this content helpful and would like to support the blog, consider donating by clicking here. Your support is greatly appreciated!

Read more