summaryrefslogtreecommitdiff
path: root/home/xyz/.local/bin/curlqb
blob: d40ff6d1e94bbc31df27fa6951db402ef0694621 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

curl -s 'https://github.com/qbittorrent/search-plugins/wiki/Unofficial-search-plugins' | awk -F'"' '
/require an account/ {exit}
/\.py/ {
	url=$2
	getline
	getline
	getline
	if($0 !~ /❗|✖/)
		print url
}
' | xargs curl -s -Z -L --remote-name-all --create-dirs --output-dir "$1" --

# an alternative awk command:
#awk -F'"' '
#/require an account/ {exit}
#/\.py/ {
#	url=$2
#	line=NR
#}
#url && NR==line+3 && !/❗|✖/ {print url}
#'