|
- #!/bin/bash
- scriptpath="$(cd "$(dirname "$0")"; pwd -P)"
-
- if [[ -e transfer ]]
- then
- echo "Error: ./transfer exists" >&2
- exit 1
- fi
-
- if ! python3 --version &>/dev/null
- then
- echo "Error: python3 not found" >&2
- exit 1
- fi
-
- # ArchiveBot
- for f in "$@"
- do
- upurl="$("${scriptpath}/transfer.notkiska.pw-upload" "${f}")"
- echo "${upurl}" >&3
- if [[ "${f}" == facebook-* ]]
- then
- echo "!ao < ${upurl}"
- elif [[ "${f}" == twitter-* ]]
- then
- echo "!ao < ${upurl} --concurrency 6 --delay 0"
- elif [[ "${f}" == instagram-* ]]
- then
- echo "!a < ${upurl}"
- echo "!ig $("${scriptpath}/archivebot-jobid-calculation" "${upurl}") ^https?://www.instagram.com/.*[?&]hl="
- else
- echo "!ao < ${upurl}"
- fi
- done 3>transfer
-
- # chromebot
- for f in "$@"
- do
- if [[ "${f}" == facebook-@* || "${f}" == twitter-@* ]]
- then
- head -1 "${f}"
- elif [[ "${f}" == twitter-#* ]]
- then
- head -4 "${f}"
- fi
- done | sed 's,^,chromebot: a ,'
-
- echo "Wrote ./transfer, you can run snscrape-wiki-transfer-merge now if ./wiki exists." >&2
|