Post your execute plugin scripts!

Suggest, post, or discuss plugins for Deluge
mhertz
Seeder
Seeder
Posts: 177
Joined: Wed Jan 22, 2014 5:05 am

Re: Post your execute plugin scripts!

Postby mhertz » Thu Nov 17, 2016 8:14 pm

Have you specifically run the test script I posted through deluge's execute plugin? I don't mean running manually what you wrote above. It's to figure out if it's a deluge plugin bug or not?

My hunch is that it's probably just needed to do e.g.

torrentid="$1"
torrentname="$2"

In your original script.

Sorry, I can't test as am currently running qbittorrent-nox and not deluge(I go back and fourth often as can't decide fully, lol), and with that app's execute functionality I also have to play around with double-quotes in various arrangements to get it to work right with spaces in names/paths, though it's a shell-scripting issue and not app related. (I'm currently working on an execute script for that app which mimicks deluge's labelplus plugin's autolabels functionality to auto move downloaded content into different paths based on file-extensions, like *.(mkv|mp4|avi) into ~/video and music into ~/music etc. and cleanup/delete useless crap like *.(txt|nfo) etc)

romprod
New User
New User
Posts: 9
Joined: Mon Jun 29, 2015 8:56 pm

Re: Post your execute plugin scripts!

Postby romprod » Thu Jan 12, 2017 10:06 am

Hi,

Is there a way to see the output of this plugin when it launches a .bat file from windows.

It's a royal PITA trying to debug my script blind folded! :)

Thanks.

saadbruno
New User
New User
Posts: 2
Joined: Thu Feb 09, 2017 10:51 pm

Re: Post your execute plugin scripts!

Postby saadbruno » Thu Feb 09, 2017 11:06 pm

I have a few scrips now.

The first one is to download subtitles for completed torrents using Subliminal.

Code: Select all

#!/bin/bash
#Script to run subliminal on newly downloaded torrents and generate a log file.

torrentid="$1"
torrentname="$2"
torrentpath="$3"

subliminal --opensubtitles <user> <passwd> --legendastv <user> <passwd> download -w 1 -l pt-BR -a 1h -v "$torrentpath"


The second and third ones are to send a notification to my phone (using IFTTT's Maker Channel) when a torrent is added and completed. I use that because we run Deluge on a shared Raspberry Pi in the house (and I like to know when people add stuff to it).

Torrent added:

Code: Select all

#!/bin/bash
# Send IFTTT notification when torrent is added.

torrentid="$1"
torrentname="$2"
torrentpath="$3"

curl -X POST -H "Content-Type: application/json" -d '{"value1":"'"$torrentid"'","value2":"'"$torrentname"'","value3":"'"$torrentpath"'"}' https://maker.ifttt.com/trigger/deluge_add/with/key/<ifttt_key>


IFTTT Maker Channel config:
Event Name: deluge_add
Notification: Torrent Added! Name: "{{Value2}}"

Torrent completed:

Code: Select all

#!/bin/bash
# Send IFTTT notification when torrent is completed.

torrentid="$1"
torrentname="$2"
torrentpath="$3"

curl -X POST -H "Content-Type: application/json" -d '{"value1":"'"$torrentid"'","value2":"'"$torrentname"'","value3":"'"$torrentpath"'"}' https://maker.ifttt.com/trigger/deluge_complete/with/key/<ifttt_key>

IFTTT Maker Channel config:
Event Name: deluge_complete
Notification: Torrent Downloaded! Name: "{{Value2}}" Path: "{{Value3}}" At: {{OccurredAt}}

jameswhatson
New User
New User
Posts: 1
Joined: Wed May 23, 2018 9:06 am

Re: Post your execute plugin scripts!

Postby jameswhatson » Wed May 23, 2018 9:11 am

WhatsApp Messenger is the most convenient way of quickly sending messages on your mobile phone to any contact or friend on your contacts list. The only requirement is that the other people must have the app installed on their own device.

https://7downloads.com/whatsapp-apk-download

Paul.C
New User
New User
Posts: 1
Joined: Fri Mar 15, 2019 2:05 am

Re: Post your execute plugin scripts!

Postby Paul.C » Fri Mar 15, 2019 2:16 am

https://gist.github.com/paul-chambers/71ef48e40449ec73eef95430b9e4e6c7

Deluge script to link a copy of a completed torrent into a second folder
Intended to be run at torrent completion, using the 'torrent complete' event in the 'Execute' plugin.

The basic idea is to hardlink the files that deluge has just finished downloading into a second directory. This allows you to configure deluge to automatically pause or delete torrents when they reach a given seed ratio, while also keeping a copy around for other reasons. For example, SyncThing could be used to propagate new downloads to a remote machine to be processed further. When processing has finished, and the file is deleted/moved out of the Syncthing folder, the remote Syncthing will propagate a deletion back to the original Syncthing (on the machine running deluge).

The end result is that the lifetime of files involved both in deluge's seeding process and the 'forward to somewhere else' process (e.g. via Syncthing) are decoupled, and can safely execute in parallel without needing to be aware of what the other is doing. And yet the net result is that the files will still be cleaned up automagically when both have finished their respective tasks.

The script also automatically 'unrars' the download if it finds a .rar file in the second copy, while leaving the 'seeding' copy untouched.


Return to “Plugins”

Who is online

Users browsing this forum: h3llrais3r and 2 guests