Unrar/extract files after torrent finishes (Transmission)

    • OMV 2.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Unrar/extract files after torrent finishes (Transmission)

      Hi,

      I have a setup with Couchpotato, Sonarr and Transmission. Couchpotato is able to unrar files after completion, but Sonarr doesn't have this function.
      I know there is a function in Transmission called "Script to process after torrent finishes".
      Here I should be able to select a script that does the unrar for me, but is there any script like this available and how do I install it?

      Have tried searching, found auto-unrar, but I can't understand how to install it.

      Thank you!
    • Unrar/extract files after torrent finishes (Transmission)

      Just create an sh script with one of these:

      Source Code

      1. find /path/to/downloads -name '*.rar' -execdir unrar e -o- {} \;


      Source Code

      1. unrar e -r -o- *.rar


      Then point transmission to the script to run it after download finished. In my experience though, this doesn't work 100% of the time; so I have my script just run on cron every hour.


      Asus Eee PC 1005PE
      Processor:
      Intel(R) Atom(TM) CPU N450 @ 1.66GHz
      Memory:
      1GB RAM
      Kernel:
      Linux 2.6.32-5-amd64
      Version: 2.0.7 (Stone burner)

    • hakarune wrote:

      Just create an sh script with one of these:

      Source Code

      1. find /path/to/downloads -name '*.rar' -execdir unrar e -o- {} \;


      Source Code

      1. unrar e -r -o- *.rar


      Then point transmission to the script to run it after download finished. In my experience though, this doesn't work 100% of the time; so I have my script just run on cron every hour.

      Thank you,
      But will this also handle rars that are splitted. Like .r00, .r01 etc..
    • Unrar/extract files after torrent finishes (Transmission)

      joq3 wrote:

      hakarune wrote:

      Just create an sh script with one of these:

      Source Code

      1. find /path/to/downloads -name '*.rar' -execdir unrar e -o- {} \;


      Source Code

      1. unrar e -r -o- *.rar


      Then point transmission to the script to run it after download finished. In my experience though, this doesn't work 100% of the time; so I have my script just run on cron every hour.

      Thank you,
      But will this also handle rars that are splitted. Like .r00, .r01 etc..


      Those are rar parts that have a head file that is filename.rar, it'll unrar it like normal.


      Asus Eee PC 1005PE
      Processor:
      Intel(R) Atom(TM) CPU N450 @ 1.66GHz
      Memory:
      1GB RAM
      Kernel:
      Linux 2.6.32-5-amd64
      Version: 2.0.7 (Stone burner)

    • hakarune wrote:

      joq3 wrote:

      hakarune wrote:

      Just create an sh script with one of these:

      Source Code

      1. find /path/to/downloads -name '*.rar' -execdir unrar e -o- {} \;


      Source Code

      1. unrar e -r -o- *.rar


      Then point transmission to the script to run it after download finished. In my experience though, this doesn't work 100% of the time; so I have my script just run on cron every hour.

      Thank you,
      But will this also handle rars that are splitted. Like .r00, .r01 etc..


      Those are rar parts that have a head file that is file.rar, it'll unrar it like normal.

      Great!
      Never made an sh-script, can you share yours?
    • Unrar/extract files after torrent finishes (Transmission)

      joq3 wrote:

      hakarune wrote:

      joq3 wrote:

      hakarune wrote:

      Just create an sh script with one of these:

      Source Code

      1. find /path/to/downloads -name '*.rar' -execdir unrar e -o- {} \;


      Source Code

      1. unrar e -r -o- *.rar


      Then point transmission to the script to run it after download finished. In my experience though, this doesn't work 100% of the time; so I have my script just run on cron every hour.

      Thank you,
      But will this also handle rars that are splitted. Like .r00, .r01 etc..


      Those are rar parts that have a head file that is file.rar, it'll unrar it like normal.

      Great!
      Never made an sh-script, can you share yours?


      Just paste this into a blank text file save as unrar.txt and then change the extension from .txt to .sh

      Shell-Script

      1. #!/bin/bash
      2. find /path/to/downloads -name '*.rar' -execdir unrar e -o- {} \;


      Next make it executable:

      Source Code

      1. chmod a+x unrar.sh




      Then move it to where you want and point transmission to it.


      Asus Eee PC 1005PE
      Processor:
      Intel(R) Atom(TM) CPU N450 @ 1.66GHz
      Memory:
      1GB RAM
      Kernel:
      Linux 2.6.32-5-amd64
      Version: 2.0.7 (Stone burner)

    • hakarune wrote:

      joq3 wrote:

      hakarune wrote:

      joq3 wrote:

      hakarune wrote:

      Just create an sh script with one of these:

      Source Code

      1. find /path/to/downloads -name '*.rar' -execdir unrar e -o- {} \;


      Source Code

      1. unrar e -r -o- *.rar


      Then point transmission to the script to run it after download finished. In my experience though, this doesn't work 100% of the time; so I have my script just run on cron every hour.

      Thank you,
      But will this also handle rars that are splitted. Like .r00, .r01 etc..


      Those are rar parts that have a head file that is file.rar, it'll unrar it like normal.

      Great!
      Never made an sh-script, can you share yours?


      Just paste this into a blank text file save as unrar.txt and then change the extension from .txt to .sh

      Shell-Script

      1. #!/bin/bash
      2. find /path/to/downloads -name '*.rar' -execdir unrar e -o- {} \;


      Next make it executable:

      Source Code

      1. chmod a+x unrar.sh




      Then move it to where you want and point transmission to it.

      Great! Will it be able to unrar files in different folders?
      If I point it to /path/to/downloads/media/ and there are two folders in /media, one named /.tv and one named /.mov
      Will it extract the files in these folder automatically?
    • Unrar/extract files after torrent finishes (Transmission)

      joq3 wrote:

      It does not run after Transmission completion. I can't make it run as cron either.
      But if I run it like "sh unrar.sh" it unrar's and works perfectly.

      But why can't I make it run from Transmission or Cron?
      I have permission 777 on the file, and it is executable.


      The command section needs to execute the script so "sh /path/to/script.sh" and whichever user:group is executing the function needs to have write access to the folders & files.

      Here's my cron setup:


      Asus Eee PC 1005PE
      Processor:
      Intel(R) Atom(TM) CPU N450 @ 1.66GHz
      Memory:
      1GB RAM
      Kernel:
      Linux 2.6.32-5-amd64
      Version: 2.0.7 (Stone burner)

    • Unrar/extract files after torrent finishes (Transmission)

      joq3 wrote:

      hakarune wrote:

      It will search all files and folders in the directory and unrar them

      I tried the script, it does run well from Terminal. Thank you!
      Is there any way to check if Transmission really does execute it after finishing?

      Another thing, is it possible for this sh-script to set permissions on the extracted files? I get 644 after it extracts!


      Setting permissions would be a longer script (which I can provide if you want) and with my setup, changing permissions/owner script has to be run by root or admin priv (could be my settings stopping it but don't care).

      To check if transmission is firing the script check transmission's logs or just do a dummy test dl, lots of small legit torrents out and just toss a rar in the folder so when it finishes (if it's working properly) it will unrar it.

      My unrar, renamer, and permissions/owner scripts all run on cron because I never got it to work right with transmission, but that could easily have been because of my paranoid setup lol.


      Asus Eee PC 1005PE
      Processor:
      Intel(R) Atom(TM) CPU N450 @ 1.66GHz
      Memory:
      1GB RAM
      Kernel:
      Linux 2.6.32-5-amd64
      Version: 2.0.7 (Stone burner)

    • hakarune wrote:

      joq3 wrote:

      hakarune wrote:

      It will search all files and folders in the directory and unrar them

      I tried the script, it does run well from Terminal. Thank you!
      Is there any way to check if Transmission really does execute it after finishing?

      Another thing, is it possible for this sh-script to set permissions on the extracted files? I get 644 after it extracts!


      Setting permissions would be a longer script (which I can provide if you want) and with my setup, changing permissions/owner script has to be run by root or admin priv (could be my settings stopping it but don't care).

      To check if transmission is firing the script check transmission's logs or just do a dummy test dl, lots of small legit torrents out and just toss a rar in the folder so when it finishes (if it's working properly) it will unrar it.

      My unrar, renamer, and permissions/owner scripts all run on cron because I never got it to work right with transmission, but that could easily have been because of my paranoid setup lol.


      I think I got it working with cron now, by setting the permissions to the folder.
      Do you have a script that will set the file permissions after unrar?
      I'm having trouble with Couchpotato not liking the permissions after unrar. Sonarr works fine though.

      Thank you very much!
    • I was having the same issues, but I with the help of this post, I figure most of it out.

      I have done everything in the post, but when I run I try to run the script with cron, I get an error "too many levels of symbolic links".

      I am completely new to omv and linux, so please be gentle...

      Darren
    • In the next days I'll try to strip down my script that I use. Is much more complicated since it uses categories/labels etc. I'll post it on the transmission tutorial in the guide section. Two options: extract in the same folder or to another destination folder.
      New wiki
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server
    • So I tried following the guide for transmission I got this error:

      Source Code

      1. root@NAS:/media/7c303dda-2d41-4365-89cd-c38c5ac7884c/torrents# /media/7c303dda-2d41-4365-89cd-c38c5ac7884c/torrents/unrar.sh /media/7c303dda-2d41-4365-89cd-c38c5ac7884c/torrents/Sonarr/The.Blacklist.S03E10.INTERNAL.720p.HDTV.x264-KILLERS-bash: /media/7c303dda-2d41-4365-89cd-c38c5ac7884c/torrents/unrar.sh: Permission denied


      I set the permissions for unrar.sh to 777, but no luck.

      Do I need to edit the script that is in the guide, ie add my own folder path?

      Thanks Darren