pierre-emmanuelJ / iptv-proxy

Reverse proxy on iptv m3u and m3u8 file and xtream codes client api
GNU General Public License v3.0
478 stars 139 forks source link

invalid m3u file format. Expected #EXTM3U file header #123

Open rouissi-iheb opened 2 years ago

rouissi-iheb commented 2 years ago

Hi , hope you all safe ,

Am trying to run the docker container with valid IPTV M3U file wich i did play on VLC media player but i always get this error :

docker-compose up
Creating iptv-proxy ... done
Attaching to iptv-proxy
iptv-proxy    | 2022/04/22 20:23:44 invalid m3u file format. Expected #EXTM3U file header

this is my docker-compose.yml file :

version: "3"
services:
  iptv-proxy:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      # If your are using local m3u file instead of m3u remote file
      # put your m3u file in this folder
      - ./iptv:/root/iptv
    container_name: "iptv-proxy"
    restart: on-failure
    ports:
       # have to be the same as ENV variable PORT
      - 8080:8080
    environment:
      # if you are using m3u remote file
      # M3U_URL: https://example.com/iptvfile.m3u
      M3U_URL: /root/iptv/iptv.m3u
      # Port to expose the IPTVs endpoints
      PORT: 8080
      # Hostname or IP to expose the IPTVs endpoints (for machine not for docker)
      HOSTNAME: localhost
      GIN_MODE: release
      ## Xtream-code proxy configuration
      XTREAM_USER: xtream_user
      XTREAM_PASSWORD: xtream_password
      XTREAM_BASE_URL: "http://localhost:8080"
      ##### UNSAFE AUTH TODO ADD REAL AUTH
      #will be used for m3u and xtream auth poxy
      USER: test
      PASSWORD: test

i did create an iptv.m3u file inside iptv folder :

#EXTM3U
#EXTINF:-1,PREMIUM SPORT 1 HD
#EXTVLCOPT:http-user-agent=ricotv
http://xx.xyz:25461/jjhdfsffjjg/jjhdfsffjjg/1
#EXTINF:-1,BEIN SPORT PREMIUM 2
#EXTVLCOPT:http-user-agent=ricotv
http://xx.xyz:25461/jjhdfsffjjg/jjhdfsffjjg/249
#EXTINF:-1,PREMIUM SPORT 2 HD
#EXTVLCOPT:http-user-agent=ricotv
http://xx.xyz:25461/jjhdfsffjjg/jjhdfsffjjg/3
#EXTINF:-1,PREMIUM SPORT 3 HD
#EXTVLCOPT:http-user-agent=ricotv
http://xx.xyz:25461/jjhdfsffjjg/jjhdfsffjjg/5

Did not work for me since the fomrat was not the same as in README.md file so i used the same links of my working iptv file with the exemple format so my iptv.m3u file lokks like this now :

#EXTM3U
#EXTINF:-1 tvg-ID="examplechanel1.com" tvg-name="chanel1" tvg-logo="http://ch.xyz/logo1.png" group-title="USA HD",CHANEL1-HD
http://xx.xyz:25461/jjhdfsffjjg/jjhdfsffjjg/1
#EXTINF:-1 tvg-ID="examplechanel2.com" tvg-name="chanel2" tvg-logo="http://ch.xyz/logo2.png" group-title="USA HD",CHANEL2-HD
http://xx.xyz:25461/jjhdfsffjjg/jjhdfsffjjg/1
#EXTINF:-1 tvg-ID="examplechanel3.com" tvg-name="chanel3" tvg-logo="http://ch.xyz/logo3.png" group-title="USA HD",CHANEL3-HD
http://xx.xyz:25461/jjhdfsffjjg/jjhdfsffjjg/1
#EXTINF:-1 tvg-ID="examplechanel4.com" tvg-name="chanel4" tvg-logo="http://ch.xyz/logo4.png" group-title="USA HD",CHANEL4-HD
http://xx.xyz:25461/jjhdfsffjjg/jjhdfsffjjg/1

but still showing the same issue. Can anyone help me with that ? what i did wrong or what's missing ?

Juancollado2003 commented 1 year ago

It happened to me also, I solved it just editing the playlist with nano and added the line #EXTM3U again

iamaserverguy commented 1 year ago

@Juancollado2003 I downloaded the m3u file from service provider, it looks as in readme.md file. Via iptv-proxy if fails and below logs is recorded

iptv-proxy | 2022/11/27 17:52:32 [iptv-proxy] 2022/11/27 - 17:52:32 | 127.0.0.1 | xtream cache m3u file iptv-proxy | [GIN] 2022/11/27 - 17:52:43 | 500 | 10.630179643s | 127.0.0.1 | GET "/get.php?username=test&password=testpassword&type=m3u_plus&output=ts" iptv-proxy | Error #01: invalid m3u file format. Expected #EXTM3U file header

Can you explain me in brief ? As I too experience the same.

Juancollado2003 commented 1 year ago

@Juancollado2003 I downloaded the m3u file from service provider, it looks as in readme.md file. Via iptv-proxy if fails and below logs is recorded

iptv-proxy | 2022/11/27 17:52:32 [iptv-proxy] 2022/11/27 - 17:52:32 | 127.0.0.1 | xtream cache m3u file iptv-proxy | [GIN] 2022/11/27 - 17:52:43 | 500 | 10.630179643s | 127.0.0.1 | GET "/get.php?username=test&password=testpassword&type=m3u_plus&output=ts" iptv-proxy | Error #1: invalid m3u file format. Expected #EXTM3U file header

Can you explain me in brief ? As I too experience the same.

My answer is clear, I solved it just editing the playlist with nano and added the line #EXTM3U again at first line

iamaserverguy commented 1 year ago

@Juancollado2003 Got it. I am not able to download m3u file from iptv-proxy docker instance.

Juancollado2003 commented 1 year ago

@Juancollado2003 Got it. I am not able to download m3u file from iptv-proxy docker instance.

Are you running iptv-proxy to proxy an url or a m3u file?

iamaserverguy commented 1 year ago

@Juancollado2003 Got it. I am not able to download m3u file from iptv-proxy docker instance.

Are you running iptv-proxy to proxy an url or a m3u file?

I tried via xtream credentials , m3u url and m3u file.

via xtream client, it works fine. but when I try to download m3u file or url, error occurs.

logs below

on fetching m3u file iptv-proxy | 2022/12/01 20:35:33 [iptv-proxy] 2022/12/01 - 20:35:33 | 192.168.1.7 | xtream cache m3u file iptv-proxy | [GIN] 2022/12/01 - 20:35:46 | 500 | 12.755901277s | 192.168.6.27 | GET "/get.php?username=test&password=testpassword&type=m3u_plus&output=ts" iptv-proxy | Error #01: invalid m3u file format. Expected #EXTM3U file header

Via xtream client iptv-proxy | [GIN] 2022/12/01 - 20:45:50 | 200 | 31m34s | 192.168.1.8 | GET "/live/test/testpassword/33481.ts" iptv-proxy | [GIN] 2022/12/01 - 20:45:59 | 200 | 9.635587453s | 192.168.18 | GET "/live/test/testpassword/33486.ts" iptv-proxy | [GIN] 2022/12/01 - 21:13:52 | 200 | 2.959335281s | 192.168.1.7 | GET "/test/testpassword/318765"