peterpt / IPTV-CHECK

A script to check if the links in an iptv list file (m3u) are online or offline , and will create an output m3u file with valid urls only .
GNU General Public License v3.0
117 stars 67 forks source link

Not keeping the #EXTINF #2

Closed asfixia closed 6 years ago

asfixia commented 6 years ago

HI, great job with this tool.

But i have one problem, you could please solve this? The result file only contains the links not the chanel title resulting on a bunch of "no name" channels.

My input list: https://pastebin.com/5CmTv8D2 My okList.m3u

EXTM3U

http://188.165.216.211:1935/adalmada/adalmada.stream/live.m3u8

http://paraisotv.ddns.net:80/031/myStream/live.m3u8

http://177.54.152.243:1935/agrobrasiltv/agrobrasiltv/live.m3u8

http://5a0c3936c25c8.streamlock.net:1935/allsportstv/allsportstv/live.m3u8

http://188.165.216.211:1935/adalmada/adalmada.stream/live.m3u8

peterpt commented 6 years ago

Actually is not a bug that iptv check have , the reason is that there are multiple ways to build an iptv list , and i build iptv-check for the one i could find . Thanks for dropping your iptv list here , this way i can adapt the script for your type of list too , however since i am moving to gitlab , you problably have to clone the script from my future account in gitlab instead here on github . When that happens you will know because i will update my github with the new information . Maybe during the next week i get some time to adapt the iptv-check to your iptv list .

asfixia commented 6 years ago

Thank you for the rapid response!

If you could solve this, it wold be great. And if you are interested in an IPTV list generator, i created a script wich join multiple m3u from download links and use your tool to filter the valid entries.


The script: https://pastebin.com/ieCQWeHu A iptv_lists.txt example: https://pastebin.com/83vUQaUY

To use: create a file named "iptv_lists.txt" Put one link by line save.

And run the script in the same directory of your tool.

Use if you want.

asfixia commented 6 years ago

Hi again,

I'm not sure if it always works but worked for me. Changed the writefile function:

function writefile() {
# checks if tool already created previously an m3u file
if ! [[ -f "$wfile" ]]
then
echo "#EXTM3U" > "$wfile"
echo "" >> "$wfile"
fi
#searchs for that specific url in original file and get line number
gturlline=$(grep -n "${chkf}"<$path/temp/1 | tr ":" "\n" | sed -n 1p)
# This variavble will get the line number before the previous url (this is to get channel name)
defline=$((gturlline-1))
stdata=$(sed -n "${defline}p"< $path/temp/1)
echo "$stdata" >> "$wfile"
echo "$chkf" >> "$wfile"
echo "" >> "$wfile"
}
peterpt commented 6 years ago

Edited yes , that was one of the issues that i fixed in 1.1 , only now i notice witch part of the code you changed , however other things had to be done , like cleaning the empty urls like 0.0.0.0 witch iptv-check was testing with no logic . This last part i also fixed it up .

Last post : Nop , it must not be that way because it may work for your specific iptv list but it will not work for the others iptv lists i tested . I know how to solve it , i will problably do it during next week . In mean while if you want to help then drop here some more different iptv lists so i can adapt the script to them all . The iptv lists should have 3 or 4 stream links working at least so i can test them in the script .

m7mdcc commented 6 years ago

Hello @peterpt , you can use this playlist for testing : http://playlist.autoiptv.net/movie.php?title=epg

or

this :

      http://playlist.autoiptv.net/normal.php?title=epg

Thanks

peterpt commented 6 years ago

iptv-check is unable to download directly that file because the final file is requested thru a php script in the server , in that case you should download the file to your computer (the iptv list) and scan it with the script , but the script is writing only the valid urls to the final iptv list . I will deal with it as soon as i get some free time here . 046

m7mdcc commented 6 years ago

yeah , i'm doing that right now , can we speed up the process ? its take 500 per 15 min's

peterpt commented 6 years ago

not advised because if the stream from the server takes a little more to arrive then the script may consider that link as OFF when in reality could be ON . Personally i think that this script is already on the time request limit , because if some server is overloaded with requests , sometimes some links can appear as OFF when they are ON in reality . right now it waits 4 seconds from server , that time could be changed in line 234 of the script . Where it says "sleep 4" witch means 4 seconds , if you change it to "sleep 2" it will wait only 2 seconds for the file before checking its size . It is not advised because you probably will get false negatives like i told you before . Maybe in future i may use multiple instances of wget to check the streams , this means that in your case with 2 instances of wget working you will get 1000 links checked in 15 minutes , but as also there is a problem in that , witch is that some iptv servers only allow 1 connection by ip , in that case when the 1st instance of wget is downloading , the other instance will fail to get the file and will report it as OFF .

alkabane commented 6 years ago

Hi, really great work. Addendum there's another playlist format, like:

EXTINF:-1, CHANNEL

Http://188.165.216.211:1935/adalmada/adalmada.stream/live.m3u8 Http://paraisotv.ddns.net:80/031/myStream/live.m3u8

With secondary/alternative channels, you could implement "CHANNEL 2 ", in duplicate name cases.

peterpt commented 6 years ago

Project moved to gitlab . In 1.1 the first list https://pastebin.com/5CmTv8D2 is now working correctly , and i also fixed other bugs . list posted by m7mdcc , is also working fine .

This issue will be closed , and new issues should be posted on gitlab .