File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -10,18 +10,26 @@ if [[ -z "${PROXY_LIST_URL}" ]]; then
10
10
echo " Using mounted proxy list"
11
11
touch $BASE_DIR /proxy-list.txt
12
12
echo " ---> Done"
13
- else
13
+ elif [[ -z " ${BRIGHT_DATA_API_TOKEN} " ]] ; then
14
14
echo " Downloading proxy list from $PROXY_LIST_URL "
15
15
curl -s $PROXY_LIST_URL > $BASE_DIR /proxy-list.txt
16
16
echo " ---> Done"
17
+ else
18
+ echo " Downloading proxy list from $PROXY_LIST_URL "
19
+ curl -s -H " Authorization: Bearer $BRIGHT_DATA_API_TOKEN " " $PROXY_LIST_URL " > $BASE_DIR /proxy-list.txt
20
+ echo " Correctly formatting proxy list file"
21
+ # Builds the URL with the username, password and the endpoint of Bright Data
22
+ SUBSTITUTION_PATTERN=" s/^.*/http:\/\/${BRIGHT_DATA_USERNAME} -ip-&:${BRIGHT_DATA_PASSWORD} @brd.superproxy.io:22225/"
23
+ sed -i $SUBSTITUTION_PATTERN $BASE_DIR /proxy-list.txt
24
+ echo " ---> Done"
17
25
fi
18
26
19
- echo " Adding proy list to config file"
27
+ echo " Adding proxy list to config file"
20
28
# Remove blank lines
21
29
sed -i ' /^$/d' $BASE_DIR /proxy-list.txt
22
30
# Prepend forward= in front of each line to match glider config syntax
23
31
sed -i ' s/^/forward=/' $BASE_DIR /proxy-list.txt
24
- # Randomize and happen
32
+ # Randomize and append
25
33
cat $BASE_DIR /proxy-list.txt | shuf >> $BASE_DIR /glider.conf
26
34
echo " ---> Done"
27
35
You can’t perform that action at this time.
0 commit comments