bebo-dot-dev / m3u-epg-editor

a python m3u / epg optimizer
The Unlicense
125 stars 28 forks source link

[Bug] Generated XML Cannot be Used (original.xml) #35

Closed ap-rose closed 4 years ago

ap-rose commented 5 years ago

Script will function with source http://example.com/source.xml

Script will not function with output original.xml

Error

2019-10-13T11:54:20.768719 creating new xml epg for 39 m3u items
2019-10-13T11:54:20.902093 epg creation failure: no element found: line 1, column 2684307

line 1, column 2684307 is the end of the document

line 1, column 2684307 <programme start="20191013174500 -0400" stop="20191013193000 -0400" channel="DisneyJr.us" ><title>Bolt</title><desc>Bolt believes he has superpowers due to living his life on the set of an action TV s

As you can see the EPG is cut short and tags are not closed.

bebo-dot-dev commented 5 years ago

The file with the filename original.xml is the unmodified EPG xml file downloaded from the url described by the --epgurl, -e argument.

Are you saying that the xml in this file is not well formed?

ap-rose commented 5 years ago

Truly apologize about the delay, My xml file is being cut short.

File ending in <programme start="20191013174500 -0400" stop="20191013193000 -0400" channel="DisneyJr.us" ><title>Bolt</title><desc>Bolt believes he has superpowers due to living his life on the set of an action TV s

When it should be like such

<programme start="20191013174500 -0400" stop="20191013193000 -0400" channel="DisneyJr.us" ><title>Bolt</title><desc>Bolt believes he has superpowers due to living his life on the set of an action TV s</desc>
</programme>
</tv>

I am not sure why my file is being cut short. It's a 120MB file would that have anything to do with it ?

bebo-dot-dev commented 5 years ago

120MB is a reasonably large file so this could be a factor. The content of the XML is also worth consideration because it looks unlikely that your suggested XML element is complete; it's possible that there is something in the XML after action TV s that is causing an issue.

If EPG XML file download was failing in an unrecoverable way, I would expect you would be seeing an error at XML download time but that's not happening. Given what you have reported so far you're seeing an error later when the XML has been downloaded and is being processed.

It's difficult to say more because I'm unable to see the complete XML nor am I able to run any debug tests downloading this file. I suggest you run your own tests downloading this file manually with a GET request in a browser and then compare this manually downloaded file against the file downloaded by the python script. It is possible that the remote server is sending incomplete data effectively truncating the response.

If this is an open EPG XML file that has no username / password protection, add another comment including the URL and I'll run some tests with that here.

bebo-dot-dev commented 5 years ago

I don't know if there's anything else to add here, add more info if you have any / respond to the last comment. This issue will be closed if it remains as-is.