Created
December 11, 2018 09:15
-
-
Save Mo45/6adca2b319ab9cff1f10552b0b0a7672 to your computer and use it in GitHub Desktop.
Fetch and display channels list from IPTV playlist (*.m3u)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>IPTV Channels</title> | |
</head> | |
<body> | |
<ul> | |
<?php | |
$file = './list.m3u'; //IPTV-playlist | |
$searchfor = '#EXTINF:-1';//Pattern for searching | |
$contents = file_get_contents($file); | |
$pattern = preg_quote($searchfor, '/'); | |
$pattern = "/^.*$pattern.*\$/m"; | |
if(preg_match_all($pattern, $contents, $matches)){} | |
else{echo "No matches found";} | |
foreach($matches[0] as $m){ | |
$channel = explode(",", $m); | |
echo "<li>" . $channel[1] . "</li>"; | |
}; | |
?> | |
</ul> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#EXTM3U | |
#EXTINF:-1 group-title="Example Group ", Channel 1 | |
http://10.232.0.15:9101/index.m3u8 | |
#EXTINF:-1,Channel 2 | |
http://10.232.0.15:9102/index.m3u8 | |
#EXTINF:-1,Channel 3 | |
http://10.232.0.15:9105/index.m3u8 | |
#EXTINF:-1,Channel 4 | |
http://10.232.0.15:9106/index.m3u8 | |
#EXTINF:-1,Channel 5 | |
http://10.232.0.15:9109/index.m3u8 | |
#EXTINF:-1,Channel 6 | |
http://10.232.0.15:9110/index.m3u8 | |
#EXTINF:-1,Channel 7 |
Why can't this code load the m3u list?
¯_(ツ)_/¯
Can you give standard code to load the m3u list?
Vào 16:31, Th 6, ngày 16 tháng 10 năm 2020 Kirill Krasin <
[email protected]> đã viết:
… ***@***.**** commented on this gist.
------------------------------
Why can't this code load the m3u list?
¯_(ツ)_/¯
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/6adca2b319ab9cff1f10552b0b0a7672#gistcomment-3491619>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARLIXE7FW5SJ3AEMT6UHMWLSLAHGNANCNFSM4SS5S42A>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why can't this code load the m3u list?