forked from writerProDemon666RU/hydra
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcollect.sh
151 lines (137 loc) · 4.09 KB
/
collect.sh
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/bin/sh
set -e
mkdir -p './catalog/page'
PAGEDIR="./catalog/page"
# переменная с кукисой пользователя. залогиньтесь на сайте и вставьте свою
export COOKIE='<SESSION COOKIE HERE>'
get_catalog() {
PAGES="$1"
COOKIE="$2"
PAGEDIR="$3"
for (( i = 0; i < "$PAGES"; i+=1 )); do
touch "$PAGEDIR/$i"
torsocks curl "$TARGET_URL/catalog?query=&sort_direction=desc&sort=rate&page=$i" \
-H "Host: $TARGET_URL" \
-H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0' \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
-H 'Accept-Language: en-US,en;q=0.5' \
--compressed \
-H "Referer: $TARGET_URL/catalog" \
-H "$COOKIE" \
-H 'Connection: keep-alive' \
-H 'Upgrade-Insecure-Requests: 1' \
> "$PAGEDIR/$i"
done
}
cat shops/page/* \
| pup 'a json{}' \
| jq 'map(.href)' \
| grep '/market/' \
| grep -v 'http' \
| grep -v 'create' \
>> markets.txt
sed -i \
-e 's/,//g' \
-e 's/"//g' \
-e 's/ //g' \
markets.txt
while read -r MARKET; do
echo "$MARKET"
torsocks curl "$TARGET_URL/market/$MARKET/profile" \
-H "Host: $TARGET_URL" \
-H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0' \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
-H 'Accept-Language: en-US,en;q=0.5' \
--compressed \
-H "Referer: $TARGET_URL/catalog" \
-H "$COOKIE" \
-H 'Connection: keep-alive' \
-H 'Upgrade-Insecure-Requests: 1' \
> "$MARKET"
done < markets.txt
products_extract() {
cat "$PAGEDIR"/* \
| pup 'a json{}' \
| jq 'map(.href)' \
| grep 'product' \
| sed 's/,//g' \
| sed 's/"//g' \
| sed 's/ //g' \
> "$PAGEDIR"/products.txt
}
while read -r p; do
echo "$p"
touch ".$p"
torsocks curl "$TARGET_URL$p" \
-H "Host: $TARGET_URL" \
-H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0' \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
-H 'Accept-Language: en-US,en;q=0.5' \
--compressed \
-H "Referer: $TARGET_URL/catalog" \
-H "$COOKIE" \
-H 'Connection: keep-alive' \
-H 'Upgrade-Insecure-Requests: 1' \
> ".$p"
done < products.txt
for filename in ./*; do
pup 'a json{}' < "$filename" \
| jq 'map(.href)' \
| grep '/market/.*/profile?product_id=' \
| grep -v 'region_id' \
| sed 's/,//g' \
| sed 's/"//g' \
| sed 's/ //g' \
>> expiriences.txt
done
while read -r p; do
PAGES=$(
pup 'ul[class="pagination"] li:nth-last-of-type(3) text{}' \
< "expiriences$p/1"
)
echo "$p,$PAGES" \
>> expiriences_pages.txt
done < expiriences.txt
while read -r record; do
PAGES=$(echo "$record" | cut -d',' -f2)
LINK=$(echo "$record" | cut -d',' -f1)
for (( i = 2; i < $PAGES+1; i++ )); do
mkdir -p "expiriences/$LINK"
touch "expiriences/$LINK/$i"
torsocks curl \
"$TARGET_URL$LINK&page=$i" \
-H "Host: $TARGET_URL" \
-H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0' \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
-H 'Accept-Language: en-US,en;q=0.5' \
--compressed \
-H "Referer: $TARGET_URL/catalog" \
-H "$COOKIE" \
-H 'Connection: keep-alive' \
-H 'Upgrade-Insecure-Requests: 1' \
> "expiriences$LINK/$i"
done
done < expiriences_pages.txt
get_user() {
USER="$1"
COOKIE="$COOKIE"
echo "$USER" >> users_seen.txt
torsocks curl "$TARGET_URL/$USER" \
-H "Host: $TARGET_URL" \
-H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0' \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
-H 'Accept-Language: en-US,en;q=0.5' \
--compressed \
-H "Referer: $TARGET_URL/catalog" \
-H "$COOKIE" \
-H 'Connection: keep-alive' \
-H 'Upgrade-Insecure-Requests: 1' \
> ./"$USER"
}
export -f get_user
parallel -j20 -a users1.txt get_user
wget \
--mirror \
--no-parent \
--load-cookies cookies.txt \
"$MARKET_URL/forum"