sonroyaalmerol / m3u-stream-merger-proxy

A lightweight HTTP proxy server dockerized for consolidating and streaming content from multiple IPTV M3U playlists, acting as a load balancer between provided sources.
https://hub.docker.com/r/sonroyaalmerol/m3u-stream-merger-proxy
38 stars 3 forks source link

Allow Local M3U Files #78

Closed kp-emagine closed 2 months ago

kp-emagine commented 2 months ago

Is your feature request related to a problem? Please describe. Unable to pass file://

Describe the solution you'd like Would like to be able to attach a volume to the container, and pass local m3u files to it for processing, for example:

Where /playlists is mapped locally

aniel300 commented 2 months ago

this feature would be awesome as well

kpirnie commented 2 months ago

I know nothing about GoLang... but... this may work in the downloadM3UToBuffer method

// add right above: // Download M3U for processing live
// if the url string contains file://
    if strings.Contains( m3uURL, "file://" ) {

        // try to open the file
        file, err := os.Open( m3uURL )
        if err != nil {
            return fmt.Errorf("OPEN FILE error: %v", err)
        }
        defer file.Close( )

        // read it in chunks
        for {
            bytesread, err := file.Read( buffer )

            if err != nil {
                if err != io.EOF {
                    return fmt.Errorf("END OF FILE: %v", err)
                }

                break
            }

        }

    }
kpirnie commented 2 months ago

I know nothing about GoLang... but... this may work in the downloadM3UToBuffer method

// add right above: // Download M3U for processing live

mmm.. maybe not, like I said tho, I dont know anything about Go lolol

aniel300 commented 2 months ago

I least u are trying which is what matters

kpirnie commented 2 months ago

I least u are trying which is what matters

:) I'll give it another do later on. =) Appreciate it

sonroyaalmerol commented 2 months ago

Feature support has been merged on the latest dev build. Feel free to reopen if it does not work as expected

aniel300 commented 2 months ago

Feature support has been merged on the latest dev build. Feel free to reopen if it does not work as expected

i don't have a use case for this now but i know i might in the future. did u added this to the wiki/ readme?

kpirnie commented 2 months ago

Not working on :latest Docker

2024/08/20 08:08:51 Downloading M3U from URL: file:///playlists/kp-shows.m3u
2024/08/20 08:08:51 downloadM3UToBuffer error. Retrying in 5 secs... (error: HTTP GET error: Get "file:///playlists/kp-shows.m3u": unsupported protocol scheme "file")

Path exists in container Screenshot_1

sonroyaalmerol commented 2 months ago

I haven't released it yet. The dev build is accessible with the :dev image tag.

kpirnie commented 2 months ago

with :dev tag, for every stream

2024/08/20 08:34:03 Error retrieving stream for slug z-big-bang-theory: error getting URL data from Redis: WRONGTYPE Operation against a key holding the wrong kind of value
2024/08/20 08:34:03 Received request from 192.168.2.20:57787 for URL: /stream/ei1iaWctYmFuZy10aGVvcnk=.m3u8

This isn't specific to *.m3u8 either... it happens for every stream in the the processed m3u

kpirnie commented 2 months ago

@sonroyaalmerol > I haven't released it yet. The dev build is accessible with the :dev image tag.

Tried hitting you up on Discord... attempting to help look into a couple things ;) (like the above), but can't get a local environment going... apparently WSL doesn't like Redis or something....