Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
615
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.73 KB | None | 0 0
  1. \#!/bin/bash  
  2.  
  3.  
  4. pvr=$1  
  5.  title=$2  
  6.  downloadUrl=$3  
  7.  apiKey=$4  
  8.  date=$(date -u +"%Y-%m-%d %H:%M:%SZ")  
  9.  indexer=$5  
  10.  apiUrl="null"  
  11.  
  12.  
  13. post\_release() {  
  14.      {  
  15.           /usr/bin/curl -i -H "Accept: application/json" -H  "Content-Type: application/json" -H "X-Api-Key: $apiKey" -X POST -d "$1"  $apiUrl  
  16.      } &>/dev/null  
  17.  }  
  18.  
  19.  
  20. get\_api\_url() {  
  21.      if \[ -z "$pvr" \]; then  
  22.          echo 'No PVR set'  
  23.          exit  
  24.      fi  
  25.  
  26.  
  27.     if \[ "$pvr" == "lidarr" \]; then  
  28.          apiUrl="http://localhost:8686/api/v1/release/push"  
  29.      elif \[ "$pvr" == "radarr" \]; then  
  30.          apiUrl="http://127.0.0.1:7878/api/release/push"  
  31.      elif \[ "$pvr" == "sonarr" \]; then  
  32.          apiUrl="http://127.0.0.1:8989/api/release/push"  
  33.      fi  
  34.  }  
  35.  
  36.  
  37. get\_api\_url  
  38.  
  39.  
  40. if \[ -z "$indexer" \]; then  
  41.      post\_release '{"title":"'"$title"'","downloadUrl":"'"$downloadUrl"'","protocol":"torrent","publishDate":"'"$date"'"}'  
  42.      exit  
  43.  fi  
  44.  
  45.  
  46. post\_release '{"title":"'"$title"'","downloadUrl":"'"$downloadUrl"'","protocol":"torrent","publishDate":"'"$date"'","indexer":"'"$indexer"'"}'
  47.  
  48.  18:10:18-!-
  49.  
  50. Matched Four Corners S60E10 Amazon-What They Know About Us 720p HDTV x264-CBFM in TV/x264 (All IPT to Sonarr), IPTorrents
  51.  
  52. 18:10:18-!-
  53.  
  54. Started command: '/home/seedit4me/iptv/autodl-curl-sonarr.sh', args: '"sonarr" "Four Corners S60E10 Amazon-What They Know About Us 720p HDTV x264-CBFM" "https://www.iptorrents.com/download.php/3842134/Four%20Corners%20S60E10%20Amazon-What%20They%20Know%20About%20Us%20720p%20HDTV%20x264-CBFM.torrent?torrent\_pass=******" API\_KEY\_CENSORED' Four Corners S60E10 Amazon-What They Know About Us 720p HDTV x264-CBFM, IPTorrents, total time 0.056 seconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement