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.
 
 

49 lines
1002 B

  1. #!/bin/bash
  2. scriptpath="$(cd "$(dirname "$0")"; pwd -P)"
  3. if [[ -e transfer ]]
  4. then
  5. echo "Error: ./transfer exists" >&2
  6. exit 1
  7. fi
  8. if ! python3 --version &>/dev/null
  9. then
  10. echo "Error: python3 not found" >&2
  11. exit 1
  12. fi
  13. # ArchiveBot
  14. for f in "$@"
  15. do
  16. upurl="$("${scriptpath}/transfer.notkiska.pw-upload" "${f}")"
  17. echo "${upurl}" >&3
  18. if [[ "${f}" == facebook-* ]]
  19. then
  20. echo "!ao < ${upurl}"
  21. elif [[ "${f}" == twitter-* ]]
  22. then
  23. echo "!ao < ${upurl} --concurrency 6 --delay 0"
  24. elif [[ "${f}" == instagram-* ]]
  25. then
  26. echo "!a < ${upurl}"
  27. echo "!ig $("${scriptpath}/archivebot-jobid-calculation" "${upurl}") ^https?://www.instagram.com/.*[?&]hl="
  28. else
  29. echo "!ao < ${upurl}"
  30. fi
  31. done 3>transfer
  32. # chromebot
  33. for f in "$@"
  34. do
  35. if [[ "${f}" == facebook-@* || "${f}" == twitter-@* ]]
  36. then
  37. head -1 "${f}"
  38. elif [[ "${f}" == twitter-#* ]]
  39. then
  40. head -4 "${f}"
  41. fi
  42. done | sed 's,^,chromebot: a ,'
  43. echo "Wrote ./transfer, you can run snscrape-wiki-transfer-merge now if ./wiki exists." >&2