parker1992 / iptv-proxy

Simple Flask proxy app for m3u files.
MIT License
8 stars 3 forks source link

No Streaming #9

Open nikhil96widhani opened 1 year ago

nikhil96widhani commented 1 year ago

Hi there, Great project but unfortunately i cannot stream URL. For my usecase i dont want to use a VPN because i have a cloud server and i want to proxy urls from my server ip instead of a vpn container. Please help related to what i am missing

my docker compose is

version: "3.3"
services:
    iptv_proxy:
        image: parkerr1992/iptv-proxy
        container_name: iptv_proxy
        restart: unless-stopped
    # network_mode: service:nordlynx
        ports:
            - 8080:8080
        environment:
            - M3U_LOCATION=https://some/main.m3u
            # Required. Either a path or URL.
            - RELOAD_INTERVAL_MIN=60 # Not required and defaults to 60. This is used to update the /static directory with the latest m3u file.
            - LISTEN_PORT=8080
parker1992 commented 1 year ago

Can you please advise what error you’re getting? And how do you access the proxy? Are you passing port 8080 in your video player?

nikhil96widhani commented 1 year ago

Problem is that the url gives empty playlist for me. Like its plane white page and nothing downloads when i open in browser vlc fails to get stream too. And yes i am passing the port 8080. But failing to check where its going wrong

parker1992 commented 1 year ago

Can you try adding the environment variable below?

USE_HTTPS=True

nikhil96widhani commented 1 year ago

Are you sure? Because i am not using https on my server?

parker1992 commented 1 year ago

Let me try to reproduce this issue tomorrow when I’m on my computer. I think there’s an issue somewhere relating to https.

If you ssh into the container, are you able to curl the original m3u file?

parker1992 commented 1 year ago

Try setting the config below:

M3U_PORT=8080

There's a bug where if this is blank, the new m3u will replace the urls with http://[address]/proxy/stream/... instead of http://[address]:8080/proxy/stream/...

Let me know if this works.

nikhil96widhani commented 1 year ago

Thanks for this. I will try this on Friday and report back.

parker1992 commented 1 year ago

No problem. I'm fairly convinced this should work. According to the link below, I made this as a feature:

https://github.com/parker1992/iptv-proxy/blob/24c42f6f70424b4e9fb39501e333611f11cade24/config.ini#L9-L10

I just failed to update the README when I created this config. I'll update it now.

nikhil96widhani commented 1 year ago

I am still following this issue. I have been busy lately and will test and revert soon. Sorry about the delay.

nikhil96widhani commented 1 year ago

Hello still there is some issue now the m3u works but it fails to add the hostname in the m3u file.

the streaming url in the m3u is as follows: http://:8080/stream/url.mdp

my new docker file is

version: "3.3"
services:
    iptv_proxy:
        image: parkerr1992/iptv-proxy
        container_name: iptv_proxy
        restart: unless-stopped
        ports:
            - 8080:8080
        environment:
            - M3U_LOCATION=https:/blahbalh.m3u
            - RELOAD_INTERVAL_MIN=60 # Not required and defaults to 60. This is used to update the /static directory with the latest m3u file.
            - LISTEN_PORT=8080
            - M3U_PORT=8080 # The port to add to the m3u file. If the app is running on port 80, you may not need this.
parker1992 commented 1 year ago

Try the M3U_HOST config for that.

M3U_HOST=192.168.1.20 or whatever is your local IP of the computer running the container.

nikhil96widhani commented 1 year ago

M3u file is perfect now but cannot stream channels for some reason, console log of container shows channel logo images are fetched but nothing about streaming or forwarding the stream url

parker1992 commented 1 year ago

Do you know if the IPTV provider requires a specific HTTP header?

If you try to watch the same stream without the proxy, does it work? If so, do you know which headers are being sent?

nikhil96widhani commented 1 year ago

If i copy and paste a stream link (after i open m3u in text edit) in the vlc media player it works. The iptv provider recommendation is a user agent http header but that’s option based on my use.

parker1992 commented 1 year ago

By copy and pasting the stream link, are you referring to the link with or without the proxy?

nikhil96widhani commented 1 year ago

By copy and pasting the stream link, are you referring to the link with or without the proxy?

I am referring to watching stream without proxy. Direct url inside m3u file

parker1992 commented 1 year ago

Let me add more logging to the app and then you can bind a log path so we can figure it out. Without the stream URL which you obviously shouldn’t share, there’s not much I can do without knowing the exact error.

I’m assuming the proxy works, but the header I’m adding here likely doesn’t work for your provider:

https://github.com/parker1992/iptv-proxy/blob/2e7eb39961753047f287bb43d3c6763a67dd7dcf/proxy.py#L45-L48

nikhil96widhani commented 1 year ago

Can i send u an m3u with 2 urls? Which u can test if i am doing anything wrong ? If yes then can you please provide ur discord

parker1992 commented 1 year ago

jewisheminem#7067

I’ll check it out tonight (NY time zone). Also if your provider supports it, remember to reset your token afterwards.