KING-BOX M3U too big to load with KODI (Workaround Brainstorming)

by _rkey

Hey fellow streamer,

I am using King-Box IP-TV since some hours now. Problem is that their provided M3U files contains 30k+ lines of entries (but only 200 channels I like to use - others mostly French VOD). As set-top box I am using Raspberry Pi3+ with KODI/Libreelec. As TV PVR I am using "Simple IPTV PVR", which works like a charm if you have below 2.000 lines of entries in your m3u file.

Workaround: I downloaded the M3U file manually and cut off the unnecessary lines of entries. In Simple IPTV I pointed locally to the modified M3U file and it works great.

Problem:

If King-Box is updating their M3U file, I have a black screen. Scripting to download their M3U file via wget / curl is not working because they use some get.php with user/pass I cannot obtain the plain M3U with out complications. Does anyone know how to solve this problem? May it be downloading the M3U via command line and their get.php or how Simple IPTV can be able to handle 30k lines of entries.

@King-Box it would be great if you customers had a wizard where the could select/un-select groups they want to have in their M3U file (should be not too complicated to implement) and point to your server.

Thanks all for your help, contribution, ideas !

Tamar1nd
  1. Tell reseller to remove Groups you do not watch.

  2. Download IPTVEditor, load m3u, move/delete groups u dont like, save m3u. http://www.htpcitalia.it/site/index.php/downloads/file/23-m3u-editor

ronbk

I'm running a script every night that downloads the m3u file. I grep, sort and clean it up it so it's short enough. This is my wget command.

wget -q -nv -O rawdata.m3u $M3UURL

Where $M3UURL is

http://king-box.club:80/get.php?username="$USERNAME"&password="$PASSWORD"&type=m3u_plus&output=ts

If I clean up the code, I could share it.

andygold2

When you use wget or curl, put the URL in quotes, as the '&' symbol in the URL will confuse the command.

_rkey

Hi iptvmaniacs coming back to the M3U refresh/update functionality, I want to introduce my super simple solution of the poor-mans-iptv on kodi with external iptv source ( Linux kodi 4.9.80 #1 SMP Fri Apr 13 11:08:35 BST 2018 armv7l Libreelec GNU/Linux). Thanks to your help, I build some fiddling scripts loading refreshed playlists i like to share with you.

(1) Make a script refreshing the m3u source file (thanks u/ronbk)

touch  /storage/.kodi/system/reload-m3u.sh
vi /storage/.kodi/system/reload-m3u.sh

(1.1) Insert your reload-m3u.sh script and make it executable chmod +x reload-m3u.sh

#!/bin/bash
cd /storage/backup
# M3U-URL must be in 'xx'
wget -q -nv -O /storage/backup/tv_channels_rxxxxx_plus.m3u '$M3U-URL'
echo "wait for process to end" && wait 20
head -n 645 /storage/backup/tv_channels_rxxxxx_plus.m3u >> /storage/backup/main.m3u
echo "truncated the main.m3u file at line 645 because too big for Kodi"

(2) Automate this process (cron not working for me in libreelec) with system.d

in directory /storage/.config/system.d/ you will find all service files. We will create one on our own:

(2.1) Load script from (1.1)

vi /storage/.config/system.d/iptv.update.service

[Unit]
Description=iptv.update
Requires=network-online.service
After=network-online.service

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
ExecStart=/bin/sh /storage/.kodi/system/reload-m3u.sh
Restart=always
RestartSec=15

Load the script as system service

systemctl start iptv.update.service 
systemctl enable iptv.update.service

Now on every reboot the script should automatically refresh the playlist. I have a TP-Link HS110 that I can hard-power-off the RPi and force a reboot (voice controlled via alexa).

(2.2) Schedule a timer to auto-refresh every morning 6 AM

vi /storage/.config/system.d/service.iptv.timer

[Unit]
Description=iptv.scheduled updated every morning 6AM
[Timer] 
OnCalendar=*-*-* 06:00:00  
Persistent=true  
Unit=iptv.update.service  
[Install]  
WantedBy=timers.target

Load the timer script as system service

systemctl start service.iptv.timer 
systemctl enable service.iptv.timer 

Now you should have a fully automated m3u playlist refresh with Kodi on your RaspberryPi running Libreelec.

Oat-

If you message them they might remove the bouquets you don't want from your account. It only takes a minute if they can be bothered helping.

dzigg

Check out iptv-epg and xstream codes. They can modify m3u, and add better EPG to the m3u.

rabnub101

Xtrwm editor can manage this seamlessly

_rkey

I will. Currently have to work w/o access to my network. I will follow up and let you know Thanks !

ChiaBanana

Notepad works just fine to edit out things you don't want.