2023-07-27 01:33:13 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# replace spaces in files with an underline
|
|
|
|
for i in *.m3u ; do sed -i 's/ /_/g' $i ; done
|
|
|
|
|
|
|
|
# check for none 200 response coded links
|
2024-02-07 11:40:05 +00:00
|
|
|
for i in *.m3u ; do for j in $(cat $i) ; do wget -S --spider -q -t 1 -T 1 --max-redirect 0 $j 2>&1 | grep "HTTP/" | awk '{print $2}' | (cat ; echo $j ;) | paste -s -d " " >> A-$i ; echo -e "$i - $j" ; done ; done
|
2023-07-27 01:33:13 +00:00
|
|
|
|
|
|
|
# find links that have 200 response code and remove others
|
2024-02-07 12:08:52 +00:00
|
|
|
for i in A-*.m3u ; do cat $i | grep -B1 "200 " | sed 's/200 //g' | awk 'length>3' | grep -A1 "#" > A$i ; done
|
2023-07-27 01:33:13 +00:00
|
|
|
|
2024-02-07 12:20:52 +00:00
|
|
|
# convert underlines in stream titles back to spaces
|
2024-02-07 12:27:43 +00:00
|
|
|
for i in *.m3u ; do sed -i '/#/s/_/ /g' $i ; done
|
2024-02-07 12:20:52 +00:00
|
|
|
|
2023-07-27 01:33:13 +00:00
|
|
|
# remove extra fluff from file names
|
2024-02-07 11:40:05 +00:00
|
|
|
#for i in AA-*.m3u ; do mv $i $(echo $i | sed 's/AA-//') ; done
|
2023-07-27 01:33:13 +00:00
|
|
|
|
|
|
|
# make the m3u files proper again by adding the header
|
|
|
|
for i in *.m3u ; do sed -i '1s/^/#EXTM3U\n/' $i ; done
|