Linux Bash Script of Automated m3u8 URL extractor and Playlist Creator from a Live IPTV Server


This is a Linux Bash Script that will automatically extract hidden m3u8 url from Live TV server  and Updated the extracted m3u Playlist and uploaded to Github in every 50 minutes by cronjob.

Live Updated Playlist :

Github Repository Link:

Bash Script

cd ~/scripts
httrack -i
echo "" > IPTV.m3u
echo "#EXTM3U" >> IPTV.m3u
for x in [player]*.html; do
  var=$(cat $x | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*.[0-9]" | sort -u | head -1; echo "\n")
  echo "#EXTINF:-1, Channel $i" >> IPTV.m3u
  echo $var >> IPTV.m3u

cp IPTV.m3u ../../
cp IPTV.m3u ~/Development/Github/M3u8-URL-Extractor-from-Live-Server
cd ~/Development/Github/M3u8-URL-Extractor-from-Live-Server

git add .
git commit -m "Added Updated IPTV.m3u"
git push origin master

Create a scripts folder under Home of Linux and save the bash script as . 

Then install httrack by running this command

sudo apt install httrack

Then Run the shell script


A m3u Playlist named IPTV.m3u will be generated in the same folder.


*/50 * * * * sh ~/scripts/

If you want to push the m3u file to github after every 50 minutes then you need a create a github repository also and replace your repository path by mine in bash script

Live Updated Free IPTV Server Playlist :

Playlist Setup Video:

Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment


  1. Thanks for your post. I’ve been thinking about writing a very comparable post over the last couple of weeks, I’ll probably keep it short and sweet and link to this instead if thats cool. Thanks. best free online email extractor