What's new

Entware transmission auto unrar torrent

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

vprasinos

Occasional Visitor
I'm trying to setup a script to settings.json to auto unrar a torrent if there is a rar file inside (or .rar, .r00, .r01 etc)

I'm trying to avoid torrentexpander.sh as it creates a lot of unnecessary folders, all I want is to unrar a single file (as it usually is contained inside a tv series torrent) without touching any other files within the rar (.nfos etc).

I've installed unrar in entware using:
#opkg install unrar

So far I've managed to unrar from ssh prompt using the command:
#unrar e torrentfile path/to/extraction/

If I try to implement this in settings.json:
"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/opt/bin/unrar e '$TR_TORRENT_DIR/$TR_TORRENT_NAME/*.rar' '/tmp/mnt/SamsungHD/torrents/'",

However nothing happens after a rared torrent is downloaded. Am I using this the wrong way? Is there a typo?

Note: I get confirmation through the log that the script is actually executed, but I get no rar file to the specified folder.
 
You should create a script in /jffs/scripts/torrent-unrar.sh with your unrar command:
Code:
#!/bin/sh
/opt/bin/unrar e '$TR_TORRENT_DIR/$TR_TORRENT_NAME/*.rar' '/tmp/mnt/SamsungHD/torrents/'

logger -t "$0" "Unrar \""$TR_TORRENT_NAME\""", completed...
Code:
chmod a+rx /jffs/scripts/torrent-unrar.sh

In settings.json:
Code:
"script-torrent-done-enabled": true, 
"script-torrent-done-filename": /jffs/scripts/torrent-unrar.sh

Now download a torrent and see if is extracted, look in syslog for a line with "Unrar "" completed...
 
Is this line supposed to be
"script-torrent-done-filename": "/jffs/scripts/torrent-unrar.sh",

Some how didn't work for me syslog report unrar completed but can't locate file?
 
Last edited:
@TeHashX
I have follow your guide but no achieved file in download directory?
Please advise thank you

Code:
torrent-unrar.sh
#!/bin/sh
/opt/bin/unrar e '$TR_TORRENT_DIR/$TR_TORRENT_NAME/*.rar' '/tmp/mnt/sda1/download/'

logger -t "$0" "Unrar \""$TR_TORRENT_NAME\""", completed...
Code:
"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/jffs/scripts/torrent-unrar.sh",

Code:
Jul 12 03:31:51 transmission-daemon[21417]: The.Catch.US.S01E01.720p.HDTV.X264-DIMENSION Complete (torrent.c:2224)
Jul 12 03:31:51 transmission-daemon[21417]: The.Catch.US.S01E01.720p.HDTV.X264-DIMENSION Calling script "/jffs/scripts/torrent-unrar.sh" (torrent.c:890)
Jul 12 10:31:52 /jffs/scripts/torrent-unrar.sh: Unrar "The.Catch.US.S01E01.720p.HDTV.X264-DIMENSION", completed...
 
Hi and Happy New Year!

Please, what should be the solution for having 2 scripts simultaneous at the script-torrent-done-filename?
I want to have at the same time a script for sending email when a torrent in finished and also another one to unrar.

Thank you!
 
@TeHashX
I have follow your guide but no achieved file in download directory?
Please advise thank you

Code:
torrent-unrar.sh
#!/bin/sh
/opt/bin/unrar e '$TR_TORRENT_DIR/$TR_TORRENT_NAME/*.rar' '/tmp/mnt/sda1/download/'

logger -t "$0" "Unrar \""$TR_TORRENT_NAME\""", completed...
Code:
"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/jffs/scripts/torrent-unrar.sh",

Code:
Jul 12 03:31:51 transmission-daemon[21417]: The.Catch.US.S01E01.720p.HDTV.X264-DIMENSION Complete (torrent.c:2224)
Jul 12 03:31:51 transmission-daemon[21417]: The.Catch.US.S01E01.720p.HDTV.X264-DIMENSION Calling script "/jffs/scripts/torrent-unrar.sh" (torrent.c:890)
Jul 12 10:31:52 /jffs/scripts/torrent-unrar.sh: Unrar "The.Catch.US.S01E01.720p.HDTV.X264-DIMENSION", completed...
Hi,

I think I discovered why. Because you have to add double quotation mark. And you have two scenarios: torrent is a rar file or torrent is couple of rar files. So you have two unrar like this:
Code:
/opt/bin/unrar e "$TR_TORRENT_DIR/$TR_TORRENT_NAME/*.rar" '/tmp/mnt/torrent/torrent-unrar'
logger -t "$0" "Unrar \""$TR_TORRENT_NAME\""", completed...

/opt/bin/unrar e "$TR_TORRENT_DIR/$TR_TORRENT_NAME" '/tmp/mnt/torrent/torrent-unrar'
logger -t "$0" "Unrar \""$TR_TORRENT_NAME\""", completed...
In order to work you have to avoid spaces in the destination or to use "" here also.
Hope it helps.
amplatfus
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top