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 : https://www.shawonruet.com/2020/09/free-iptv-m3u-playlist-2020-hourly.html

Github Repository Link: https://github.com/shawon100/M3u8-URL-Extractor-from-Live-Server

Bash Script

#!/bin/bash
cd ~/scripts
httrack -i http://mathanosto.top/tv/
cd mathanosto.top/tv
echo "" > IPTV.m3u
echo "#EXTM3U" >> IPTV.m3u
i=1
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
  i=$((i+1))
done

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 extractor.sh . 

Then install httrack by running this command

sudo apt install httrack

Then Run the shell script

sh extract.sh

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

Cronjob

*/50 * * * * sh ~/scripts/extract.sh

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 : https://www.shawonruet.com/p/free-iptv-m3u-playlist-2020-every-50.html

Playlist Setup Video:



Download Coding Interview Book and Get More Tutorials for Coding and Interview Solution: Click Here

Download System Design Interview Book and Get More Tutorials and Interview Solution: Click Here

Do you need more Guidance or Help? Then Book 1:1 Quick Call with Me: Click Here

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

8 comments:

  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

    ReplyDelete
  2. Kindly share a video about this.

    ReplyDelete
  3. This is very useful playlist creator because through this, we can make playlists according to our choice and listen accordingly. Do you like it? Dissertation writing services.

    ReplyDelete
  4. In recent decades, there were many game systems that were created and put out for sale. One well-known system was made by Nintendo. It was named the Nintendo Entertainment System (NES). Even today, Super Mario games are still very widely known. They are the most popular-selling games in history. Many variations of these games have been created for different systems. https://twitchviral.com/

    ReplyDelete
  5. All the online games which involve money are eagerly waiting for the NITI Aayog's final guidelines to run a smooth gaming platform. The government approval will help the online games to conduct numerous tournaments and generate huge revenue. Hope government will soon legalize online games which involve money. https://www.buyyoutubesubscribers.in/

    ReplyDelete
  6. People all around the world play games online or have interest in playing different games while sitting online in front of the computer screens. Usually the online games people play is through Facebook apps or other social networking web sites. Playing online game is a very interesting and entertaining time pass and helps kill the boredom when there is nothing to do. buy twitch followers

    ReplyDelete
  7. Kinds texts in this particular concept are often correct, observe how Once i had written this page is quite first-rate.

    ReplyDelete
  8. As well as adding new usefulness to your current kinds of content, some WordPress modules are intended to suit explicit sorts of site. http://wordpressctapro.com/

    ReplyDelete