Advertisement
Guest User

Untitled

a guest
Sep 29th, 2018
1,791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. #!/bin/bash
  2. api="API_TOKEN"
  3. magnet_link="MAGNET_LINK"
  4.  
  5. #curl -H "Authorization: Bearer API_TOKEN" --request POST "https://api.real-debrid.com/rest/1.0/torrents/addMagnet?" -d "magnet=MAGNET" | grep , | cut -d '"' -f4
  6.  
  7. output=$(eval "curl -H" "\"""Authorization: Bearer" $api"\"" "--request POST ""\""https://api.real-debrid.com/rest/1.0/torrents/addMagnet?"\""" -d ""\"""magnet="$magnet_link"\""" | grep , | cut -d '""\"""' -f4")
  8. echo $output
  9.  
  10. #curl -H "Authorization: Bearer API_TOKEN" --request GET "https://api.real-debrid.com/rest/1.0/torrents/info/TORR_LINK" | grep id | tail -1 | cut -d ',' -f1 | cut -d " " -f2
  11.  
  12. output2=$(eval "curl -H" "\"""Authorization: Bearer" $api"\"" "--request GET ""\""https://api.real-debrid.com/rest/1.0/torrents/info/"$output"\"""" | grep id | tail -1 | cut -d ',' -f1 | cut -d "\"" ""\""" -f2")
  13. echo $output2
  14.  
  15. #curl -H "Authorization: Bearer API_TOKEN" --request POST "https://api.real-debrid.com/rest/1.0/torrents/selectFiles/TORR_LINK?" -d "files=XX"
  16.  
  17. eval "curl -H" "\"""Authorization: Bearer" $api"\"" "--request POST ""\""https://api.real-debrid.com/rest/1.0/torrents/selectFiles/"$output"?"\""" -d ""\""files=$output2"\""
  18. echo $output3
  19.  
  20. var=$((output2-1))
  21. i=1
  22. while [[ $i -le $var ]]
  23. do
  24. output=$(eval "curl -H" "\"""Authorization: Bearer" $api"\"" "--request POST ""\""https://api.real-debrid.com/rest/1.0/torrents/addMagnet?"\""" -d ""\"""magnet="$magnet_link"\""" | grep , | cut -d '""\"""' -f4")
  25. echo $output
  26. echo $i
  27. eval "curl -H" "\"""Authorization: Bearer" $api"\"" "--request POST ""\""https://api.real-debrid.com/rest/1.0/torrents/selectFiles/"$output"?"\""" -d ""\""files=$i"\""
  28. ((i = i + 1))
  29. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement