bebo-dot-dev / m3u-epg-editor

a python m3u / epg optimizer
120 stars 27 forks source link

original.channels.txt blank #23

Closed sabre6 closed 5 years ago

sabre6 commented 5 years ago

Great script, thank you.

Not a bid deal, but this file is always blank for me.

Also, often the output.xml file hits an error (usually a line in the original.xml) when i run it by cron job, but when i do it manual it always seems to work.

bebo-dot-dev commented 5 years ago

Hi @sabre6 thanks.

hmm, original.channels.txt always empty:

https://github.com/jjssoftware/m3u-epg-editor/blob/master/m3u-epg-editor.py#L439-L445

That is sort of odd. The only thing I can see that might cause this behaviour is if the source m3u contains no entries at all or if something went really wrong with parsing the entries in the source m3u. Given that you didn't report any other issues with m3u processing I think that discounts both of these possibilities.

A common problem with epg processing via the source epg xml is when there's something wrong in the source original.xml that prevents nodes in that xml doc being traversed. When this occurs you should see epg creation failure: <some exception stack trace> output to the log / to the console.

I know that these epg xml content type errors can be hard to track because you often find that by the time you get to run the script manually, the problem has gone away because the IPTV service provider has fixed the problem that was present earlier in their epg xml. If you're lucky enough / quick enough to see this type of problem occur and you can reproduce it via manual script execution, that would enable you to run the problematic xml through a syntax checker to see exactly where the problem is. But even if you were to get that far to see the exact cause of the problem, ultimately there's still not much that can be done to cope with an invalid xml document being served up by the provider.

The only other thing that might be worth mentioning is to ensure that the account that runs the cron job has the relevant permission to write files to the specified file system location.

sabre6 commented 5 years ago

Thank you. Sorry, I meant Output.channels.txt (not the original) is blank.

Yeah, EPG will need to live with. Sometimes it works on cron, more times it does not.

bebo-dot-dev commented 5 years ago

Ah ok, so if you specify the filename Output for the --outfilename / -f argument, and it sounds like this is what you're doing, then you should expect to see a populated Output.channels.txt file in the given --outdirectory / -d location alongside a newly populated Output.m3u8 file in this location.

the m3u lines are written here: https://github.com/jjssoftware/m3u-epg-editor/blob/master/m3u-epg-editor.py#L524

and the Output.channels.txt lines are written just below here: https://github.com/jjssoftware/m3u-epg-editor/blob/master/m3u-epg-editor.py#L528

Are you saying that you're seeing a populated Output.m3u8 file as expected but the Output.channels.txt always remains empty?

sabre6 commented 5 years ago

Correct, blank .txt. but get a good .m3u8. Not a big deal, really want the .m3u8, but just a heads up

bebo-dot-dev commented 5 years ago

Ok thank you for the report, much appreciated. It's not a showstopper but I'd like to try and find the cause of the problem if I can.

I'd appreciate it if you could add any more details that might help track it i.e Operating System and version, Python run-time version etc

sabre6 commented 5 years ago

Sure.  Might not be back on til Monday though. 

⁣Sent from TypeApp ​

On May 3, 2019, 4:26 PM, at 4:26 PM, Joe notifications@github.com wrote:

Ok thank you for the report, much appreciated. It's not a showstopper but I'd like to try and find the cause of the problem if I can.

I'd appreciate it if you could add any more details that might help track it i.e Operating System and version, Python run-time version etc

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/jjssoftware/m3u-epg-editor/issues/23#issuecomment-489229029

bebo-dot-dev commented 5 years ago

I've not been able to reproduce this problem and I'm unlikely to be able to do much more without further details. I'll leave this open a little while longer but it will eventually be closed as a won't fix if there's no more info forthcoming.

bebo-dot-dev commented 5 years ago

The code in the save_new_m3u function (https://github.com/jjssoftware/m3u-epg-editor/blob/master/m3u-epg-editor.py#L519) was recently restructured and that change may well fix this issue. I believe that this issue is closed.

specsnow commented 5 years ago

I was having this same issue as well, just didn't report it. But I can confirm that it has been fixed now.

bebo-dot-dev commented 5 years ago

Thanks @specsnow, I didn't experience this issue myself but it did look as though the change applied in https://github.com/jjssoftware/m3u-epg-editor/commit/1e2736d55def384333983354485c35b9ff6e7456 would fix this. It's good to get a confirmation that this is fixed, I'll add the bug label.