Code Monkey home page Code Monkey logo

e2m3u2bouquet's Introduction

Enigma2 IPTV m3u to bouquet

Latest release can be downloaded from releases

Usage

usage: e2m3u2bouquet.py [-h] [-m M3UURL] [-e EPGURL] [-n PROVIDERNAME]
                        [-u USERNAME] [-p PASSWORD] [-i] [-sttv STTV]
                        [-stvod STVOD] [-M] [-a] [-P] [-q ICONPATH] [-xs]
                        [-b BOUQUETURL] [-bd] [-bt] [-U] [-V]

e2m3u2bouquet.e2m3u2bouquet -- Enigma2 IPTV m3u to bouquet parser

  Copyright 2017. All rights reserved.
  Created on 2017-06-04.
  Licensed under GNU GENERAL PUBLIC LICENSE version 3
  Distributed on an "AS IS" basis without warranties
  or conditions of any kind, either express or implied.

USAGE

optional arguments:
  -h, --help            show this help message and exit
  -i, --iptvtypes       Treat all stream references as IPTV stream type.
                        (required for some enigma boxes)
  -sttv STTV, --streamtype_tv STTV
                        Stream type for TV (e.g. 1, 4097, 5001 or 5002)
                        overrides iptvtypes
  -stvod STVOD, --streamtype_vod STVOD
                        Stream type for VOD (e.g. 4097, 5001 or 5002)
						overrides iptvtypes
  -M, --multivod        Create multiple VOD bouquets rather than single VOD
                        bouquet
  -a, --allbouquet      Create all channels bouquet
  -P, --picons          Automatically download of Picons, this option will
                        slow the execution
  -q ICONPATH, --iconpath ICONPATH
                        Option path to store picons, if not supplied defaults
                        to /usr/share/enigma2/picon/
  -xs, --xcludesref     Disable service ref overriding from override.xml file
  -b BOUQUET_URL, --bouqueturl BOUQUET_URL
                        URL to download providers bouquet - to map custom
                        service references
  -bd, --bouquetdownload
                        Download providers bouquet (use default url) - to map
                        custom service references
  -bt, --bouquettop     Place IPTV bouquets at top
  -U, --uninstall       Uninstall all changes made by this script
  -V, --version         show program's version number and exit

URL Based Setup:
  -m M3UURL, --m3uurl M3UURL
                        URL to download m3u data from (required)
  -e EPGURL, --epgurl EPGURL
                        URL source for XML TV epg data sources

  -n PROVIDERNAME, --providername PROVIDERNAME
                        Host IPTV provider name

Config file based setup
                        No parameters required
                        The script will create a default config file
                        first time it is run, IPTV providers details
                        need to be entered into this file before
                        running the script again

Prerequisites

EPG-Importer plugin is required. This should be available in the plugin feed or already installed.

N.B. OpenPLi may need additional packages installed. If you attempt to run the script and get an error about missing modules please run

opkg update
opkg install python-image python-imaging python-argparse

How to install

  • FTP the e2m3u2bouquet.py to your enigma2 box (I would suggest to /etc/enigma2/e2m3u2bouquet)
  • SSH to your enigma2 box (using putty or something similar)
  • CD to the correct directory if you are not already there
cd /etc/enigma2/e2m3u2bouquet
  • Make script executable
chmod 755 e2m3u2bouquet.py

URL Based Setup

Run the script passing the url for your m3u file and the url for your providers XML TV data feed

./e2m3u2bouquet.py -m "http://provider_url/get.php?username=YOURUSERNAME&password=YOURPASSWORD&type=m3u_plus&output=ts" -e "http://provider_url/xmltv.php?username=YOURUSERNAME&password=YOURPASSWORD"

NB: you need to replace the username and password values X 2

If you are with a different provider the script should work but you will obviously need the m3u url (1st parameter) and XML TV url (2nd parameter) for your own provider. Please note the m3u file needs to be the "extended" version if you have the option.

Config File Setup

No parameters required, just run the script

./e2m3u2bouquet.py

The script will create a default config.xml file in /etc/enigma2/e2m3u2bouquet the first time it is run IPTV providers details need to be entered into this file before running the script again

Note: Multiple IPTV providers can be supported via the config.xml

For Picon Download Support

Add -P and optionally -q /path/to/picon/folder/ if you don't store your picons in the default location. The default location is /usr/share/enigma2/picon/ (internal flash) other enigma2 picon search location are /media/usb/picon/ & /media/hdd/picon/.

N.B. If you store the picons on HDD it was spin up whenever they are shown

./e2m3u2bouquet.py "http://provider_url/get.php?username=YOURUSERNAME&password=YOURPASSWORD&type=m3u_plus&output=ts" -e "http://provider_url/xmltv.php?username=YOURUSERNAME&password=YOURPASSWORD" -P

Specify all stream types to be IPTV

Default is DVB stream types for live channels and IPTV for VOD, all IPTV type streams may be required if you are unable to record channels.

./e2m3u2bouquet.py "http://provider_url/get.php?username=YOURUSERNAME&password=YOURPASSWORD&type=m3u_plus&output=ts" -e "http://provider_url/xmltv.php?username=YOURUSERNAME&password=YOURPASSWORD" -i

Keep VOD all in a single bouquet

./e2m3u2bouquet.py "http://provider_url/get.php?username=YOURUSERNAME&password=YOURPASSWORD&type=m3u_plus&output=ts" -e "http://provider_url/xmltv.php?username=YOURUSERNAME&password=YOURPASSWORD" -s

Uninstall

./e2m3u2bouquet.py -U

Help!

./e2m3u2bouquet.py --help

Importing EPG Data

  • Open EPG-Importer plugin (download it if you haven't already got it)
  • Select sources (Blue button on OpenVix)
  • Enable the source created by the script (listed under IPTV Bouquet Maker - E2m3u2bouquet)
  • Kick off a manual EPG import

Updating Channels

To update the channels simply run this script again. A scheduled script can be set up to automate this process (see below)

Automate channel updates (set up from SSH)

  • If your box doesn't already have cron then install it
opkg install busybox-cron
  • open crontab for editing
crontab -e

Once open press i to switch to INSERT mode enter the following (retype or ctrl-v to paste) This will automatically run the script at 06:00 & 18:00 every day

0 6,18 * * * /etc/enigma2/e2m3u2bouquet/e2m3u2bouquet.py -m "http://provider_url/get.php?username=YOURUSERNAME&password=YOURPASSWORD&type=m3u_plus&output=ts" -e "http://provider_url/xmltv.php?username=YOURUSERNAME&password=YOURPASSWORD"

or

0 6,18 * * * /etc/enigma2/e2m3u2bouquet/e2m3u2bouquet.py

Press ESC follwed by :wq to exit the cron editor and save the entry You can check the entry with the command below

crontab -l

(Depending on your box image installing nano opkg install nano may set it as the default editor which makes editing the crontab easier)

Automate Channel Updates (set up from box GUI)

  • Go to 'Menu -> Timers -> CronTimers
  • Select the required update frequency
  • For the command to run enter i.e. to run at 06:00 & 18:00 enter
0 6,18 * * * cd /home/root && ./e2m3u2bouquet.py
  • Ensure that cron Autostart is active

Custom Mapping

  • Run the script once. It will create provider_name-sort-current.xml
  • FTP provider_name-sort-current.xml to your machine and rename it provider_name-sort-override.xml
  • For custom bouquet order move the <category lines within <mapping> -> <categories>
  • To disable a bouquet change enabled="true" to enabled="false"
  • For custom channel ordering within a bouquet move the <channel lines within <mapping> -> <channels>
  • To disable a channel change enabled="true" to enabled="false"
  • To change the id used for XML EPG mapping update the tvg-id attribute
  • To change the service ref (e.g. to map to an existing satellite EPG feed) change the serviceRef attribute
    • For example to use the Channel 4 HD DVB-S EPG you would set the serviceRef to "1:0:1:52D0:814:2:11A0000:0:0:0" (part in bold SID:TID:NID:Namespace needs to match). If you match a DVB service and also set the streamUrl to blank the DVB service will replace the IPTV service
  • FTP provider_name-sort-override.xml to your box
  • Run the script again and the changes made will be applied

Change notes

v0.1

  • Initial version

v0.2

  • Updated to use providers epg, doesn't need reboot to take effect - so could be scheduled from cron job

v0.3

  • Complete restructure of the code base to some thing more usable going forward, incorporated Dougs changes to EPG data source
  • tvg-id now included in the channels
  • better parsing of m3u data
  • downloads m3u file from url
  • sets custom source to providers xml tv feed (as per Dougs v0.2)
  • fixed IPTV streams not playing / having incorrect stream type
  • option to make all streams IPTV type
  • option to split VOD bouquets by initial category
  • all parameters arg based so in theory works for other providers and can be croned
  • auto reloads bouquets
  • debug \ testrun modes

v0.4

  • Restructure (again) of code base to bring in some of dougs better structures
  • m3u file parsing updated
  • channel ordering based on m3u file, bouquet ordering alphabetically or custom.
  • create single channels and sources list for EPG-Importer. Only one source now needs to be enabled in the EPG-Importer plugin
  • Add Picon download option (thanks to Jose Sanchez for initial code and idea)
  • Better args layout and processing
  • Mutli VOD by default
  • Named provider support (= simplified command line)
  • Delimiter options for user defined parsing of the m3u file
  • Ability to chose own bouquet sort order

v0.4.1

  • Update service number to use numbers unlikely to be in use by existing sat services
  • Leave service number gaps between categories to reduce the effect of playlist additions cause the epg to get out of sync

v0.4.2

  • Fixed error for ACE and FLAWLESS users where ":" in category put the box into an infinite loop

v0.5

  • Custom mapping feature
    • Reorder bouquets
    • Reorder channels within bouquets
    • Disable entire bouquet or individual channels
    • Ability to change service reference (so that EPG from existing satellite service can be used)
    • Change tvg-id to match other xml epg feeds
    • Support unicode characters in playlist
    • Xml override file can set-up EPG-Importer config for different xmltv feeds
    • Single VOD bouquet now default (use -M for multiple VOD bouquets)
    • Option for all channels bouquet (-a)

v0.5.1

  • Stream Url no longer output to xml (replaced by clearStreamUrl). This means that custom override maps can be shared as they no longer contain username and passwords

v0.5.2

  • Fix bug where delimiter arguments weren't getting converted to ints

v0.5.3

  • Minor fixes

v0.5.4

  • Add nameOverride attribute to xml files to allow channel name or category name to be changed
  • Add option to use service references from providers bouquet file. See -b argument
  • Add SSL fix for some boxes (unconfirmed if working)
  • Improved service ref id generation logic to reduce (hopefully eliminate) id conflicts especially if override file is used
  • Add option -xs to stop service refs from override.xml file being used

v0.5.5

  • Minor fixes

v0.5.6

  • Minor fixes

v0.6

  • Better m3u parsing
  • Plugin integration

v0.6.1

  • Dedicated config directory '/etc/enigma2/e2m3u2bouquet'
  • Pre Python 2.7.9 SSL context workaround
  • Remove delimiter options
  • No longer uninstall on each run
  • Option to place IPTV bouquets at top or bottom '-bt'
  • Consistent channel numbering (best results when IPTV bouquets are set to top). Each new IPTV category will start numbering +100 from start of last category
  • [plugin] Add /picon option for download path
  • [plugin] Show last playlist update
  • [plugin] Add override service service refs' option
  • [plugin] Add IPTV bouquet position option
  • [plugin] Add option download providers bouquet (for custom service refs)

v0.6.2

  • Put epg-importer source in source cat for new epg-importer version

v0.6.3

  • Set user agent for downloads

v0.7

  • Added Config file based setup support
  • Support for multiple service providers

v0.7.1

  • Make sure comments are xml safe
  • Extract username and password from m3u url if they are not passed in
  • Set services to stream type '1' in epg config so that the epg can be imported if serviceapp is overriding stream type '4097' to exteplayer3
  • Minor fixes & tidy
  • Option for custom stream type for TV and VOD
  • Allow https & rtmp services
  • Unicode fixes
  • Url encoding fixes

v0.7.3

  • Fix issue where main screen showing no text on some skins
  • Add option to reset bouquets

v0.7.4

  • Extra checking to ensure that logos are actually images
  • Keep provider order from config file

v0.7.5

  • Additional stream url type checking (e.g. live or VOD)

v0.7.6

  • Add nocheck attribute for EpgImporter sources (fix for new EpgImporter version)
  • Add m3u8 VOD stream matching

v0.7.7

  • Set extensionless streams as live TV

v0.8

  • When providers bouquet is downloaded (-b or -bd option) now uses full service references instead of just the epg relevant part in case it's used for picon naming
  • Better multi provider handler e.g. if there is an issue with one provider it won't stop the script processing others
  • If vod categories are out of order in the playlist group together
  • Fix file naming issues with non alphanumeric characters
  • Much faster when using an override file :)
  • Don't retry failed picon downloads
  • Option to add placeholder channel in override file (to control channel numbering)
  • Allow channels to be moved between categories, use categoryOverride in the override file
  • All custom categories, use customCategory="true" in the override file
  • Add provider managed update support

Visit https://www.suls.co.uk/enigma2-iptv-bouquets-with-epg/ for further information on the script

e2m3u2bouquet's People

Contributors

dougmac avatar exampleorgz avatar shawpe avatar su1s avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

e2m3u2bouquet's Issues

All M3U entry will go to VOD category, so no EPG

Dear devs!

It would be great to have an example m3u to make sure i understand correctly how this works. Currently I have tvheadend, exporting both .m3u and xmltv files. The problem is that all of the imported channels flagged as VOD so it has the same Service ID, so EPG just cant figure out where to map the entries.

M3U Looks like this:

#EXTM3U 

#EXTINF:-1 tvg-id="52b7f4b895e8e2c0e831beb5c6c4fb04",Channel one 
http://user:[email protected]:9981/stream/channelid/955561810?profile=pass

#EXTINF:-1 tvg-id="477a92745a97497f54db2a01693cc790",Channel two
http://user:[email protected]:9981/stream/channelid/1955756615?profile=pass

XMLTV looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE tv SYSTEM "xmltv.dtd">
<tv generator-info-name="TVHeadend-4.2.3-19~g490b6f213-dirty" source-info-name="tvh-Tvheadend">
<channel id="52b7f4b895e8e2c0e831beb5c6c4fb04">
<display-name>Channel one</display-name>
</channel>
<channel id="477a92745a97497f54db2a01693cc790">
<display-name>Channel two</display-name>
</channel>
<programme start="20180420203000 +0200" stop="20180420210000 +0200" channel="52b7f4b895e8e2c0e831beb5c6c4fb04">
  <title lang="hun">Sample one</title>
  <sub-title lang="hun">Sample one sub</sub-title>
</programme>
<programme start="20180420210000 +0200" stop="20180420220000 +0200" channel="477a92745a97497f54db2a01693cc790">
  <title lang="hun">Sample two</title>
  <sub-title lang="hun">Sample two sub</sub-title>
</programme>
</tv>

Please give advice.
Thank You

0.7.1 b3 couple of issues

Firstly, when using the separate user/pass option, the plugin freezes with the spinner displayed if the provider name does not 100% match the supported list. ie rapidiptv is OK, rapid iptv is not OK. It does work OK if the user and pass is included in the URL.

2nd, if the M3U is empty for any reason, eg incorrect user or pass, then Enigma2 crashes with the following in the log

----Parsing m3u file----< 567.229>
< 567.230> [e2m3u2b] manual_update_callback Error: M3U file is empty. Check username & password
< 567.230> Traceback (most recent call last):
< 567.230> File "/usr/lib/enigma2/python/mytest.py", line 235, in processDelay
< 567.234> callback(*retval)
< 567.234> File "/usr/lib/enigma2/python/Plugins/Extensions/E2m3u2bouquet/menu.py", line 126, in manual_update_callback
< 567.238> Exception: M3U file is empty. Check username & password
< 567.239> [ePyObject] (CallObject(<bound method Session.processDelay of <main.Session instance at 0x732b5f08>>,()) failed)

Update on boot (plugin)

My provider was having server issues. When I rebooted box my box stopped on loading with the spinner and I couldn’t get past boot. I think this is because it was set to update on boot could we have a try and exept for update on boot?

I did manage to get out of boot by deleting the plugin folder.

Managed to create a debug log via talnet.

Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/twisted/internet/defer.py", line 310, in addCallbacks

File "/usr/lib/python2.7/site-packages/twisted/internet/defer.py", line 653, in _runCallbacks

File "/usr/lib/python2.7/site-packages/twisted/internet/base.py", line 441, in _continueFiring

File "/usr/lib/python2.7/site-packages/twisted/internet/base.py", line 671, in disconnectAll

--- ---
File "/usr/lib/python2.7/site-packages/twisted/python/log.py", line 103, in callWithLogger

File "/usr/lib/python2.7/site-packages/twisted/python/log.py", line 86, in callWithContext

File "/usr/lib/python2.7/site-packages/twisted/python/context.py", line 122, in callWithContext

File "/usr/lib/python2.7/site-packages/twisted/python/context.py", line 85, in callWithContext

File "/usr/lib/python2.7/site-packages/twisted/internet/unix.py", line 420, in connectionLost

exceptions.OSError: [Errno 2] No such file or directory: '/tmp/hotplug.socket'

Download providers bouquet (map custom service references) | do not work

USERNAME="{USERNAME}";
PASSWORD="{PASSWORD}";
bouquet="{BOUQUET_NAME}";
m3u_url="{SERVER_URL}get.php?username=$USERNAME&password=$PASSWORD&type=m3u_plus&output={OUTPUT_KEY}";
xml_url="{SERVER_URL}xmltv.php?username=$USERNAME&password=$PASSWORD"

python /etc/enigma2/e2m3u2bouquet/e2m3u2bouquet.py -bd -bt -M -n "$bouquet" -m "$m3u_url" -e "$xml_url";

This is my command line, everything works exempt "download providers bouquet" function (-bd)".
This is the output code:

********************************
Starting Engima2 IPTV bouquets v0.7.0
2018-02-14 14:14:57.975936
********************************


----Downloading providers bouquet file----

----Downloading m3u file----

----Parsing m3u file----
Completed parsing data...

----Creating bouquets----
bouquets created ...

----Creating EPG-Importer config ----
EPG-Importer config created...

----Reloading bouquets----
bouquets reloaded...

********************************
Engima2 IPTV bouquets created !
********************************

To enable EPG data
Please open EPG-Importer plugin..
Select sources and enable the new IPTV source
(will be listed as NexTV under 'IPTV Bouquet Maker - E2m3u2bouquet')
Save the selected sources, press yellow button to start manual import
You can then set EPG-Importer to automatically import the EPG every day

Notice the "Downloading providers bouquet file"?
Let's see what list the program tries to download:

Feb 14 14:23:30 daniele haproxy[30490]: *.*.*.*:47182 [14/Feb/2018:14:23:30.945] http get_php/get_php 0/0/10/21/+31 404 +187 - - ---- 1/1/1/0/0 0/0 {Mozilla/5.0 (Windows|} "GET /get.php?username=None&password=None&type=dreambox&output=ts HTTP/1.1"

Yes, username=None and password=None

That's why this function do not works.

picons

how to make the picons show on the infobar and servicelist
between they work on lcd4linux i don't know why

Issue running script

The is an issue running script if user has a "!" in there username/password comes back with "-sh: !: event not found"

parsing channels with xxx

hello
i found your app for iptv parsing m3u to enigma2 box
or i have wrong config or its bug ?
parsing xxx channels
after list is done, all is working, ony adults ch dont work
I use config to direct download m3u list to box
channel name is like
xxx: hustler hd

If i put from xtreame server full list
wget -O /etc/enigma2/iptv.sh "http://link........." && chmod 777 /etc/enigma2/iptv.sh && /etc/enigma2/iptv.sh

then all is working, but that is not that
i like your plugin

PollReactor' object has no attribute 'getThreadPool

Hi there,

Thank you for your plugin I have removed the old version and installed the new however I get this when I run a Manual update

[e2m3u2b] autostart 0 occured at 31.891234
[e2m3u2b] autostart 0 occured at 32.174213
[e2m3u2b] AutoStartTimer -> update
[e2m3u2b] AutoStartTimer -> get_wake_time
[e2m3u2b] next wake up time Thu Jan 1 00:59:59 1970 (now=Thu Jan 1 01:00:32 1970)
[e2m3u2b] Stating bouquet update because auto update bouquet at start enabled
[e2m3u2b] on_boot_start_check Error: 'PollReactor' object has no attribute 'getThreadPool'
[e2m3u2b] manual_update_callback Error: 'PollReactor' object has no attribute 'getThreadPool'

I have a blackhole 3.08c (latest) and my time and date are correct

can you please help?

Plugin not downloading M3U

This is an interesting one. The plugin will not download the M3U from one of my servers but if I invoke the e2m3u2bouquet.py from the command line, then it downloads the M3U just fine.

I'm only a Python novice and can't see anything but is there something different in the call from the plugin to the call from the command line?

Picons openwebif

Hi, first off, excellent script...really taken the pain out of trying to get iptv with epg working on my enigma2.

Slight issue, the script successfully downloads all the icons, they're visible and working fine on the box itself, but in the openwebif interface I'm not getting any icons for IPTV channels in the bouquets added by the script.
Not sure if I'm doing anything wrong, apart from that it works perfectly.
I use openatv if thats any help.

Cheers

epg missing for some channels

Hi Guys
I'm opening this on behalf of some users on e2comm forum who are reporting the issues
https://enigma2community.com/thread-450-post-2173.html#pid2173

Summary - not all channels are getting the EPG data.
If I use Perfect Player on android and select the EPG source given by my provider, I get EPG for all channels.
When I select my provider (it rhymes with the American word for 'Taxi') in the Suls extension I don't get EPG for some channels... eg the Arabic Sports channels 1-11. It creates the source in EPGImporter and I have selected it.

Yes the above post is whats happening with epg its importing epg on smart iptv app but subscript isn't pulling all epg channels for Arab sports or Portugal sports were it does using smart iptv app , it seems to only give UK channels is that correct ?

I am not able to test this myself as I don't have the provider referenced

Regards
Tommy

Improvement: Add rtsp support as included example

Lots of CCTV NVR's only support rtsp:
This would allow users who have rtsp CCTV to host there own playlist and this then allows CCTV to be viewed on the box using the same script using the config file

Example M3u below:
https://raw.githubusercontent.com/stingray82/e2m3u2bouquet-tools/master/CCTV-M3U-Example/CCTV.m3u

Code Changes Required:
Change Line 908
elif 'http:' in line or 'https:' in line or 'rtmp:' in line:
to
elif 'http:' in line or 'https:' in line or 'rtsp:' in line or 'rtmp:' in line:

v.0.8 + config.xml

Hello i want to inform version 0.8 no read my old
config.xml in /etc/enigma2/e2m3u2bouquet.
if i use vv0.7.7 my config.xml working well.

some news to add in config.xml on 0.8 ?

Feature Request: Multiple provider mapped to a single channel

thanks for the great open source app. have a question about how exactly multiple providers work. are we able to set this up in a fashion where multiple service providers hosting the same content can be mapped to a single channel?

for example, if I have three separate IPTV sources for ESPN set to channel 100, would I be able to switch between providers without switching channels? Bonus points if it auto switches if a provider is unavailable to stream, based on priority.

import egp data does not work

Import epg data from iptv provider does not work. When I use epg importer no sources found. In android device the epg import works so it is a bug.

Command Line Users don't have bouquets reloaded in 0.8+

If operating from the command line on from another script, users don't get the bouquets reloaded as they never call reload_bouquets() like they do if using a config.xml

This can be successfully resolved by adding in at line 1627 the following two commands:
reload_bouquets()
display_end_msg()

First one to reload and the second to display your end message I assumed this is how you intended it, but got lost in the if else?

Without Modification:
image
With Modification:
image

Added Code in Situ:
image

Custom bouquet names still forces 'IPTV - ' prefix

nameOverride for bouquet names still forces 'IPTV -' prefix for the bouquet name. Some users may prefer bouquet names in a different format. e.g. Sports (IPTV), Movies (IPTV) rather than IPTV - Sports, IPTV - Movies.

When using nameOverride, bouquet should be named just with the contents of the override and not include the 'IPTV - ' prefix text.

error with DESCRIPTION at the end of Stream url

Hello,
at first thanks for your script. Great tool!

There is an issue by creating the bouquet. If the tool creates the bouquet an Channel is written in two lines for Example Sky Sport Football HD from UK
#SERVICE 4097:0:1:8d15:89fc:2784:0:0:0:0:httpurl:UK:: Sky Sport Football HD
#DESCRIPTION UK:: Sky Sport Football HD

Now the bouqued can't played from vu with VTI 14.
If you would change line 584 in the e2m3u2bouquet.py from
f.write("#SERVICE {}:{}:{}\n"

to
f.write("#SERVICE {}:{}\n"

the first line ends with the httpurl and all works fine.
#SERVICE 4097:0:1:8d15:89fc:2784:0:0:0:0:httpurl
#DESCRIPTION UK:: Sky Sport Football HD

Is it possible
e2m3u2bouquet.zip

to fix it in a next release? attached the changed .py file.

Best regards

Module object has no attribute 'SSLcontext'

Hi,

I have an older openvix box that cannot be updated but when I install the suls apk i get this error:

Some plugins are not available:
Extensions/E2m3ubouquet ('module' object has no attribute 'SSLcontext')

Support for Non-HTTP stream URLs

First of all, tremendous job in putting this all together!

One enhancement I'd like to see is support for HTTPS, RTMP and maybe other stream types in M3U playlists. In the current version, URLs not prefixed by HTTP are skipped.

Having just peaked at the code, I think this could be added rather easily through minor changes in the core parsing function.

I'd really appreciate if you'd find the time to implement this.
Thanks very much in advance for considering.

BR,
K.

Feature Request: Sorting and hiding with multi VOB function.

Currently its only possible to apply customizations for channels. Could you consider to also extent this function to VOB bouquets?
When using Muli VOB setting, the bouquet list get populated with a lot of bouquets that i don't need.
I would really like to hide and sort the Mulit VOB bouquet entry's so i get a cleaner favorites list.

The sorting of individual VOB streams is not needed, just the bouquets would be enough.
Maybe this could be implemented with an override file like? :

e2m3u2bouquet\Providername-sort-override-VOB.xml

Plugin Option: Identify Catch-up Channels Like oottpxx mod and Identify with !!!

Would it be possible to have the following officially added to e2m3ubouquets as a plugin option and command line argument i.e -catchup and it does the same identify catchup channels with a !!! if oottppxx would be ok with this?

It is a really good mod, I've used it myself and think it would be handy to have it update with e2m3u, Heinz is a very useful plugin for enigma2 it makes it compete very well with android boxes

The code can be found here for 0.77 I don't believe he has released one since 0.8
https://raw.githubusercontent.com/oottppxx/enigma2/master/mods/e2m3u2bouquet/e2m3u2bouquet-v0.7.7.py

Happy to test any versions

Some TS streams don't end in <dot>ts and are detected as VOD

At least one provider has TS streams ending in .2ts instead of .ts. That makes them being detected as VOD, missing EPG.

The 1 character fix is to modify the check:
if (parsed_stream_url.path.endswith('.ts') or parsed_stream_url.path.endswith('.m3u8'))
to
if (parsed_stream_url.path.endswith('ts') or parsed_stream_url.path.endswith('.m3u8')) \

Special meaning of "VOD.*" categories breaks bouquet creation

This is a bug against v0.8.2 - didn't check v0.8.3 yet.

Helping someone, I've seen a stream with the following in the M3U: group-title="VOD | 24/7"

This breaks with "e2m3u2bouquet.py: KeyError(u'VOD | 24/7',)", and I tracked it down to line " cat_title_override = self._category_options[cat].get('nameOverride', '')" in save_map_xml.

I could make the error go away by changing either "cat.startswith('VOD -')" line immediately above to startswith('VOD') or by doing the inverse somewhere in parse_m3u.

However, there are quite a few number of these instances, and it's hard to know exactly which meaning each one has, as there's special meaning in seeing the string "VOD" in group-title and then also making "VOD -" as a special signal to the rest of the code; this shouldn't be done like it is, with the risk of stuff breaking (as in the example), but by setting some property on the category_options if we really want to handle VOD differently - don't use/overload category names for any signalling.

Allow plugin to be skinned via epg importer screens

A lot of skinners have skinned epg-importer for their skins. Therefore I think you should include this in your plugin.py.

EPGImportConfig and EPGImportLog are the latest equivalent screen for epg-importer.
EPGMainSetup and XLMTVImportLog are the old legacy xmltv importer names.

In
class E2m3u2bConfig(ConfigListScreen, Screen):

add in the self.skinName
...
...
def init(self, session, args = None):
self.session = session
Screen.init(self, session)
self.skinName = ["E2m3u2bConfig", "EPGImportConfig", "EPGMainSetup"]

class E2m3u2bLog(Screen):
...
....
def init(self, session):
self.session = session
Screen.init(self, session)
self.skinName = ["E2m3u2bLog", "EPGImportLog", "XMLTVImportLog"]

Issue in some ServiceRef

hello in some SRef have problem. on dhis way we lose a picon but still working EPG.

Original (9)
1:0:19:106A:2008:FBFF:820000:0:0:0:

from .xml (e2m3u2bouquet)
1:0:1:106a:2008:fbff:820000:0:0:0

from .tv (e2m3u2bouquet)
1:0:1:106a:2008:fbff:820000:0:0:0

Crashing while trying to parse m3u file

Hello,

I have this issue (Both on V.0.8.3 & previous 0.8.2)

I Installed the plugin normally,
Inserting my username pass etc.
Everything seems ok as it downloads the m3u file,
but when it comes to parsing m3u file it stays on that screen for about 3-4 mins trying
(the gear indicating that the box is trying and busy its there)
And then everytime it crashes my box and E2 restarts and nothing has happened.
I disabled the epg import feature also, updated my box but still the same.
My m3u file is fine cause when i generate the links with a html file that i found on a forum and import them on userbouquet.favourites.tv manually they work fine (as on VLC/PC)

PS* they used to work fine for about one year with the same provider.
(the only thing that was changed was the m3u file size the last time)

M3U file seems to be really big maybe thats the issue (?):
16MB
126763 - lines
10591 - Live TV streams
52790 - VOD

My Box:
Dm800se clone on Latest openPLI7.1 (Same issue with openPLI 7 )

TypeError: 'NoneType' is not iterable

root@vuduo2:~# /etc/enigma2/e2m3u2bouquet.py -m "http://freeiptv.io/m3u/r2g6e_normal.php?c=AL"

********************************
Starting Enigma2 IPTV bouquets v0.8.2
2018-12-28 14:27:27.011860
********************************


**************************************
E2m3u2bouquet - Command line based setup
**************************************

e2m3u2bouquet.py: TypeError("argument of type 'NoneType' is not iterable",)
                  for help use --helproot@vuduo2:~#
root@vuduo2:~#

Import Error

Hi, could you help with this. Many thanks.

root@vusolo2:~# cd /etc/enigma2/e2m3u2bouquet
root@vusolo2:/etc/enigma2/e2m3u2bouquet# ./e2m3u2bouquet.py -n FAB -u removed-p removed
Traceback (most recent call last):
File "./e2m3u2bouquet.py", line 25, in
from PIL import Image
ImportError: No module named PIL
root@vusolo2:/etc/enigma2/e2m3u2bouquet#

Wrong SID parsing

USERNAME="{USERNAME}";
PASSWORD="{PASSWORD}";
bouquet="{BOUQUET_NAME}";
m3u_url="{SERVER_URL}get.php?username=$USERNAME&password=$PASSWORD&type=m3u_plus&output={OUTPUT_KEY}";
xml_url="{SERVER_URL}xmltv.php?username=$USERNAME&password=$PASSWORD";
b_url="{SERVER_URL}get.php?username=$USERNAME&password=$PASSWORD&type=dreambox&output={OUTPUT_KEY}";

python /etc/enigma2/e2m3u2bouquet/e2m3u2bouquet.py -bt -M -n "$bouquet" -m "$m3u_url" -e "$xml_url" -bd -b "$b_url";

Let's have a look an example channel on a generated bouquests:

#SERVICE 1:0:1:106A:2008:FBFF:820000:0:0:0:http%3a//CENSORED.me%3a80/live/TEST/TEST/6867.ts:CHANNEL1
#DESCRIPTION CHANNEL1

It has wrong service id, that's the correct one:

#SERVICE 1:0:19:106A:2008:FBFF:820000:0:0:0:http%3A//CENSORED.me%3A80/live/TEST/TEST/6867.ts
#DESCRIPTION CHANNEL1

The third digit may not be 1.
I'm writing from Italy, we really need this plugin due to missing good epg servers for our channels.
I would like to support your work.
Please fix this and tell me how to pay something for your work.
Thanks

/picon location not listed in IPK

Hi guys
when running v0.6 of the IPK the /picon location is not listed as an option.
This location is used by wooshbuild one of the more popular images in use on E2 boxes and is one of the default picon locations generally.

just create some bouquets?

Hello,

is it possible to to generate just some bouquets? For example I just want to have the bouquets UK and US. At the moment I have to delete all other bouquets manually.

Best regards

Unhandled exception

Hi, got following unhandled exception which resulted in crash and reboot. Would be nice if this was handled maybe via just an error message!

----Downloading providers file----<288172.362> 
<288172.589> 
----Downloading providers bouquet file----<288172.589> 
<288176.021> [gRC] main thread is non-idle! display spinner!
<288222.654> Traceback (most recent call last):
<288222.654>   File "/usr/lib/enigma2/python/Plugins/Extensions/E2m3u2bouquet/plugin.py", line 303, in on_timer
<288222.664>   File "/usr/lib/enigma2/python/Plugins/Extensions/E2m3u2bouquet/plugin.py", line 335, in do_update
<288222.664>   File "/usr/lib/enigma2/python/Plugins/Extensions/E2m3u2bouquet/e2m3u2bouquet.py", line 1128, in main
<288222.666>   File "/usr/lib/enigma2/python/Plugins/Extensions/E2m3u2bouquet/e2m3u2bouquet.py", line 145, in download_bouquet
<288222.667> IOError: [Errno socket error] timed out
<288222.667> [ePyObject] (CallObject(<bound method AutoStartTimer.on_timer of <Plugins.Extensions.E2m3u2bouquet.plugin.AutoStartTimer instance at 0x63cb9490>>,()) failed)

Thanks for all your hard work on this. It's an excellent plugin.

EPG with necro/eclipse

Hi, thanks for your work on this great script. I had a small issue getting it to work with NecroIPTV (Eclipse).

With the EPG, the channel list generated looks like this and fails to register on epg-import. gives no errors, but "0 events".
<channel id="SkySportsNews.uk">1:0:1:8854:61ed:f733:0:0:0:0:http%3a//example.m3u8</channel> <!-- UK: Sky Sports News HD -->

however it does work if I put the correct stream url in, which is in the bouquets obviously:
<channel id="SkySportsNews.uk">1:0:1:8854:61ed:f733:0:0:0:0:http%3a//watch.eclipseiptv.com%3a80/live/username/password/4221.ts</channel> <!-- UK: Sky Sports News HD -->

Using vu+ uno w/OpenViX

HTML encoded URL does not work

The generated html url encoded service lines in the bouquet does not work on openpli. The same url does also not work in VLC! The same url with the replaced HTML codes (like %3A= : or %21= !) works in vlc without a problem

lowercase picon

Awesome script - thank you very much.
Possibly not an issue (opposite to #49) - but maybe there are some hints anyway.
Openwebif shows the picons, VTI does not, unless I rename them exactly like the Channel name.
So I guess I have to rename stuff like "sky1uk.png" to "Sky 1 UK.png" - then it shows on the box too.
Or better solutions?
cheers and thanks again!

Bad stream names when stream names also include commas

My proposed patch:

`@@ -898,9 +898,9 @@
service_dict[channel[i].lower().strip(' =')] = channel[i + 1].decode('utf-8')

\ # Get the stream name from end of line (after comma)
- stream_name_pos = line.rfind(',')
+ stream_name_pos = line.rfind('",')
if stream_name_pos != -1:
- service_dict['stream-name'] = line[stream_name_pos + 1:].strip().decode('utf-8')
+ service_dict['stream-name'] = line[stream_name_pos + 2:].strip().decode('utf-8')

\ # Set default name for any blank groups
if service_dict['group-title'] == '':
`

Of course this just trades the assumption that there are no commas on stream names for the assumption that the stream name separation from the previous field assignment will have no spaces... And that stream names don't include quotes followed by commas.

EPG defense

Well done guys. Just keeps getting better.

I have spotted a bug. This could be the python interpreter/complier or linux codebase on enigma2 boxes…

For some providers the Epg.xml source file can and often does contain tags all on one line , that is to say that tags are not delimited with CR and LF chars. So effevtively the epg guide is one huge long line. This is a problem as epg events are not parsed. The xml/etree parser seems to give up. What this means is that a seemingly perfect and legal epg.xml source file containing the channel IDs and then all the event info, is not parsed correctly and thus not displayed on the EPG for enigma2 boxes. This IS NOT a limitation of your script however there is an improvement that can be made to your script so that it can implement a defensive measure against these "bad" epg source files.

I have confirmed this on vix and ipab builds and confirmed the issue.

The fix is to ensure that there is a CR and LF after all closing tags. That means…

</Channel>
[insert CR and LF here , after EVERY tag instance; must be BOTH CR and LF because just one wont do it]
   ...
</Programme>
[insert CR and LF here , after EVERY tag instance; must be BOTH CR and LF because just one wont do it]

This seems to be a problem on some linux boxes but not all.

I used "sed" to insert the CR and LF characters after all occurrences of any of these above two tags. I simply put this into your python script. Anyway, after this all.worked fine. Could be done just as simply using regex in python:-

sed 's/<\/[^>]*>/&\n/g' <epg-filename-before> <epg-filename-after>

In fact, that command will format every ending tag, so much neater. And this really does fix the problem albeit a workaround rather than fixing the root cause. Hence I call this a defensive measure.

Please could you add this defensive measure so that ‘bad’ EPG source files can be processed , straight after the code that creates the epgimport files. What i did was download the epg epg source locally and then apply sed on it. Of course the .sources file your script creates, will need to then refer to the local epg file rather than the http://…. remote source file.

I used the twizted provider and grabbed the EPG before case (attached) which failed, then ran the above fix, modified the epg import files to point to the "after" case, and EPG then fully loaded.

EDIT: Wont let me upload the EPG i d/l from twizted provider.

UnicodeDecodeError

I get this error when script is trying to parse a non utf-8 m3u file:

----Parsing m3u file----
Traceback (most recent call last):
File "./e2m3u2bouquet.py", line 1692, in
sys.exit(main())
File "./e2m3u2bouquet.py", line 1680, in main
raise e
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe5 in position 5: invalid continuation byte

Feature Request: Split Live & VOD updates

Hello

Could you please add an option to update only the VOD content separately from channels as normally it's the one where we have more changes (New items) then Channels

Thank you

Service mapping

If move service to another category, it is always at the end of the list

Cron job not set in v0.6

In the IPK I set the Automatic bouquet update (schedule): to Yes and update interval to 6 hours but I do not see any additional lines added to /etc/cron/crontabs/root file as would be expected

picons from m3u

hello, fantastic script - the first thing that's actually worked for me after messing about for days, epg and all.

I was just wondering if the script would be able to extract the tvg-logo from
#EXTINF:-1 tvg-id="channel" tvg-name="name" tvg-logo="https://website/logo.png" group-title="thing",Name
instead of looking in a local picons folder

thank you

Using 0.7.1 beta got following error

You may already know this but when I tried pre-release 0.7.1 beta (including latest .py update dated 24/02/18), but keep getting following error when going into "Providers" menu, it crashes few seconds after going into "Providers"

< 128.540> [Skin] Parsing embedded skin <embedded-in-'E2m3u2b_Providers'>
< 128.542> [Skin] processing screen <embedded-in-'E2m3u2b_Providers'>:
< 128.574> [Skin] processing screen SimpleSummary:
< 128.581> Traceback (most recent call last):
< 128.581> File "/usr/lib/enigma2/python/Plugins/Extensions/E2m3u2bouquet/providers.py", line 95, in prepare
< 128.582> File "/usr/lib/enigma2/python/Plugins/Extensions/E2m3u2bouquet/providersmanager.py", line 36, in read
< 128.583> File "/usr/lib/enigma2/python/Plugins/Extensions/E2m3u2bouquet/providersmanager.py", line 80, in migration
< 128.583> AttributeError: ProvidersConfig instance has no attribute 'provider_name'
< 128.584> [ePyObject] (CallObject(<bound method E2m3u2b_Providers.prepare of <class 'Plugins.Extensions.E2m3u2bouquet.providers.E2m3u2b_Providers'>>,()) failed)

Before the BSOD, it just displays "please wait"

Import of split VODs will not show up in <provider>-sort-current.xml

When importing a large iptv m3u_plus bundle with VOD in many different languages (incl XXX), without -M option all pops into the VOD category, with -M option I get nice per country channel VOD bundles.
But, as I do not want to present the languages that I do not understand nor the triple x,
I really need to filter them.

But even with -M option active, there is only one VOD category in the -sort-current.xml

The bouquets:
IPTV - VOD - (V|EN) Movies - UK
IPTV - VOD - (V|SC) Movies - SC
... + 40 VOD more.

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.