Jump to content

Any Volunteers to Help write a script?


EODCrafter
Go to solution Solved by EODCrafter,

Recommended Posts

EODCrafter

I need a skilled script writer to adapt this script to pull out the Groups in my m3u and make separate m3u's for each group in my IPTV...any takers?

#!/bin/sh

: > emby_iptv.m3u
wget "http://vaders.iptv/get.php?username=email@[member="gmail"].com&password=PASSWORD&type=m3u_plus&output=hls" -O iptv_download.m3u
while read -r LINE || [ -n "$LINE" ]; do
awk '/#EXTINF:-1/ {gsub(/EXTINF:-1/, "& tvg-chno=\"" ++channel "\"")} 1' >> emby_iptv_tmp.m3u
done < iptv_download.m3u
mv emby_iptv_tmp.m3u emby_iptv.m3u
rm iptv_download.m3u
 
My channel Groups are identified in my m3u like this....
 
group-title="Sports",AU: Fox NRL League HD
group-title="News",US: Fox News Backup

These channels update frequently so i'll need to make Cron Jobs to run these updates every 6 hours or so and set Emby to update them along those lines. I figured out how to do that, I just can't figure out the Filter to let "awk" pull the groups.

Edited by EODCrafter
Link to comment
Share on other sites

  • Solution
EODCrafter

This prints out the 1st line of the m3u but leaves out my login info.....

awk '/group-title="Sports"/' >> emby_iptv_tmp.m3u

Got it!!!!!!!!

awk '/group-title="Sports"/{nr[NR]; nr[NR+1]}; NR in nr' >> emby_iptv_tmp.m3u
mv emby_iptv_tmp.m3u emby_sports.m3u
Edited by EODCrafter
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...