Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.72 KB | None | 0 0
  1. #!/bin/bash
  2. regex='group-title="Movies"[^,]*,(.*)'
  3. while read -r line; do
  4. if [[ $line =~ $regex ]]; then
  5. movie=`echo "$line" | grep -oP '(?<=tvg-name=").+(?=" tvg-logo)'`
  6. movie2=`echo $movie | sed 's|\&|%26|g'`
  7. wgconfig=WG-Config.txt
  8. string="<channel update=\"f\" site=\"fixed\" site_id=\"00:00-23:59##title:$movie2##category:Movie##actor:Actor\" xmltv_id=\"$movie2\">$movie2</channel>"
  9. line="<!--Movies-->" # You Must add <!--Movies--> to the WebGrab config file above </settings>
  10. echo "Proccessing $movie"
  11. if grep -Fxq "$string" $wgconfig
  12. then
  13. echo "$string already exists in $wgconfig Skip!"
  14. else
  15. sed -i "/$line/a $string" $wgconfig
  16. echo "$string added to $wgconfig"
  17. fi
  18. fi
  19. done <<<"$(curl 'http://url.to/playlist.m3u8')"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement