The little things give you away... A collection of various small helper stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

19 lines
561 B

  1. #!/bin/bash
  2. declare -A uas
  3. uas["archivebot"]='ArchiveTeam ArchiveBot/20190427.01 (wpull 2.0.3) and not Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36'
  4. uas["firefox"]='Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0'
  5. if [[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' || -z "${uas[$1]+exists}" ]]
  6. then
  7. echo "Usage: curl-ua NAME ARGS" >&2
  8. echo "" >&2
  9. echo " NAME: name of a UA alias" >&2
  10. echo " ARGS: args for curl" >&2
  11. exit 1
  12. fi
  13. ua="${uas[$1]}"
  14. shift
  15. curl -A "${ua}" "$@"