-
Notifications
You must be signed in to change notification settings - Fork 6
/
snscrape-upload
executable file
·48 lines (43 loc) · 1002 Bytes
/
snscrape-upload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/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