File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ grep -PR '<a .*?href=' |
78
78
cut -d' #' -f1 |
79
79
sort -u -t$' \t ' -k 2 |
80
80
sort -u |
81
+ tee >( cat 1>&2 ) |
81
82
python -c '
82
83
import sys
83
84
from urllib.parse import urljoin
@@ -90,9 +91,14 @@ for line in sys.stdin.readlines():
90
91
grep -v $' \t ' ' $' |
91
92
while read -r line; do
92
93
while IFS=$' \t ' read -r file url; do
93
- url=$( python -c ' import html, sys; print(html.unescape(sys.argv[-1]))' " $url " )
94
- [ -f " $url " ] ||
95
- curl --silent --fail --retry 5 --retry-delay 5 --user-agent ' Mozilla/5.0 Firefox 61' " $url " > /dev/null 2>&1 ||
94
+ target_file=" $( python -c '
95
+ import html, sys # fixes &
96
+ from urllib.parse import unquote # fixes %20
97
+ print(html.unescape(unquote(sys.argv[-1])))' " $url " ) "
98
+ if [ -f " $target_file " ]; then continue ; fi
99
+
100
+ url=" ${url// /% 20} "
101
+ curl --silent --fail --retry 5 --retry-delay 5 --user-agent ' Mozilla/5.0 Firefox 101' " $url " > /dev/null 2>&1 ||
96
102
die " broken link in $file : $url "
97
103
done
98
104
done
You can’t perform that action at this time.
0 commit comments