hoshsadiq / m3ufilter

ABANDONED - A tool that allows to filter specific items from an m3u filter designed for IPTV.
GNU General Public License v2.0
49 stars 18 forks source link

[BUG] Unicode characters error #22

Closed s79dev closed 4 years ago

s79dev commented 4 years ago

In m3u with non English characters all non English characters is broken. This is because the stream reads single-byte characters, not runes. Possible Solution:

--- a/m3u/m3u.go
+++ b/m3u/m3u.go
@@ -146,8 +146,8 @@ func parseExtinfLine(attrline string, urlLine string) (*Stream, error) {
    value := ""
    quote := "\""
    escapeNext := false
-   for i := 8; i < len(attrline); i++ {
-       c := attrline[i]
+   for i,c := range attrline {
+       if i<8  {continue}

        if escapeNext {
            if state == "duration" {
-- 
2.17.1
hoshsadiq commented 4 years ago

Ha! I was waiting for this issue to arise! I just didn't have any good way of testing.

Are you able to send me a minimal m3u file so I can develop a good fix?

hoshsadiq commented 4 years ago

Obviously please sensor all links and whatnot.

s79dev commented 4 years ago

File with 3 items, make from "http://vladlink.tv/playlist" And question, how filter item with tag "access=denied" test.mstb.m3u8.zip

hoshsadiq commented 4 years ago

Okay cool! Thanks. I will add support for unicode characters.

how filter item with tag "access=denied"

Sorry the parser doesn't support all these additional tags. These are completely different from the general IPTV playlists. What client do you use? I built this project with mainly Kodi's Simple IPTV backend in mind, so it feels like that adding support for those additional tags is a little bit out of scope for this project.

I'm happy to accept PRs, if not please do raise a separate issue, who knows, someone might come along and implement it!

hoshsadiq commented 4 years ago

Thanks for that. This should be fixed now!

s79dev commented 4 years ago

Sorry for not a quick answer/ I want use VLC or other player. I wanted use m3ufilter for filter playlist my provider, skip all channels not allow for me. I realized that I could not do this when I saw that the program used a structure, not a map.

hoshsadiq commented 4 years ago

Feel free to raise a feature request and/or a PR. If you raise a feature request, I'll look at it if I have some time or something, but can't promise anything. Adding additional fields and things like this essentially requires a full implementation of the m3u RFC, which adds a lot of overheads to the application, to the point where it might not be possible to run it on low resource devices such as the pi.