freearhey / iptv-playlist-parser

A basic IPTV playlist parser
MIT License
128 stars 33 forks source link

Issue when channel name contains a comma #19

Closed vandrieu closed 1 year ago

vandrieu commented 1 year ago

Thank you @freearhey for this easy to use parser. Here is my only issue, when channel name contains a comma (,):

When there is a comma in the title, the M3U will look like this:

#EXTINF:-1 tvg-id="" tvg-name="The Good, the Bad and the Ugly" group-title="Movies",The Good, the Bad and the Ugly

And it makes the parser fail to retrieve the correct title:

How to reproduce the issue:

Run this code:

const parser = require('iptv-playlist-parser')

console.log(parser.parse(`#EXTM3U
#EXTINF:-1 tvg-id="" tvg-name="The Good, the Bad and the Ugly" group-title="Movies",The Good, the Bad and the Ugly
`))

output:

{
  header: { attrs: {}, raw: '#EXTM3U' },
  items: [
    {
      name: ' the Bad and the Ugly',
      tvg: [Object],
      group: [Object],
      http: [Object],
      url: undefined,
      raw: '#EXTINF:-1 tvg-id="" tvg-name="The Good, the Bad and the Ugly" group-title="Movies",The Good, the Bad and the Ugly\r\n',
      line: 2,
      catchup: [Object],
      timeshift: ''
    }
  ]
}

Expected result:

name: 'The Good, the Bad and the Ugly'

Actual result:

name: ' the Bad and the Ugly'

freearhey commented 1 year ago

Fixed in v0.12.2