JioTV-Go / jiotv_go

Unlock the magic of JioTV across all your devices, without the need for the JioTV App. Crafted with love in Golang for a delightful blend of speed and efficiency! 🌟✨
https://jiotv_go.rabil.me/
Other
330 stars 91 forks source link

bug: CasaOS network not reachable in jellyfin #409

Closed aasimenator closed 1 week ago

aasimenator commented 1 week ago

Bug description

Hi,

I was able to get this working without any issues previously, but after a couple of days it stopped working, i have not been able to get it working ever since. Media plays fine over the browser when directly accessing the URL but not when i download the m3u file and add it to the IPTV app. error in JellyFin: Playback failed due to a fatal player error.

Steps to reproduce

Using CLI Options with Docker

docker run -p 8080:8080 -v ./.jiotv_go:/app/.jiotv_go ghcr.io/rabilrbl/jiotv_go serve --public --port 8080

copy the following URL (http://192.168.192.9:8080/playlist.m3u?l=Hindi,English) and paste it in JellyFin > Dashboard > Live TV > Turner Devices > Add > M3U Tuner > File or URL

EPG is not enabled, I am using the https://avkb.short.gy/jioepg.xml.gz

Relevant log output

Log:
`{"Protocol":1,"Id":"055cee28d199e3954e78dd56150a1cb4","Path":"http://192.168.192.9:8080/live/144.m3u8","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"hls","Size":5552,"Name":null,"IsRemote":false,"ETag":null,"RunTimeTicks":null,"ReadAtNativeFramerate":false,"IgnoreDts":true,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":false,"SupportsDirectPlay":true,"IsInfiniteStream":true,"RequiresOpening":true,"OpenToken":null,"RequiresClosing":true,"LiveStreamId":"e2329f4997b378e64ccf8fa396deb76e_af999c25a00715699361240d4c6c7a53_055cee28d199e3954e78dd56150a1cb4","BufferMs":null,"RequiresLooping":false,"SupportsProbing":true,"VideoType":null,"IsoType":null,"Video3DFormat":null,"MediaStreams":[{"Codec":"h264","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/90000","CodecTimeBase":null,"Title":null,"VideoRange":1,"VideoRangeType":1,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"LocalizedHearingImpaired":null,"DisplayTitle":"240p H264 SDR","NalLengthSize":"0","IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":8,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":234,"Width":416,"AverageFrameRate":25,"RealFrameRate":25,"Profile":"Constrained Baseline","Type":1,"AspectRatio":"16:9","Index":-1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p","Level":13,"IsAnamorphic":false},{"Codec":"aac","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":"Hindi","TimeBase":"1/90000","CodecTimeBase":null,"Title":null,"VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":"Default","LocalizedForced":null,"LocalizedExternal":"External","LocalizedHearingImpaired":null,"DisplayTitle":"AAC - Stereo - Default","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":"stereo","BitRate":30708,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":2,"SampleRate":48000,"IsDefault":true,"IsForced":false,"IsHearingImpaired":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":"LC","Type":0,"AspectRatio":null,"Index":-1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":30708,"Timestamp":null,"RequiredHttpHeaders":{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"},"TranscodingUrl":null,"TranscodingSubProtocol":0,"TranscodingContainer":null,"AnalyzeDurationMs":3000,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 3000000 -probesize 1G -user_agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36" -fflags +igndts -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i "http://192.168.192.9:8080/live/144.m3u8" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 h264_qsv -low_power 1 -preset veryfast -look_ahead 0 -b:v 30000000 -maxrate 30000000 -bufsize 60000000 -profile:v:0 baseline -level 13 -g:v:0 75 -keyint_min:v:0 75 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=format=nv12:extra_hw_frames=24,hwmap=derive_device=qsv,format=qsv" -flags -global_header -codec:a:0 libfdk_aac -ac 2 -ab 30708 -ar 48000 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_base_url "hls/d55880d8c92f64dc08cf6181b523069f/" -hls_segment_filename "/cache/transcodes/d55880d8c92f64dc08cf6181b523069f%d.ts" -hls_playlist_type event -hls_list_size 0 -y "/cache/transcodes/d55880d8c92f64dc08cf6181b523069f.m3u8"

ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
[tcp @ 0x564a095c3380] Connection to tcp://192.168.192.9:8080 failed: No route to host
http://192.168.192.9:8080/live/144.m3u8: No route to host`

Screenshots or videos

No response

Solution

No response

Additional context

No response

Acknowledgements

rabilrbl commented 1 week ago

I have personally tested it with jellyfin and works fine on my end

rabilrbl commented 1 week ago

@mohit-kothari or @sannidhyaroy can confirm

rabilrbl commented 1 week ago

@aasimenator Maybe your bridge network is missing some configs can you try it with --network=host It should work

mohit-kothari commented 1 week ago

@mohit-kothari or @sannidhyaroy can confirm

Yes, working fine for me too with jellyfin. Based on the logs, it looks more like an network issue. May be the jiotv_go server is not reachable from the server you are running jellyfin in?

aasimenator commented 1 week ago

Ok, I tried it again... let me share more detailed information:

  1. App configuration: I am using CasaOS, on a VM in UNRaid and installed JIOTV as an app below is the exported yaml file
    name: mystifying_matsumoto
    services:
    mystifying_matsumoto:
    cpu_shares: 50
    command:
      - serve
      - --public
      - --port
      - "8080"
    deploy:
      resources:
        limits:
          memory: 7762M
    environment:
      - JIOTV_PATH_PREFIX=/app/.jiotv_go
      - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    image: ghcr.io/rabilrbl/jiotv_go:latest
    labels:
      icon: https://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/Jio_TV_logo.svg/1024px-Jio_TV_logo.svg.png
    ports:
      - target: 8080
        published: "8080"
        protocol: tcp
    restart: unless-stopped
    volumes:
      - type: bind
        source: /root/.jiotv_go
        target: /app/.jiotv_go
    x-casaos:
      envs:
        - container: PATH
          description:
            en_us: ""
        - container: JIOTV_PATH_PREFIX
          description:
            en_us: ""
      image: ""
      ports:
        - container: "8080"
          description:
            en_us: ""
      volumes:
        - container: /app/.jiotv_go
          description:
            en_us: ""
    devices: []
    cap_add: []
    network_mode: bridge
    privileged: false
    container_name: ""
    hostname: ""
    x-casaos:
    architectures:
    - amd64
    author: CasaOS User
    category: unknown
    description:
    en_us: ""
    developer: unknown
    hostname: ""
    icon: https://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/Jio_TV_logo.svg/1024px-Jio_TV_logo.svg.png
    image: null
    index: /
    is_uncontrolled: false
    main: mystifying_matsumoto
    port_map: "8080"
    scheme: http
    store_app_id: mystifying_matsumoto
    tagline:
    en_us: This is a compose app converted from a legacy app (CasaOS v0.4.3 or
      earlier)
    thumbnail: ""
    tips:
    custom: This is a compose app converted from a legacy app (CasaOS v0.4.3 or
      earlier)
    title:
    custom: ""
    en_us: JioTVGo

    The IP Address has now changed from what it was previously to 192.168.192.100

  2. I have logged in with my mobile number on http://192.168.192.100:8080/ and entered OTP and confirmed that it works in my browser.
  3. I added the LiveTV settings in JellyFin > Dashboard > Live TV > Turner Devices > Add > M3U Tuner > File or URL Screenshot 2024-09-10 222741
  4. I've added https://avkb.short.gy/jioepg.xml.gz in the XML TV Guide and waited for it to sync/refresh data.
  5. Enabled Live TV for the users, in their user's profile in JellyFin ("Allow Live TV access")

With the above, settings, in a browser on my PC, I can play any channels I want and they work fine through Jellyfin itself, but I cannot play them on my TV I get the following error: Playback failed. will retry...

attached is the log.txt immediately after failing to play live TV on the TV. Log.txt

Hopefully, this gives more context, as I said works fine on the browser through JellFin, also another note is that I had it working before, it worked for a few days and then stopped working but that was due to a different issue. I had issues getting the app to stay up and running via Unraid, it would stop running after a couple of hours.

recital-cpu commented 1 week ago

From yesterday All the zee channels are gone is it only me ?

rabilrbl commented 1 week ago

From yesterday All the zee channels are gone is it only me ?

Jio removed em

recital-cpu commented 1 week ago

From yesterday All the zee channels are gone is it only me ?

Jio removed em So is this the end or there is still hope

itsyourap commented 1 week ago

Media plays fine over the browser when directly accessing the URL

@aasimenator Are you accessing the URL from the device from which you are hosting it? If yes, then try from another device. Might be a firewall issue.

aasimenator commented 1 week ago

Media plays fine over the browser when directly accessing the URL

@aasimenator Are you accessing the URL from the device from which you are hosting it? If yes, then try from another device. Might be a firewall issue.

Short answer, No, I am not accessing it on the same device it is hosted on, I have tried from multiple devices.

  1. Device that hosts it [CASAOS] IP > 192.168.192.100
  2. JioTV Go App IP > 192.168.192.100:8080
  3. JellyFin IP: 192.168.192.95:8096 This is on the same host as the CASAOS but runs in a Docker container on UnRAID and not in CASAOS so runs on a different IP
  4. My PC: DHCP IP RANGE - again I can play media through JellyFin via the browser
  5. My Phone: I installed JellyFin last night on my phone, and I can confirm that I can play LiveTV on the Mobile as well.

Currently, the only thing that is not working is through the TV, and that used to work (even though it worked for a short while but it did work) My TV is MI TV QLED 55 Inch.

aasimenator commented 1 week ago

Any idea what those logs mean? "Details do not match for play item" "The remote party closed the WebSocket connection without completing the close handshake." Do i need to reset or refresh the app on the TV? maybe it is caching something?

image

rabilrbl commented 1 week ago

It's clearly because your jellyfin instance can't connect to your JioTV Go hosted network You still didn't try what I said in my previous comment. Use host network Add this to your compose file in JioTV Go for CasaOS

network_mode: host
aasimenator commented 1 week ago

It's clearly because your jellyfin instance can't connect to your JioTV Go hosted network You still didn't try what I said in my previous comment. Use host network Add this to your compose file in JioTV Go for CasaOS

network_mode: host

Ok, so why is my PC able to connect to the JellyFin Instance and place LiveTV? Am I not making it clear?

I have 2 PCs, One is my office pc running Windows 11, and the other PC is an HP 10th Gen Tiny running Unraid, It has Docker and VMs, one of the docker app is Jellyfin and one of the VM is CasaOs

The CASAOS IP is set to 192.168.192.100 JioTVGo App is installed on CASAOS with the host in the network (as per your last comment) see the image below. image

Secondly, if there was a connection issue between Jellyfin and JioTVGo then the m3u file will not get downloaded yes? but as you can clearly see the playlist.m3u gets downloaded from the JIOTVGo IP, this is the same IP in the error logs and the same IP I am using in JellyFin. The file size also looks correct as when downloaded on a PC it is the same size image image

So what else?

rabilrbl commented 1 week ago

Yup, thanks for the clarity. That's strange

But the issue is with jellyfin right? I don't think we have a bug in JioTV Go.

Also, are you using jellyfin docker image from linuxserver.io? If possible, can you try

https://docs.linuxserver.io/images/docker-jellyfin/

aasimenator commented 1 week ago

Also, are you using jellyfin docker image from linuxserver.io? If possible, can you try

https://docs.linuxserver.io/images/docker-jellyfin/

No i am using official JellyFin docker image > jellyfin/jellyfin:latest

rabilrbl commented 1 week ago

Closing this issue as it is related to an external service that is using JioTV Go For more discussion reach on Telegram community group in Linux topic at (https://telegram.me/jiotv_go_chat/)