summaryrefslogtreecommitdiffstats
path: root/lass/5pkgs/dls/default.nix
blob: 36cdb620b0fcc9a410f287b576be7120678053d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{ pkgs }:
pkgs.writers.writeDashBin "dls" ''
  set -efux
  SESSION_ID=$(
    curl -Ss -d '{}' http://yellow.r:9091/transmission/rpc -v -o /dev/null 2>&1 |
      grep -oP '(?<=X-Transmission-Session-Id: )\w+'
  )
  ${pkgs.curl}/bin/curl -Ss \
    http://yellow.r:9091/transmission/rpc \
    -H "X-Transmission-Session-Id: $SESSION_ID" \
    -d '{"arguments":{"fields":["errorString","eta","isFinished","name","sizeWhenDone","status"]},"method":"torrent-get","tag":4}' |
    jq .
''