hoshsadiq / m3ufilter

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

Again: panic: runtime error: index out of range [1] with length 1 #21

Closed s79dev closed 4 years ago

s79dev commented 4 years ago

Revision:

commit bea7bb59a13698cb06652db676b9ed0ff4de614d (HEAD -> master, origin/master, origin/HEAD)
Author: Hosh <hoshsadiq@users.noreply.github.com>
Date:   Wed Apr 29 15:33:45 2020 +0100

Build result: go version go version go1.14.3 linux/amd64 go build main.go

go: downloading github.com/sirupsen/logrus v1.4.2
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading gopkg.in/yaml.v2 v2.2.2
go: downloading github.com/mileusna/crontab v0.0.0-20180909013013-f182897de5d8
go: downloading github.com/hoshsadiq/goval v1.0.1-0.20190525223338-f1ea9f026acd
go: downloading github.com/maja42/no-comment v0.0.0-20180113082502-512948848672
go: downloading github.com/PuerkitoBio/rehttp v1.0.0
go: downloading golang.org/x/sys v0.0.0-20190422165155-953cdadca894

File "main" rename to "m3ufilter" and move Config:

core:
  output: m3u
providers:
  - uri: http:\vladlink.tv\playlist

Comand line ./m3ufilter -config=./config.yaml -log ./err -playlist ./test Result: panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/hoshsadiq/m3ufilter/logger.Get.func1(0xc00007c500, 0x0, 0x827432, 0x3, 0xb7abc0)
    /home/s79/mk/m3ufilter/logger/logger.go:30 +0x393
github.com/sirupsen/logrus.(*TextFormatter).Format(0xc00007c370, 0xc00016a0e0, 0xc000125a28, 0x59f28d, 0x7e7d60, 0xc000109620, 0xc000125a70)
    /home/s79/bin/go/pkg/mod/github.com/sirupsen/logrus@v1.4.2/text_formatter.go:133 +0x536
github.com/sirupsen/logrus.(*Entry).write(0xc00016a0e0)
    /home/s79/bin/go/pkg/mod/github.com/sirupsen/logrus@v1.4.2/entry.go:255 +0x7c
github.com/sirupsen/logrus.Entry.log(0xc00011f180, 0xc0001095f0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/s79/bin/go/pkg/mod/github.com/sirupsen/logrus@v1.4.2/entry.go:231 +0x19e
github.com/sirupsen/logrus.(*Entry).Log(0xc00016a070, 0x4, 0xc000125c38, 0x1, 0x1)
    /home/s79/bin/go/pkg/mod/github.com/sirupsen/logrus@v1.4.2/entry.go:268 +0xeb
github.com/sirupsen/logrus.(*Entry).Logf(0xc00016a070, 0xc000000004, 0x831002, 0x1d, 0xc000125de0, 0x2, 0x2)
    /home/s79/bin/go/pkg/mod/github.com/sirupsen/logrus@v1.4.2/entry.go:314 +0xe2
github.com/sirupsen/logrus.(*Logger).Logf(0xc00011f180, 0x4, 0x831002, 0x1d, 0xc000125de0, 0x2, 0x2)
    /home/s79/bin/go/pkg/mod/github.com/sirupsen/logrus@v1.4.2/logger.go:145 +0x94
github.com/sirupsen/logrus.(*Logger).Infof(...)
    /home/s79/bin/go/pkg/mod/github.com/sirupsen/logrus@v1.4.2/logger.go:159
github.com/hoshsadiq/m3ufilter/m3u.GetPlaylist(0xc000109350, 0xb79b10, 0x0, 0x0, 0x200)
    /home/s79/mk/m3ufilter/m3u/process.go:35 +0x22e
main.run(0x7ffd22d61278, 0xd, 0xc000010050, 0xc000010058)
    /home/s79/mk/m3ufilter/cmd/m3u-filter/main.go:49 +0x111
main.main()
    /home/s79/mk/m3ufilter/cmd/m3u-filter/main.go:38 +0x294

Create 2 files with zero size: err test

hoshsadiq commented 4 years ago

Seems to be have been an issue in the logger library that is used. I've upgraded and push an additional fix. Can you try latest master?

s79dev commented 4 years ago

I try new changes. Yes this error was fixed