m0ngr31 / EPlusTV

Virtual linear channels for ESPN, ESPN+, MSG+, NFL+, B1G+, NESN, Mountain West, FloSports, Paramount+, MLB.tv, and FOX Sports
MIT License
133 stars 23 forks source link

Upgrade playwright to latest version; add docker-compose; switch browser to firefox #25

Closed nkm8 closed 2 years ago

nkm8 commented 2 years ago

For some background, my goal was to run this docker container on a 64-bit Raspberry Pi 4. However, the original image (playwright 1.15) doesn't have an arm64 image available.

I originally switched to a generic arm64 base image and manually installed playwright. However, I quickly realized that MS added arm64 support in playwright v1.17

I also had to switch the browser used from chrome to firefox. playwright doesn't offer any chrome builds from arm64 to use with browser install. Next, I tried base chromium, but that didn't work on my rpi4. Finally, I tried firefox, which does have arm64 builds, and everything works as expected.

So far, I tested these changes on:

I haven't tested on x86_64, but I assume everything should work as expected. I'm not sure exactly what changes are needed, but I think you will need to modify your github action to build/push the image for multiple architectures: https://pet2cattle.com/2021/09/build-multiarch-container-github-action

Until you push new images, you won't be able to pull images from Docker Hub for arm64.

nkm8 commented 2 years ago

Please hold - I'm still testing. The guide data pulls through correctly, but I still can't get a stream to work. I'll debug a bit more to see if I can figure it out - the "Event will start soon" screen isn't very exciting.

nkm8 commented 2 years ago
=== Done building the schedule ===
=== Starting Server ===
Server started on port 8000
There is an active event. Going to start the stream.
Getting stream for event:  0ec416e2-21ed-482b-a9b8-6645a6e0702d
Channel has upcoming event. Setting timer to start
There is an active event. Going to start the stream.
Getting stream for event:  49ffa886-5d87-4558-8ebf-93be2b0df9a1
Channel has upcoming event. Setting timer to start
There is an active event. Going to start the stream.
Getting stream for event:  98d32232-3029-4010-9e3b-238411aaf268
Channel has upcoming event. Setting timer to start
Channel has upcoming event. Setting timer to start
There is an active event. Going to start the stream.
Getting stream for event:  77d5e549-bb15-42c8-9c27-dc77f3b64aec
Channel has upcoming event. Setting timer to start
Channel has upcoming event. Setting timer to start
Failed to parse the stream
Failed to parse the stream
Failed to parse the stream
Failed to parse the stream
There is an active event. Going to start the stream.
Getting stream for event:  77d5e549-bb15-42c8-9c27-dc77f3b64aec
Failed to parse the stream
There is an active event. Going to start the stream.
Getting stream for event:  77d5e549-bb15-42c8-9c27-dc77f3b64aec
Failed to parse the stream

I'll have to dig around a bit - I'm not familiar enough with the application code to know what this error means. I also noticed that even streaming the waiting screen pegs the CPU for an rpi4 at almost 100%, so it may be related that arm devices simply aren't powerful enough to relay the stream(s).

m0ngr31 commented 2 years ago

So the reason I'm using an x86_64 image is because when the browser loads up the stream from ESPN, it needs DRM either built-in to the browser (Chrome) or through addons (Firefox). I think Chrome is x64 only IIRC. If you can figure out how to load the plugins to Firefox before it launches, we could slim down the container quite a bit!

nkm8 commented 2 years ago

I poked around and couldn't figure it out. There are a few options available for Raspberry Pis running Raspbian natively, but it won't work in Docker running Ubuntu.

I'll leave it up to you, but I assume there isn't anything worthwhile in the PR, so feel free to close it. Considering the re-stream, an rpi4 probably isn't a great client to run this image, anyway. A Jetson Nano, maybe, but not an rpi4.

m0ngr31 commented 2 years ago

@nkm8 I've added support for Raspberry Pis on the v2.0.0 release

nkm8 commented 2 years ago

@m0ngr31 Tested and confirmed - this is amazing, thanks for the quick turnaround! I also see that the performance hit on my pi4 is negligible.