Xshell 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/usr/bin/env bash
  2. #=======Header=======================================================|
  3. #Slackjeff
  4. #Download direct videos on xvideos
  5. #
  6. #VERSION 0.1beta
  7. #====================================================================|
  8. #========Tests
  9. # Have deps?
  10. #========Someone variables
  11. # For current diretory
  12. CDir="$(dirname $(readlink -f $0))"
  13. #====================================================================|
  14. # Resove the problematics for execution in othes directories
  15. cd "$CDir"
  16. for dep in "wget" "curl" "ffplay"; do
  17. type "$dep" 1>/dev/null 2>&1 || { echo "U NEED A \"$dep\" for continue."; exit 137 ;}
  18. done
  19. #========FUNC
  20. _info() # More informations
  21. {
  22. cat <<END
  23. Xshell - Download Direct videos ON xvideos
  24. USAGE:
  25. Xshell "link"
  26. PARAMS:
  27. -h, --help
  28. Show this Help
  29. -d, --download
  30. Download a video
  31. END
  32. }
  33. _push() # Push a video
  34. {
  35. video="html5player.setVideoUrlHigh"
  36. # Find String
  37. get_url_video=$(curl -s "${1}" | grep "$video" | sed "s/html5pla.*('//; s/');//; s/ //g")
  38. # Get a Title video
  39. get_title=$(echo "$1" | sed "s/.*\///")
  40. title="${get_title:=porn_video${RANDOM}}" # Title null?
  41. echo "---------> WAIT! Download a ${title}"
  42. wget -q --show-progress -O "${title}.mp4" ${get_url_video} # Download a video
  43. cat <<- END
  44. RUN THE U VIDEO
  45. ----------------
  46. ← | Return frame
  47. → | Next frame
  48. 0 | Plus volume
  49. 9 | Less volume
  50. q | Quit
  51. END
  52. if ! ffplay -loglevel -8 "${title}.mp4" 2>/dev/null; then
  53. echo "This shit of code, fucker"
  54. fi
  55. }
  56. #=====MAIN
  57. case $1 in
  58. -d|--download)
  59. shift
  60. #Null? goto info
  61. [ $1 ] && _push "$@" || _info ;;
  62. *) _info ;;
  63. esac