Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- regex='group-title="Movies"[^,]*,(.*)'
- while read -r line; do
- if [[ $line =~ $regex ]]; then
- movie=`echo "$line" | grep -oP '(?<=tvg-name=").+(?=" tvg-logo)'`
- movie2=`echo $movie | sed 's|\&|%26|g'`
- wgconfig=WG-Config.txt
- string="<channel update=\"f\" site=\"fixed\" site_id=\"00:00-23:59##title:$movie2##category:Movie##actor:Actor\" xmltv_id=\"$movie2\">$movie2</channel>"
- line="<!--Movies-->" # You Must add <!--Movies--> to the WebGrab config file above </settings>
- echo "Proccessing $movie"
- if grep -Fxq "$string" $wgconfig
- then
- echo "$string already exists in $wgconfig Skip!"
- else
- sed -i "/$line/a $string" $wgconfig
- echo "$string added to $wgconfig"
- fi
- fi
- done <<<"$(curl 'http://url.to/playlist.m3u8')"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement