Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- R_M3U="http://mafreebox.freebox.fr/freeboxtv/playlist.m3u"
- F_IN=playlist.m3u
- F_NAME=playlist.name
- F_OUT_ALL=/etc/enigma2/userbouquet.FreeIPTV.tv
- F_OUT_LD=/etc/enigma2/userbouquet.FreeIPTV_LD.tv
- F_OUT_SD=/etc/enigma2/userbouquet.FreeIPTV_SD.tv
- F_OUT_HD=/etc/enigma2/userbouquet.FreeIPTV_HD.tv
- F_OUT_RD=/etc/enigma2/userbouquet.FreeIPTV_radio.radio
- echo "getting remote file..."
- # get remote-file
- wget "$R_M3U" -O $F_IN
- echo "parsing channel names..."
- #get channel names
- grep EXTINF $F_IN | sed -e 's/.*- //' > $F_NAME
- echo "reading URLs and replacing colon..."
- # read urls and replace ":"
- URLS=`grep rtsp $F_IN | sed -e 's/:/%3a/'`
- echo "go trough urls and creating bouqet..."
- # go trough urls and create bouqet
- echo "#NAME FreeIPTV ALL" > $F_OUT_ALL
- CNT=0
- for u in $URLS; do
- CNT=$(($CNT + 1))
- NAM=`head -$CNT $F_NAME | tail -1`
- SRV=` printf "%x" $(echo $u | sed -e 's/.*service=//' -e 's/&.*//' -e 's/\l\n//')`
- echo "#SERVICE 1:0:1:$SRV:0:0:0:0:0:0:$u:$NAM" >> $F_OUT_ALL
- done
- echo "seperating stream-types..."
- ### seperate stream-types
- echo "#NAME FreeIPTV LD" > $F_OUT_LD
- grep "flavour=ld" $F_OUT_ALL >> $F_OUT_LD
- echo "#NAME FreeIPTV SD" > $F_OUT_SD
- grep "flavour=sd" $F_OUT_ALL >> $F_OUT_SD
- echo "#NAME FreeIPTV HD" > $F_OUT_HD
- grep "flavour=hd" $F_OUT_ALL >> $F_OUT_HD
- echo "#NAME FreeIPTV Radio" > $F_OUT_RD
- grep -v "flavour" $F_OUT_ALL | grep -v ^#NAME >> $F_OUT_RD
- rm $F_NAME
- rm $F_IN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement