-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabuscript.sh
More file actions
executable file
·27 lines (27 loc) · 914 Bytes
/
abuscript.sh
File metadata and controls
executable file
·27 lines (27 loc) · 914 Bytes
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
#!/bin/bash
rm -rf /tmp/abuscript
board=$1
thread=$2
filetype=$3
directory=$(pwd)
if [ "$board" == "install" ]
then
sudo ln abuscript.sh /bin/abuscript &> /dev/null
exit
fi
if [ "$thread" != "" ]
then
mkdir /tmp/abuscript &> /dev/null
cd /tmp/abuscript
wget --header "Cookie: usercode_auth=35f8469792fdfbf797bbdf48bab4a3ad" -c -q https://2ch.hk/$board/res/$thread.html
grep -Po "(?<=href=\"/$board/src)[^\"]*$filetype" $thread.html | sed "s/.*/2ch.hk\/$board\/src&/" > links.txt
cd $directory
mkdir $thread &> /dev/null
cd $thread
wget -c --header "Cookie: usercode_auth=35f8469792fdfbf797bbdf48bab4a3ad" -nc -q -i /tmp/abuscript/links.txt
echo "Скачано файлов: $(ls -1 | wc -l)"
else
echo "Использование: abuscript [Доска] [Номер треда] [Расширение файлов]"
echo "Пример: abuscript b 12345678 webm"
fi
rm -rf /tmp/abuscript