Qbittorrent Mac + Plex + Run External Program on Torrent Completion + Auto Unrar

MAC OS X specific questions, problems.
Post Reply
ekf

Qbittorrent Mac + Plex + Run External Program on Torrent Completion + Auto Unrar

Post by ekf »

I am so pleased with my current setup of Qbittorrent + Plex + rss subscriptions, but the missing link was having to manually unrar my rar'ed downloads. 

The problem was that every solution I found out there "assumed" some kind of external coding or terminal knowledge.  No step-by-step help for the newbie.I've finally made it work with the help of 3 combined sources (cited below), and over 2 hours of coding for dummies that hurt my brain + cursing.

Obviously, replace (yourusername) with your actual username

1) Install auto unrar for Mac, follow step 1&2 on this page (it just shows you where to copy the files): https://applehint.com/t/handle-rar-and-unrar-through-command-lines-terminal-in-mac-os-x-without-archiver-softwares/91

2)create the bash script  (this was the part i had to figure out on my own and took 2 hours to comprehend)
-open terminal
-Type the code for each of the following steps into Terminal:
To go to home directory::

Code: Select all

cd ~
To create bin directory:

Code: Select all

mkdir bin
Create file called "unrar"

Code: Select all

touch unrar
Now find the file  "unrar" in the finder (/(yourusername)/bin/) and open in textedit or any text editor and type:

Code: Select all

#!/bin/bash
t_path="$1"
cd "$t_path"
/usr/local/bin/unrar x *.rar
Save the file and close.

Now, make file "unrar" executable. 
In terminal, type:

Code: Select all

chmod u+x unrar
you will notice that the generic file icon will turn into a unix/terminal looking icon

3)enter location of "unrar" bash script into Qbitorrent:
-navigate to Qbittorent>preferences>downloads
-"check" Run external program on torrent completion
-enter: /Users/(yourusername)/bin/unrar "%F"

The next time you download a torrent with rar files, it should automatically unrar and place the uncompressed file in the same folder as the original torrent.  This extra file has no impact on seeding, but if anyone knows how to change the instructions to unrar to a different location, please let me know!  I was also previously using the app "rar expander", but I didn't bother trying to figure out how to make it work with this setup.

Now I don't have to monitor qbittorrent for downloaded rar's they just appear in Plex!  :D






This is what works.  I can't explain how, it just does.  I created this step-by-step to save a fellow Mac user some time. For deeper explanation of why these things work, see original sources:

https://qbforums.shiki.hu/http://f.qbit ... p?t=8  https://qbforums.shiki.hu/index.php?action=profile;u=171402 is to thank for most of this, but assumed too much terminal knowledge.
https://www.taniarascia.com/how-to-crea ... ipts/ 
http://appledigg.com/t/handle-rar-and-u ... ftwares/91
Last edited by ekf on Tue Aug 20, 2019 5:32 pm, edited 1 time in total.
Post Reply