Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so dont bother with any of their useless mail servers here and just use oauth login instead. Thank the nice Russians for causing that. :)

Paste

Pasted as Bash by registered user uwe ( 14 years ago )
#!/bin/bash

if [ "$7" -ne "0" ]; then
# not successfully downloaded
    exit
fi

## Prowl
prowl_api="bla"
prowl_app="SABnzbd"
prowl_url="https://api.prowlapp.com/publicapi/add"

curl -s -o /dev/null -d "apikey=$prowl_api" -d "application=$prowl_app" -d "event=$3" -d "description=$3 downloaded [$5]" "$prowl_url"

if [ "$5" == "tv" ]; then

    ## Trakt
    trakt_user="foo"
    trakt_pass="sha1bar"
    trakt_api="keyfoo"
    trakt_url="http://api.trakt.tv/show/episode/library/$trakt_api"

    # trakt_test
    # trakt_test="http://api.trakt.tv/account/test/$trakt_api"
    # curl -d "username=$trakt_user" -d "password=$trakt_pass" $trakt_test

    title="$(echo "$3" | sed 's/ - [0-9]*x.*//')"
    season="$(echo "$3" | sed 's/^.* - \([0-9]*\)x.*/\1/')"
    episode="$(echo "$3" | sed 's/^.* - [0-9]*x\([0-9]*\) .*/\1/')"

    echo '
{
    "username": "'"$trakt_user"'",
    "password": "'"$trakt_pass"'",
    "title": "'"$title"'",
    "episodes": [
        {
            "season": '"$season"',
            "episode": '"$episode"'
        }
    ]
}' | curl -s -o /dev/null --data-binary @- "$trakt_url"
fi

 

Revise this Paste

Your Name: Code Language: