for i in $(cat genres.txt);do curl -s -L https://www.getmeradio.com/stations/genre/$i| htmlq -a href a | grep "stations"| awk -F '/''{print $3}'| awk 'NR>4' > A-$i.txt ;done
for i in $(cat countries.txt);do curl -s -L https://www.getmeradio.com/stations/country/$i| htmlq -a href a | grep "stations"| awk -F '/''{print $3}'| awk 'NR>2' > A-$i.txt ;done
for i in AA-*.txt ;do cat $i| awk '!seen[$0]++'| grep -v "Station Not Available"| grep -B1 "http"| awk 'length>4'| sed 's|https://securestreams7.autopo.st/?uri=||g' > A$i;echo -e $i;done
# convert links to m3u streams
for i in AA-*.txt ;do sed '1s/^/#EXTM3U\n/'$i > $i.m3u ;done
# remove AAA- and double extensions in streams
for i in *.m3u ;do mv "$i""`echo $i | sed -e 's/AAA-//' -e 's/.txt//'`";done