EdenwareApps / Megacubo

:tv: A intuitive, multi-language and cross-platform IPTV player. Available for Windows, Android, Linux & macOS.
https://megacubo.tv
GNU General Public License v3.0
287 stars 54 forks source link

EPG downloaded as xml.gz #24

Closed andekande closed 1 year ago

andekande commented 1 year ago

My EPG source is https://m3u4u.com/ A request to https://m3u4u.com/epg/a1b2c3d4e5 replies with these HTTP Headers:

content-type: application/x-gzip
content-length: 1758815
content-disposition: attachment; filename=EPG-Guide-20230124172906.xml.gz; filename*=UTF-8''EPG-Guide-20230124172906.xml.gz

So there is no content-encoding but content-disposition. I believe that compression detection is not yet covered for that case in downloader module: https://github.com/efoxbr/megacubo/blob/master/www/nodejs-project/modules/download/download.js#L406 https://github.com/efoxbr/megacubo/blob/master/www/nodejs-project/modules/download/download.js#L634 Where it should detect 'gzip'.

The EPG module throws with BAD_FORMAT: https://github.com/efoxbr/megacubo/blob/master/www/nodejs-project/modules/epg/epg.js#L238

An easy fix would be to check for '.gz' filename not only in url but also content-disposition header here: https://github.com/efoxbr/megacubo/blob/master/www/nodejs-project/modules/download/download.js#L412

EdenwareApps commented 1 year ago

Hi @andekande, thanks for pointing out the bug. Could you test again with version 16.8.1 from the link below to confirm that this bug is resolved?

https://github.com/efoxbr/megacubo/releases/v16.8.1

Edit: The installers were updated just now.

andekande commented 1 year ago

Thank you @efoxbr. EPG loaded succesfully !!! Also User-Agent is transmitted (see #23) !!! Your works makes me super happy. :+1: :clap: :tv:

EdenwareApps commented 1 year ago

@andekande Thanks for confirming. Let me know if you notice any other problems.