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

Error when using -log or -playlist #19

Closed Olivier6767 closed 4 years ago

Olivier6767 commented 4 years ago

I would like o reopen this issue as I have the same problem.

Platform: Ubuntu 18.04.4 LTS - AMD64 Version: v0.1-beta.3 - using binary: m3u-filter_linux_arm64 - Downloaded executable, did NOT build from source myself

Command line: ./m3u-filter -config ./data/m3u.conf -playlist ./data/playlist.m3u

Error Message: panic: open ./data/playlist.m3u: no such file or directory

goroutine 1 [running]: main.fd(0x7ffeacbae7c5, 0x13, 0x7ffeacbae700, 0xf) /home/travis/gopath/src/github.com/hoshsadiq/m3ufilter/cmd/m3u-filter/main.go:59 +0xf6 main.main() /home/travis/gopath/src/github.com/hoshsadiq/m3ufilter/cmd/m3u-filter/main.go:30 +0x228

The error is the same if I specify a logfile, with or without the -playlist argument.

I tried creating an empty playlist.m3u file but then I get: FATA[2020-04-01T20:19:31+02:00]writer/m3u.go:15 writer.writeM3U() unable to write extm3u, err = !!write ./data/playlist.m3u: bad file descriptor

Content of m3u.conf file: core: output: m3u group_order: - France - Switzerland - Belgium - VOD France providers: - uri: file:///home/Services/m3u-filter/data/playlist.ts filters: - match(Group, "France") - match(Group, "Switzerland") - match(Group, "Belgium") - match(Group, "VOD France")

If I don't specify the -log or -playlist arguments the filtered m3u list is displayed on the console properly.

Hopefully this will help narrowing down the issue.

Originally posted by @Olivier6767 in https://github.com/hoshsadiq/m3ufilter/issues/4#issuecomment-607422322

hoshsadiq commented 4 years ago

I've just pushed a fix, are you able to build from source?

Olivier6767 commented 4 years ago

I have GOLANG installed but I'm not familiar with the build process (my other project has a makefile so I just export GOPATH and run Make). If you can provide instructions I can try. Otherwise, can you provide a compiled vesion?

hoshsadiq commented 4 years ago

m3ufilter-linux_arm64.zip

Olivier6767 commented 4 years ago

Thanks, but I need amd64 platform...

However I was able to build from soucr, I used go get and go build and go install with github.com/hoshsadiq/m3ufilter/EACH_SUBOLDER Not sure it's the rght way but I did get an executable that works. Thanks!

hoshsadiq commented 4 years ago

Glad to hear

GlenC289 commented 4 years ago

Hi, I'm having the same issue here but it's on a 64 bit Windows installation. I've tried to follow the procedure that olivier6767 used and it seems that no errors are generated when I run the commands on the sub_folders but I don't end up with an executable. I'm sure I'm misunderstanding something. If you could let me know how the build process is supposed to go I could probably build it. Otherwise I'll just wait for the next beta version to come out. Thanks!

hoshsadiq commented 4 years ago

Can you post the configuration you use, the command you run, and the output please

GlenC289 commented 4 years ago

I'm editing my initial response, I think I made some progress. And thanks for the response.

Env: Windows 10 AMD64
Go installed: c:\go source directory: c:\go-workspace\src %GOPATH% c:\go-workspace

I initially ran go get github.com/hoshsadiq/m3ufilter then ran go build m3u-filter/main.go That completed without error next ran go install m3u-filter/main.go I now had a binary main.exe

This is actually an improvement, at least I got a binary out of it. I really don't want to take up your time on this though, so if this doesn't look like something that is easy to fix then don't worry about it. I can wait on your next release, no problem. Thanks!

I then replaced m3ufilter.exe from the installation package with my main.exe and ran this command: C:\m3ufilter\main.exe -config "C:\m3ufilter\m3ufilter.yaml" - logfile "C:\m3ufilter\m3ufilter.log" -playlist "C:\m3ufilter\condensed.m3u"

This is the resulting output: panic: runtime error: index out of range [1] with length 1 goroutine 1 [running]: github.com/hoshsadiq/m3ufilter/logger.Get.func1(0xc0000e04b0, 0x0, 0x804f14, 0x3, 0xb3a220) C:/go-workspace/src/github.com/hoshsadiq/m3ufilter/logger/logger.go:26 +0x31b github.com/sirupsen/logrus.(*TextFormatter).Format(0xc0000e0320, 0xc000123030, 0xc0000c7a28, 0x555e54, 0x7c7f80, 0xc0000b56b0, 0xc0000c7a70) C:/go-workspace/pkg/mod/github.com/sirupsen/logrus@v1.4.2/text_formatter.go:133 +0x53d github.com/sirupsen/logrus.(*Entry).write(0xc000123030) C:/go-workspace/pkg/mod/github.com/sirupsen/logrus@v1.4.2/entry.go:255 +0x83 github.com/sirupsen/logrus.Entry.log(0xc0000df180, 0xc0000b5680, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) C:/go-workspace/pkg/mod/github.com/sirupsen/logrus@v1.4.2/entry.go:231 +0x1a5 github.com/sirupsen/logrus.(*Entry).Log(0xc000122fc0, 0x4, 0xc0000c7c38, 0x1, 0x1) C:/go-workspace/pkg/mod/github.com/sirupsen/logrus@v1.4.2/entry.go:268 +0xf2 github.com/sirupsen/logrus.(*Entry).Logf(0xc000122fc0, 0xc000000004, 0x80f3b3, 0x1d, 0xc0000c7de0, 0x2, 0x2) C:/go-workspace/pkg/mod/github.com/sirupsen/logrus@v1.4.2/entry.go:314 +0xe9 github.com/sirupsen/logrus.(*Logger).Logf(0xc0000df180, 0x4, 0x80f3b3, 0x1d, 0xc0000c7de0, 0x2, 0x2) C:/go-workspace/pkg/mod/github.com/sirupsen/logrus@v1.4.2/logger.go:145 +0x9b github.com/sirupsen/logrus.(*Logger).Infof(...) C:/go-workspace/pkg/mod/github.com/sirupsen/logrus@v1.4.2/logger.go:159 github.com/hoshsadiq/m3ufilter/m3u.GetPlaylist(0xc0000b52f0, 0xb39418, 0x0, 0x0, 0x4f3200) C:/go-workspace/src/github.com/hoshsadiq/m3ufilter/m3u/process.go:35 +0x235 main.run(0xc0000c8030, 0x26, 0xc0000ca008, 0xc0000ca010) C:/go-workspace/src/github.com/hoshsadiq/m3ufilter/cmd/m3u-filter/main.go:49 +0x118 main.main() C:/go-workspace/src/github.com/hoshsadiq/m3ufilter/cmd/m3u-filter/main.go:38 +0x29b

Olivier6767 commented 4 years ago

Hi, I don't know if this helps, but I was able to 'refine' the steps used to compile. Here is what I have:

Also what happens if you don't specify the logfile ?

GlenC289 commented 4 years ago

I tried leaving out the log file (which by the way, I made an error using - logfile vice -log) but the results were still the same error messages. I will try building with your suggestions a little later today when I have more time. Thanks for the suggestions!

Edit: Didn't notice it earlier but correcting the log file parameter allowed generation of the two output files - m3ufilter.log and condensed.m3u, they are both zero byte though.

hoshsadiq commented 4 years ago

Hi this seems like a different error. In the future, please open a new issue unless you're 100% it's the same issue.

Anyway, to run the latest master, you can simply run:

go get -u github.com/hoshsadiq/m3ufilter/cmd/m3u-filter

This will put the m3u-filter in $GOPATH/bin, which if it's in your PATH variable, should be available straight away. You can validate this is the latest master by running m3u-filter --version, which should return empty values.

GlenC289 commented 4 years ago

Olivier6767, just finished testing following your suggestions. The only thing I was hesitant to do was to move the location of my src directory. The Windows installation instructions specifically stated not to have the workspace within the go directory.
That said, I git-cloned the repository to: C:\go-workspace\src\m3ufilter Changed my working directory to: C:\go-workspace\src\m3ufilter\cmd\m3u-filter ran go get ran go build checked the bin directory and this time the binary was named m3u-filter.exe vice main,exe. I thought that was a good sign but alas, when I ran it I got the exact same error.

hoshsadiq commented 4 years ago

Sorry, I didn't see the log messages from earlier. I think I understand what the issue is now. Will fix soon.

GlenC289 commented 4 years ago

Hi Hoshsadiq, I see you posted again while I was composing. Yes, I should have opened a new issue and I apologize to both you and Olivier for hijacking this thread. And now I see you already responded to my last post so, I will await your fix, and thank you!

hoshsadiq commented 4 years ago

@GlenC289 I've just pushed a potential commit, can you try attached version please?

FYI I don't have windows, so I've had to test with Wine instead.

m3ufilter-windows_amd64.zip

GlenC289 commented 4 years ago

@hoshsadiq Thanks, your binary worked great! Thanks so much.

I'm going to continue trying to build though, this is a good learning opportunity for me.