Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- api="API_TOKEN"
- magnet_link="MAGNET_LINK"
- #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
- 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")
- echo $output
- #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
- 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")
- echo $output2
- #curl -H "Authorization: Bearer API_TOKEN" --request POST "https://api.real-debrid.com/rest/1.0/torrents/selectFiles/TORR_LINK?" -d "files=XX"
- eval "curl -H" "\"""Authorization: Bearer" $api"\"" "--request POST ""\""https://api.real-debrid.com/rest/1.0/torrents/selectFiles/"$output"?"\""" -d ""\""files=$output2"\""
- echo $output3
- var=$((output2-1))
- i=1
- while [[ $i -le $var ]]
- do
- 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")
- echo $output
- echo $i
- eval "curl -H" "\"""Authorization: Bearer" $api"\"" "--request POST ""\""https://api.real-debrid.com/rest/1.0/torrents/selectFiles/"$output"?"\""" -d ""\""files=$i"\""
- ((i = i + 1))
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement