Author Topic: Qbittorrent Mac + Plex + Run External Program on Torrent Completion + Auto Unrar  (Read 106 times)

ekf

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
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]
cd ~To create bin directory:
Code: [Select]
mkdir binCreate file called "unrar"
Code: [Select]
touch unrar
Now find the file  "unrar" in the finder (/(yourusername)/bin/) and open in textedit or any text editor and type:
Code: [Select]
#!/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]
chmod u+x unraryou 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/index.php?topic=4568.0  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-create-and-use-bash-scripts/ 
http://appledigg.com/t/handle-rar-and-unrar-through-command-lines-terminal-in-mac-os-x-without-archiver-softwares/91
« Last Edit: August 20, 2019, 07:32:31 pm by ekf »