tellytv / telly

An IPTV proxy
MIT License
760 stars 104 forks source link

Telly outputs error if XML contains <date> tag with "1991|2001" #182

Closed BEisem closed 6 years ago

BEisem commented 6 years ago

telly release with the issue:

telly, version 1.1.0.2 (branch: dev, revision: f1de7f04430f9f6d35ad7caf55d4d5360a1d681c) build user: root@231f8db4ee44 build date: 20180822-04:17:38 go version: go1.10.3

Last working telly release (if known):

Operating environment (Docker/Windows/Linux/QNAP, etc.):

MacOS 10.12.6

Description of problem:

The EPG from iptv-epg contains a with the following entry:

<programme start="20180904033000 +0000" stop="20180904040000 +0000" channel="BTSport2.uk">
    <title lang="en">Arsenal Classics</title>
    <desc lang="en">Classic Arsenal matches from the football archives, featuring a memorable league clash with Aston Villa (1991) and a League Cup third round win over Manchester United . 3/8</desc>
    <date>1991|2001</date>
    <category lang="en">Sport</category>
    <icon src="https://images.metadata.sky.com/pd-image/b24bc05c-92cd-42b6-be67-45f90c60b521/16-9"/>
    <episode-num system="xmltv_ns">.24.</episode-num>
    <subtitles/>
  </programme>

As a result, when launching Telly, it outputs the following error:

INFO[2018-08-31T17:09:02-04:00] telly is preparing to go live (version=1.1.0.2, branch=dev, revision=f1de7f04430f9f6d35ad7caf55d4d5360a1d681c) 
INFO[2018-08-31T17:09:02-04:00] Loading M3U from http://iptv-epg.com/REDACTED.m3u 
INFO[2018-08-31T17:09:03-04:00] Loading XMLTV from http://iptv-epg.com/REDACTED.xml 
ERRO[2018-08-31T17:09:04-04:00] Could not decode xmltv programme              error="the type Date field of date is not a time, value is: 1991|2001"
ERRO[2018-08-31T17:09:04-04:00] error when parsing EPG                        error="the type Date field of date is not a time, value is: 1991|2001"
ERRO[2018-08-31T17:09:04-04:00] error when preparing provider                 error="the type Date field of date is not a time, value is: 1991|2001"
ERRO[2018-08-31T17:09:04-04:00] error when processing provider                error="the type Date field of date is not a time, value is: 1991|2001"
INFO[2018-08-31T17:09:04-04:00] telly is live and on the air!                
INFO[2018-08-31T17:09:04-04:00] Broadcasting from http://192.168.7.59:6077/  
INFO[2018-08-31T17:09:04-04:00] EPG URL: http://192.168.7.59:6077/epg.xml

It looks like the "1991|2001" in the tag is confusing telly. I'm not sure why that is being provided as a date. It was only happening for one channel, so I removed that channel from the m3u and xml in iptv-epg, and that solved the error. But I think telly should be more robust and should be able to recover from such date entries.

Contents of telly.config.toml [if you're using a version above 1.1]:

THIS SECTION IS REQUIRED

[IPTV] Streams = 6 # number of simultaneous streams that the telly virtual DVR will provide

This is often 1, but is set by your iptv provider; for example,

                        # Vaders provides 5

Starting-Channel = 10000 # When telly assigns channel numbers it will start here XMLTV-Channels = true # if true, any channel numbers specified in your M3U file will be used. FFMpeg = true # if this is uncommented, streams are buffered through ffmpeg;

ffmpeg must be installed and on your $PATH

                        # if you want to use this with Docker, be sure you use the correct docker image

if you DO NOT WANT TO USE FFMPEG leave this commented; DO NOT SET IT TO FALSE

THIS SECTION IS REQUIRED

[Log] Level = "info" # Only log messages at or above the given level. [debug, info, warn, error, fatal] Requests = true # Log HTTP requests made to telly

THIS SECTION IS REQUIRED

[Web] Base-Address = "192.168.7.59:6077" # Set this to the IP address of the machine telly runs on Listen-Address = "192.168.7.59:6077" # this can stay as-is

THIS SECTION IS OPTIONAL ========================================================================

[SchedulesDirect] # If you have a Schedules Direct account, fill in details and then

UNCOMMENT THIS SECTION

Username = "REDACTED" # This is under construction; Vader is the only provider Password = "REDACTED" # that works with it fully at this time

AT LEAST ONE SOURCE IS REQUIRED

DELETE OR COMMENT OUT SOURCES THAT YOU ARE NOT USING

NONE OF THESE EXAMPLES WORK AS-IS; IF YOU DON'T CHANGE IT, DELETE IT

[[Source]] Name = "" Provider = "IPTV-EPG" Username = "REDACTED" # From http://iptv-epg.com/[M3U-Identifier].m3u Password = "REDACTED" # From http://iptv-epg.com/[XML-Identifier].xml

THE FOLLOWING KEYS ARE OPTIONAL HERE; IF YOU"RE USING IPTV-EPG YOU'FE PROBABLY DONE YOUR

FILTERING THERE ALREADY

Filter = ""

FilterKey = ""

FilterRaw = false

Sort = ""

END TELLY CONFIG


**Command line used to run telly [if applicable]:**
- REMEMBER TO DELETE ANY CREDENTIALS IN CONFIG FILES OR COMMAND LINES

./telly

sparkison commented 6 years ago

Getting exact same results. Any solution to this?

sparkison commented 6 years ago

Looks like this is related to this issue: XMLTV parser fails on broken date #180

sscraggles commented 6 years ago

Seeing the same thing here, currently broken for me with Vaders


time="2018-09-05T05:20:56Z" level=info msg="Loading M3U from http://api.vaders.tv/vget?username=REDACTED&password=REDACTED&vod=false&format=ts"
time="2018-09-05T05:21:00Z" level=info msg="Loading XMLTV from http://vaders.tv/p2.xml.gz"
time="2018-09-05T05:21:00Z" level=info msg="File (http://vaders.tv/p2.xml.gz) is gzipp'ed, ungzipping now, this might take a while"
time="2018-09-05T05:21:04Z" level=error msg="Could not decode xmltv programme" error="the type Date field of date is not a time, value is: 1991|2001"
time="2018-09-05T05:21:04Z" level=error msg="error when parsing EPG" error="the type Date field of date is not a time, value is: 1991|2001"
time="2018-09-05T05:21:04Z" level=error msg="error when preparing provider" error="the type Date field of date is not a time, value is: 1991|2001"
time="2018-09-05T05:21:04Z" level=error msg="error when processing provider" error="the type Date field of date is not a time, value is: 1991|2001"
time="2018-09-05T05:27:40Z" level=info msg="telly is preparing to go live (version=, branch=, revision=)"
time="2018-09-05T05:27:40Z" level=debug msg="Build context (go=go1.11, user=, date=)"
robbiet480 commented 6 years ago

Fixed at https://github.com/tellytv/telly/commit/cec8d730177b15a6d1f60d879d2db493f9de51a3. Will be released as 1.1.0.3.

robbiet480 commented 6 years ago

Here

JaswinderJohal commented 5 years ago

I am still getting following error any idea??

INFO[2019-04-15T23:24:40Z] telly is preparing to go live (version=1.1.0.3, branch=dev, revision=cec8d730177b15a6d1f60d879d2db493f9de51a3) INFO[2019-04-15T23:24:40Z] Loading M3U from http://lttv.watch:25461/get.php?username=REDACTED&password=REDACTED&type=m3u_plus&output=ts INFO[2019-04-15T23:24:45Z] Loading XMLTV from http://lttv.watch:25461/xmltv.php?username=REDACTED&password=REDACTED ERRO[2019-04-15T23:24:47Z] Could not decode xmltv programme error="parsing time \"-00011130000000 +0000\" as \"20060102150405 -0700\": cannot parse \"-00011130000000 +0000\" as \"2006\"" ERRO[2019-04-15T23:24:47Z] error when parsing EPG error="parsing time \"-00011130000000 +0000\" as \"20060102150405 -0700\": cannot parse \"-00011130000000 +0000\" as \"2006\"" ERRO[2019-04-15T23:24:47Z] error when preparing provider error="parsing time \"-00011130000000 +0000\" as \"20060102150405 -0700\": cannot parse \"-00011130000000 +0000\" as \"2006\"" ERRO[2019-04-15T23:24:47Z] error when processing provider error="parsing time \"-00011130000000 +0000\" as \"20060102150405 -0700\": cannot parse \"-00011130000000 +0000\" as \"2006\"" INFO[2019-04-15T23:24:47Z] telly is live and on the air!
INFO[2019-04-15T23:24:47Z] Broadcasting from http://0.0.0.0:6077/
INFO[2019-04-15T23:24:47Z] EPG URL: http://0.0.0.0:6077/epg.xml

chazlarson commented 5 years ago

Can you provide a copy of that problem XML file? Also, just for good measure maybe try it with the current latest release [1.1.0.5].

JaswinderJohal commented 5 years ago

xmltv.txt

JaswinderJohal commented 5 years ago

i tried 1.1.0.5 but it doesnt work either. it throws following error:

ERRO[2019-04-16T00:38:07Z] Error while serving request error="Error #01: error when getting XMLTV file: could not decode xmltv programme: parsing time \"-00011130000000 +0000\" as \"20060102150405 -0700\": cannot parse \"-00011130000000 +0000\" as \"2006\"\n" fields.time="2019-04-16T00:38:07Z" ipAddress=192.168.86.148 latency=6.123246188s method=POST path=/api/guide_sources status=500 userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"

chazlarson commented 5 years ago

This doesn't look like something telly can deal with.

Here's a working programme entry from that file:

<programme start="20190415013500 +0100" stop="20190415015000 +0100" channel="domo.plus.pl" >
<title>Sztukomaniak, odc. 2</title>
<desc></desc>
</programme>

And the one that's causing the problem:

<programme start="20190415015000 +0100" stop="-00011130000000 +0000" channel="domo.plus.pl" >
<title>Wakacyjne domy z Marią Semczyszyn 2, odc. 9</title>
<desc>DELETED FOR SPACE</desc>
</programme>

Conpare the good and bad stop times. Both the start and stop times are supposed to be a time plus a timezone offset, so "-00011130000000 +0000" just isn't a valid value for that field.

Whoever is providing this EPG file needs to fix it.