Page 1 of 3 123 LastLast
Results 1 to 10 of 30
  1. #1
    Junoir Member
    Join Date
    Jan 2016
    Location
    yes i do
    Posts
    14
    Rep Power
    0

    IKS66 IPTV Simple Client EPG Fix for Kodi

    Instead of resolving the issues in the AutoIT version I have decided to scrap all that code and just start fresh in C#. The reason I started in AutoIt is because it's an easier language to get a grasp of and I'm incredibly rusty, up until recently I haven't really coded anything in about a year or two. To minimize errors I hard coded the link to the epg guide xml and the program now reads the m3u file directly from the link generated in your IPTV control panel. Since the program now requires more sensitive data to work I am releasing the source code with instructions on how to compile it for each operating system. That's right, this new version is compatible with Windows, Linux and Mac! I'm only releasing this basic CLI source code, all future releases will be closed source to keep script kiddies from stealing my work, renaming it and claiming it as their own work.

    TL;DR: This EPG Fix CLI Tool


    Source Code

    Code:
    using System;
    using System.Text;
    using System.Xml;
    using System.Xml.Schema;
    using System.IO;
    using System.Net;
    
    namespace EPGFix
    {
    	class Program
    	{
    		static void Main(string[] args)
    		{
    
    			Console.WriteLine ("Please input m3u url and press enter");
    			string remoteUrl = Console.ReadLine();
    
    			WebClient myWebClient = new WebClient();
    			Console.WriteLine("Downloading " + remoteUrl);                        
    			byte[] myDataBuffer = myWebClient.DownloadData (remoteUrl);
    			Stream stream = new MemoryStream(myDataBuffer);
    
    			string line;
    			char delimiter = ',';
    			string[] substrings;
    			string[] names = {"",""};
    			string[] data = {"",""};
    			string[] url = {"",""};
    			int counter = 0;
    
    			System.IO.StreamReader file = 
    				new System.IO.StreamReader(stream);
    			while((line = file.ReadLine()) != null)
    			{
    				if (line.StartsWith("#EXTINF:")) 
    				{
    					if (counter > 0) {
    						Array.Resize (ref names, names.Length + 1);
    						Array.Resize (ref data, data.Length + 1);
    						Array.Resize (ref url, url.Length + 1);
    					}
    					substrings = line.Split (delimiter);
    					names [counter] = substrings [substrings.Length - 1];
    					data [counter] = line;
    					url [counter] = file.ReadLine();
    					counter++;
    				}
    			}
    
    			file.Close();
    
    			Console.WriteLine("Download successful.");
    
    			XmlReaderSettings settings = new XmlReaderSettings();
    			settings.DtdProcessing = DtdProcessing.Ignore;
    			settings.ValidationType = ValidationType.DTD;
    			settings.ValidationEventHandler += new ValidationEventHandler (ValidationCallBack);
    			XmlReader xmlReader = XmlReader.Create("http://epg.euyulio.org/", settings);
    			XmlReader xmlReader2;
    			int strIndex;
    			string content;
    			bool continueloop = false;
    			string id;
    
    			while(xmlReader.Read())
    			{
    				
    				if((xmlReader.NodeType == XmlNodeType.Element) && (xmlReader.Name == "channel"))
    				{
    					if (xmlReader.HasAttributes)
    					{
    						
    						id = xmlReader.GetAttribute ("id");
    						xmlReader2 = xmlReader.ReadSubtree();
    						while (xmlReader2.Read()) 
    						{
    							if (continueloop) {
    								continueloop = false;
    								break;
    							}
    							if ((xmlReader.NodeType == XmlNodeType.Element) && (xmlReader.Name == "display-name")) {
    								content = xmlReader2.ReadElementContentAsString ();
    								for (int strNumber = 0; strNumber < names.Length-1; strNumber++)
    								{
    									strIndex = names[strNumber].IndexOf(content);
    									if (strIndex >= 0) {
    										if (data[strNumber].StartsWith("#EXTINF:-1 tvg-id=" + '"' + '"')) {
    											data[strNumber] = "#EXTINF:-1 tvg-id=" + '"' + id + data[strNumber].Substring(19);
    											continueloop = true;
    											break;
    										}
    										data[strNumber] = "#EXTINF:-1 tvg-id=" + '"' + id + data[strNumber].Substring (24);
    										continueloop = true;
    										break;
    									}
    								}
    							}
    						}
    					}
    				}
    			}
    
    			string path = Directory.GetCurrentDirectory();
    			Console.WriteLine ("Please input new M3U Playlist name");
    
    			System.IO.StreamWriter file2 = new System.IO.StreamWriter(path + @"/"+Console.ReadLine()+".m3u");
    			file2.WriteLine("#EXTM3U");
    
    			for (int strNumber = 0; strNumber < names.Length - 1; strNumber++) {
    				file2.WriteLine (data [strNumber]);
    				file2.WriteLine (url [strNumber]);
    			}
    
    			file.Close();
    			Console.WriteLine ("New M3U file generated press any key to exit");
    			Console.ReadKey();
    		}
    
    		private static void ValidationCallBack(object sender, ValidationEventArgs e) {
    			Console.WriteLine("Loaded EPG Guide", e.Message);
    		}
    	}
    }
    OS Specific Requirements


    Windows: .NET Framework 4.5 must be installed
    Linux: Mono must be installed (Follow install instructions Here)
    Mac: Mono must be installed (Follow install instructions Here)

    General Requirements


    Link to M3U Playlist as generated by your IPTV control panel
    A way to host the new generated m3u file with the updated channel parameters. I personally use 000webhost.com because it's free, fast and reliable but any webhost that offers direct linking should work.
    Knowledge of using Kodi and Web Control Panels helps alot but not really needed
    Last but not least my handy dandy App

    Windows Instructions


    1. Double click on epgfix.exe
    2. Copy and paste M3U URL and press enter
    3. Type the name of the new file and press enter
    4. Press any key to exit
    5. Upload M3U file to a webhost

    Linux and Mac Instructions

    1. Open Terminal
    2. Type "cd location/of/epgfixfolder" I keep mine in documents so it would be "cd Documents"
    2. Type "mono epgfix.exe" and press enter
    3. Copy and paste M3U URL and press enter
    4. Type the name of the new file and press enter
    5. Press any key to exit
    6. Upload M3U file to a webhost

    Kodi Instructions


    1. Open up Kodi's IPTV Simple Client Settings (My Addons -> PVR Clients-> PVR IPTV Simple Client -> Configure -> General Settings) Under: M3U Play List URL enter the url to where you uploaded your playlist, I would also disable "Cache m3u at local storage" as it can cause issues
    2. In the same menu you should see another submenu or tab called EPG Settings. Under that tab you'll find XMLTV URL, you need to enter the following with out parenthesis "http://epg.euyulio.org" Also turn off "Cache XMLTV at local storage".
    3. If you did everything you can disable and re-enable the IPTV Simple Client and you should start seeing that lonely EPG start populating. If that doesn't work you can either try restarting Kodi and/or clearing the old tv data in Kodi's TV settings

    How to compile on Windows


    1. Download and install Mono 32-bit from Here
    2. Open up Notepad and copy paste Source Code above into Notepad
    3. Save As "epgfix.cs" make sure to "Save as type" is set to "All files (*.*)" and close Notepad
    4. Open Mono x86 Command Prompt <--- It should appear in your start menu after you install Mono
    5. Type "cd path\to\epgfix" and press enter (I keep my in documents so for me it's "cd C:\Users\Username\Documents" replace Username with your computer username)
    6. Type "mcs epgfix.cs" and press enter

    How to compile on Linux


    1. Make sure if you have Mono installed, refer to Linux Requirement section.
    2. Open up your text editor and copy paste Source Code above into it
    3. Save As "epgfix.cs" make sure to "Save type" is set to "All files (*.*)" and close your text editor
    4. Open Terminal
    5. Type "cd path\to\epgfix" and press enter (I keep my in documents so for me it's "cd C:\Users\Username\Documents" replace Username with your computer username)
    6. Type "mcs epgfix.cs" and press enter

    How to compile on Mac


    I'm gonna edit this later when I get access to a Mac computer but I'm sure it's roughly the same steps as Linux Instructions.


    I'm still providing a download link to the compiled version below for the people that don't want to go through extra steps to compile it



    Credits for the EPG XML go to Euyulio and Viper8690 : GitHub

    I have personally tested this program in several different computers and it's working on both Linux and Windows. I currently don't have access to a Mac computer but it should work aswell. Please feel free to report any bugs you might encounter and I'm working on a GUI and to get the features I had in AutoIt back in the C# but I won't release it until thoroughly tested. I'll edit this post with video tutorials when I get around to making them.

  2. #2
    Transparent Wall Technician crazed 9.6's Avatar
    Join Date
    Nov 2014
    Posts
    15,681
    Rep Power
    447
    hey thnx alot for your work and also for sharing this.

    Very nice Luig
    Hope to see some testing results posted
    I must not forget, we must not forget, that we are human beings.
    - Ren

  3. #3
    Junoir Member
    Join Date
    Jan 2016
    Location
    yes i do
    Posts
    14
    Rep Power
    0
    Np man, I wouldn't have made it this far if the other cat hadn't shared his work lol. Got around to making a quick video to show the working EPG, not the best but it should do for now as a proof of concept and a quick visual how too of what you need to do. I used the web browser uploader for the file but Filezilla and other FTP clients work on 000webhost. My end game is to have a program that can fully customize the playlists and to have a built in self updater/uploader or maybe even a small built in localhost server that and a newer looking UI. I'm open to suggestions as far as feature requests tho.

  4. #4
    TV Addicted
    Join Date
    Jul 2015
    Location
    Mexico
    Posts
    282
    Rep Power
    33
    Thanks looks promising. I have opened a account with 000webhost.com and downloaded your program. I need to trim down my m3u list in notepad and then i think i will be ready to test it out later today.

  5. #5
    Junoir Member
    Join Date
    Jan 2016
    Location
    yes i do
    Posts
    14
    Rep Power
    0
    If you mean trim down all those movie and tv show links this app does it for you, leave everything unchecked and you get nothing but tv channels. It even trims out all the non working channels at the time and by that I mean the ones with a url of "http://lol" If you mean all foreign channels I'm still working on the code for that lol.

  6. #6
    TV Addicted
    Join Date
    Jul 2015
    Location
    Mexico
    Posts
    282
    Rep Power
    33
    Quote Originally Posted by Luig View Post
    If you mean trim down all those movie and tv show links this app does it for you, leave everything unchecked and you get nothing but tv channels. It even trims out all the non working channels at the time and by that I mean the ones with a url of "http://lol" If you mean all foreign channels I'm still working on the code for that lol.
    thanks i will give that a try and let you know.

  7. #7
    TV Addicted
    Join Date
    Jul 2015
    Location
    Mexico
    Posts
    282
    Rep Power
    33
    OK i am almost there. i was one click away from uploading my newplaylist to 000webhost.com and it suddenly occurred to me that my playlist contains my donation number.

    so the big question is how secure is the web host? i am not going to give out my donation number to anyone.

  8. #8
    Junoir Member
    Join Date
    Jan 2016
    Location
    yes i do
    Posts
    14
    Rep Power
    0
    It's a single file and there are billions of random m3u files out there so I doubt you'll have any issues, if you are still worried you can rename the playlist file to something like "algebra_class1.m3u" and you should be fine.

  9. #9
    TV Addicted
    Join Date
    Jul 2015
    Location
    Mexico
    Posts
    282
    Rep Power
    33
    Quote Originally Posted by Luig View Post
    It's a single file and there are billions of random m3u files out there so I doubt you'll have any issues, if you are still worried you can rename the playlist file to something like "algebra_class1.m3u" and you should be fine.
    After it not working for me i found a malware virus on my pc i removed it. did it come from downloading the above exe file? not positive but pretty sure/

    edit: to be fair i had some problems opening the 000webhost site after registering it wouldn't take my password i eventually found another page that worked. it may have been some kind of misdirect and infected my pc during that process unrelated to the download.

    just saying proceed with caution.
    Last edited by Sandiver; 09-20-2017 at 05:16 PM.

  10. #10
    Moderator at Work ilan's Avatar
    Join Date
    Sep 2015
    Location
    Celestial Fields
    Posts
    8,641
    Rep Power
    293
    Sometimes there are false positives. You could scan the EXE file with your antivirus or malware client. It should detect malware in the installation file if it exists.
    Last edited by ilan; 09-20-2017 at 05:23 PM.
    Beginner's Guide for Rocket, NFPS and IKS66...
    http://iptvtalk.net/showthread.php?2...-you-should-do

    Kodi Options for Rocket, NFPS and IKS66...
    http://iptvtalk.net/forumdisplay.php?71-Kodi

    Check the Announcement Section...
    http://iptvtalk.net/forumdisplay.php...-Announcements

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. IKS66 with IPTV Simple Client no longer works
    By rgturk100 in forum PVR Clients
    Replies: 4
    Last Post: 02-27-2018, 07:15 PM
  2. KODI 17.3 IPTV PVR Simple Client No TV Menu
    By Joan55 in forum PVR Clients
    Replies: 8
    Last Post: 07-09-2017, 06:46 PM
  3. Calibrated IKS66 EPG XML for IPTV SIMPLE CLIENT M3U file
    By R2D2 in forum IPTV Private Server (IPTV66)
    Replies: 2
    Last Post: 03-12-2017, 04:29 AM
  4. Replies: 1
    Last Post: 03-11-2017, 12:41 PM
  5. EPG and iptv simple client for iks66 working again ?
    By Sdruid11 in forum IPTV Private Server (IPTV66)
    Replies: 2
    Last Post: 03-10-2017, 09:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •