Skip to content

Instantly share code, notes, and snippets.

@damoun
Last active July 21, 2022 23:57
Show Gist options
  • Save damoun/5020647 to your computer and use it in GitHub Desktop.
Save damoun/5020647 to your computer and use it in GitHub Desktop.
Send notification when transmission finished to download a file.
#!/bin/bash
/var/lib/transmission-daemon/notify.py $TR_TORRENT_NAME
#!/usr/bin/python
# Install PushBullet module (https://github.com/randomchars/pushbullet.py)
#
# # pip install pushbullet.py
#
# Add path script to transmission settings.json
#
# {
# ...
# "script-torrent-done-enabled": true,
# "script-torrent-done-filename": "/var/lib/transmission-daemon/complete.sh",
# ...
# }
#
import sys
from pushbullet import PushBullet
apiKey = "secret"
p = PushBullet(apiKey)
# Get all devices
devices = p.devices()
# Send a note to all devices
[device.push_note('New download completed', sys.argv[1] + ' has been downloaded') for device in devices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment