hazcod / muxy

Emulates a HDHomeRun device while streaming from M3U IPTV streams.
MIT License
15 stars 3 forks source link

Plex: unable to tune to channel #4

Open petrmenzel opened 6 years ago

petrmenzel commented 6 years ago

I have stuck on this:

non-standard import "github.com/golang/glog" in standard package "muxy/muxy"

/usr/lib/go-1.9/src/github.com/muxy$ make
GOARCH=amd64 CGO_ENALED=0 go build -ldflags="-w -s" -o "muxyProxy"
/usr/lib/go-1.9/src/muxy/muxy/endpoint.go:8:2: non-standard import "github.com/golang/glog" in standard package "muxy/muxy"
makefile:9: recipe for target 'build' failed
make: *** [build] Error 1

As I found from Go version 1.8 I do not need set up GoRoot and GoPath. I know that it is problem that I do not know how "go" works. But can you give me a little bit direction how to build this awesome tool? :-)

Machine: Ubuntu 16.04.3 LTS

I have done this:

Thx you very much

petrmenzel commented 6 years ago

So there was problem with GoRoot and GoPath. It is solved now.

  1. I was able to compile the app.
  2. The app is able to take my local m3u file and give it for Plex.
  3. I am able to add this virtual tuner to the Plex.
  4. I can proceed the process, find channels etc.
  5. But video cannot be play. / M3U file is working (tested on IPTV.bundle). unable to tune channel tv tunner
hazcod commented 6 years ago

Hi, glad it's compiling now. What did you do to your GOROOT and GOPATH?

I must admit this project is still in development, so it still does not work completely with Plex & I need to figure out why. For debugging, try accessing http://localhost:8080/lineup.json in your browser and try opening one of the stream URLs. (e.g. http://localhost:8080/stream/xxxxxxxxx)

petrmenzel commented 6 years ago

Could be problem, that I have changed inputs (in main.go)?

My step by step installing and using.

# Install programs.
sudo apt-get install golang-go
sudo apt-get install automake
# Set paths.
export GOPATH=/home/myusername/go
export GOROOT=/usr/lib/go-1.9
# Install aditional packages.
sudo go get github.com/gorilla/mux # Is downloaded to /home/myusername/go/src/github.com.
sudo go get github.com/grafov/m3u8 # Is downloaded to /home/myusername/go/src/github.com.
sudo go get github.com/golang/glog # Is downloaded to /home/myusername/go/src/github.com.
cd /usr/lib/go-1.9/github.com
https://github.com/hazcod/muxy
git clone https://github.com/hazcod/muxy # It will be located in /usr/lib/go-1.9/github.com.
cd muxy
sudo make
./muxyProxy http://urlpathto.m3u8 # Set URL to .m3u8 file.
./muxyProxy '/local/path/to/.m3u' # Set path to .m3u8 file.

Useful command to check that you have correctly set GoPath and GoRoot: go env

petrmenzel commented 6 years ago

I have run the ./muxyProxy

Added to my browser http://192.168.1.200:8880/lineup.json --> get list of something like this: [{"GuideName":"T1","GuideNumber":"0.0","URL":"http://192.168.1.200:8880/stream/VERYLONGHASH=="}, {next channel}, {...}, {...}]

petrmenzel commented 6 years ago

in bash: /Resources/playlist.m3u' E0131 13:07:33.551519 32219 streamer.go:40] Could not fetch channel playlist: Could not get channel playlist: unknown m3u type: E0131 13:07:33.653300 32219 streamer.go:40] Could not fetch channel playlist: Could not get channel playlist: unknown m3u type: E0131 13:07:33.784305 32219 streamer.go:40] Could not fetch channel playlist: Could not get channel playlist: unknown m3u type:

So the error could be this: unknown m3u type

hazcod commented 6 years ago

That's because the parser only accepts m3u8 files, do you have the possibility to get a m3u8 instead of m3u?

petrmenzel commented 6 years ago

I will try change output extension from script from .m3u to .m3u8 and I will see.

petrmenzel commented 6 years ago

I was able to generate m3u8 file. But still "unknown type". Could you send me example of your working .m3u8 structure of the file? Thx you very much.

My structure:

#EXTM3U
#EXTINF:0 tvg-id="ct1hd" tvg-name="ČT1" tvg-logo="ct1hd.png" group-title="General",ČT1
http://media.kuki.cz:8116/ct1hd/stream.m3u8?type=live&sign=hash&expires=1517454001
hazcod commented 6 years ago

Afraid not, I have a m3u8 for my paid subscription.

petrmenzel commented 6 years ago

Me too, but I need only structure to try make same.

petrmenzel commented 6 years ago

I have minimalized the M3U8 file to this format:

#EXTM3U8
#EXTINF:0,CT1
url_of_the_stream
#EXTINF:0,CT2
url_of_the_stream
#EXTINF:0,CT24
url_of_the_stream

console log after tried to play in VLC

I0131 15:39:59.001144    5736 endpoint.go:119] 192.168.1.2:5639 GET /stream/aHR0cDovL21lZGlhLmt1a2kuY3o6ODExNi9jdDFoZC9zdHJlYW0ubTN1OD90eXBlPWxpdmUmc2lnbj03OFVUckNGeWNoR1JuV0htcm9xd3l3JmV4cGlyZXM9MTUxNzQ4ODA2Ng
E0131 15:39:59.001219    5736 endpoint.go:47] Could not decode stream URI: aHR0cDovL21lZGlhLmt1a2kuY3o6ODExNi9jdDFoZC9zdHJlYW0ubTN1OD90eXBlPWxpdmUmc2lnbj03OFVUckNGeWNoR1JuV0htcm9xd3l3JmV4cGlyZXM9MTUxNzQ4ODA2Ng
I0131 15:39:59.001238    5736 endpoint.go:14] Sending errorcode: 500
petrmenzel commented 6 years ago

There will be problem with the type of the stream url. But not with the m3u8 structure. The app works for .M3U8 same as for .M3U.

Correct structure for IPTV for MUXY should be this (nothing more):

#EXTINF:-1,channel_name_1
url_of_the_stream_1
#EXTINF:-1,channel_name_2
url_of_the_stream_2
#EXTINF:-1,channel_name_X
url_of_the_stream_X

I have tried public .m3u where are links in this types url_to_strem.ts but my type is stream.m3u8?type=live&sign=hash&expires=1517488066

I have also tested that the app works in same way for LOCAL stored .m3u and for URL stored .m3u.

Both of them url_to_strem.ts and stream.m3u8?type=live&sign=hash&expires=1517488066 work perfectly in VLC.

But after converting by app to the http://ip_adress:port/stream/long_hash happens this: