su1s / e2m3u2bouquet

Enigma2 IPTV m3u parser and bouquet creator
GNU General Public License v3.0
68 stars 50 forks source link

guarantee match is on file/stream name #71

Closed oottppxx closed 5 years ago

oottppxx commented 5 years ago

The original regex would match the first dot on any part of the URL, which could cause issues with certain IPTV providers. This guarantees the match is only on the last element of the path (file or stream).

DougMac commented 5 years ago

Thanks for the PR.

The $ in the regex ensures it only matches the end of the string. Can you provide an example where this isn't the case?

oottppxx commented 5 years ago

Some streams from particular providers have path elements with dots in it.

E.g., .../foo.bar/stream.m3u8?key=val...

Not sure if the arguments after ? are included in the path (I think they're not, otherwise there'd be more generalised issues); the $ anchoring obviously doesn't prevent matching the initial dot on an unrelated element of the path "foo.bar", making such a stream being erroneously marked as VOD when it isn't.

DougMac commented 5 years ago

url.path doesn't include the query string. However you're correct the current regex isn't working as intended (it will match any stream ending .m3u8 instead of just the vod double extensions as intended if the path element has a dot in it). I'll update with your fix, thanks.

DougMac commented 5 years ago

Updated in master