Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlutoTV stops streaming when switching to a commercial #3462

Closed
1 task
TranzPhat opened this issue Dec 28, 2020 · 28 comments · Fixed by #4232
Closed
1 task

PlutoTV stops streaming when switching to a commercial #3462

TranzPhat opened this issue Dec 28, 2020 · 28 comments · Fixed by #4232
Labels
plugin issue A Plugin does not work correctly

Comments

@TranzPhat
Copy link

Bug Report

  • [x ] This is a bug report and I have read the contribution guidelines.
  • I am using the latest development version from the master branch.

Description

Streaming stops whenever plutoTV switches to a local commercial. I have seen this on various pluto news channels such as NEWSY and Newsmax. After a news segment, the channel will switch to local commercial and a message from pluto states that they will be right back - but the stream hangs at that point, never to return unless, the stream is restarted.

Expected / Actual behavior

I expect that if the channel switches segments that the stream will continue to play as normal, but it does not do this, the stream stops

Reproduction steps / Explicit stream URLs to test

  1. ...Tune to plutotv- Newsy and watch for 5-10 minutes until the segment changes
  2. ...for me at the change, streaming stops
  3. ...

Log output

REPLACE THIS TEXT WITH THE LOG OUTPUT

Additional comments, etc.

Love Streamlink? Please consider supporting our collective. Thanks!

@mkbloke
Copy link
Member

mkbloke commented Dec 28, 2020

What video player are you using? Some will not handle the stream delay as well as others. Have you tried mpv?

@TranzPhat
Copy link
Author

TranzPhat commented Dec 28, 2020 via email

@mkbloke
Copy link
Member

mkbloke commented Dec 28, 2020

I don't think your issue is with the PlutoTV plugin. I've got it streaming right now direct to mpv and it seems to be working fine.

I don't know anything about the other software you're using, so you're probably going to have to seek help elsewhere I'm afraid.

@TranzPhat
Copy link
Author

TranzPhat commented Dec 28, 2020 via email

@emveepee
Copy link

emveepee commented Dec 28, 2020

For me It varies by channel music channels are the worst.

streamlink https://pluto.tv/live-tv/mtv-spankin-new best
streamlink https://pluto.tv/live-tv/vevo-pop best

For me it is when this pluto image comes

image

followed by a pluto commercial not a channel commercial.

These fail with mpv, ffplay, vlc etc.

I can't seem to duplicate it with Newsy but the Pluto commercials aren't as frequent.

@bastimeyer
Copy link
Member

Post the debug log output (--loglevel debug), as mentioned in the issue template.

If your player crashes during an ad transition then it might be because of a stream discontinuity, which is not supported by Streamlink.

@mkbloke
Copy link
Member

mkbloke commented Dec 28, 2020

I just got an ffmpeg pipe copy failure. Running with --ffmpeg-verbose also.

@mkbloke
Copy link
Member

mkbloke commented Dec 28, 2020

I think it gets stuck at this point:

$ streamlink -l debug --ffmpeg-verbose https://pluto.tv/live-tv/mtv-spankin-new 240p
[cli][debug] OS:         Linux-5.4.0-58-generic-x86_64-with-glibc2.29
[cli][debug] Python:     3.8.5
[cli][debug] Streamlink: 2.0.0+1.g374130a
[cli][debug] Requests(2.25.1), Socks(1.7.1), Websocket(0.57.0)
[cli][info] Found matching plugin pluto for URL https://pluto.tv/live-tv/mtv-spankin-new
[utils.l10n][debug] Language code: en_GB
[cli][info] Available streams: 240p (worst), 480p, 720p_alt, 720p (best)
[cli][info] Opening stream: 240p (muxed-stream)
[stream.ffmpegmux][debug] Opening hls substream
[stream.hls][debug] Reloading playlist
[stream.hls][debug] First Sequence: 267960612; Last Sequence: 267960617
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 267960615; End Sequence: None
[stream.hls][debug] Adding segment 267960615 to queue
[stream.hls][debug] Adding segment 267960616 to queue
[stream.hls][debug] Adding segment 267960617 to queue
[stream.ffmpegmux][debug] ffmpeg command: ffmpeg -nostats -y -i /tmp/ffmpeg-290343-476 -c:v copy -c:a copy -map 0 -f mpegts pipe:1
[stream.ffmpegmux][debug] Starting copy to pipe: /tmp/ffmpeg-290343-476
[cli][debug] Pre-buffering 8192 bytes
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-liblensfun --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[stream.hls][debug] Download of segment 267960615 complete
Input #0, mpegts, from '/tmp/ffmpeg-290343-476':
  Duration: N/A, start: 38068.935844, bitrate: N/A
  Program 1 
    Stream #0:0[0x7d0](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 123 kb/s
    Stream #0:1[0x3e8]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, progressive), 426x240 [SAR 1:1 DAR 71:40], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Output #0, mpegts, to 'pipe:1':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0(eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 123 kb/s
    Stream #0:1: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, progressive), 426x240 [SAR 1:1 DAR 71:40], q=2-31, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[cli][info] Starting player: mpv
[cli.output][debug] Opening subprocess: mpv --force-media-title=https://pluto.tv/live-tv/mtv-spankin-new -
[cli][debug] Writing stream to output
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Download of segment 267960616 complete
[stream.hls][debug] Adding segment 267960618 to queue
[stream.hls][debug] Adding segment 267960619 to queue
[stream.hls][debug] Download of segment 267960617 complete
...
stream.hls][debug] Reloading playlist
[stream.hls][debug] Adding segment 267960672 to queue
[stream.hls][debug] Adding segment 267960673 to queue
[stream.hls][debug] Download of segment 267960655 complete
[mpegts @ 0x55c85b7ee740] New video stream 0:2 at pos:16900636 and DTS:1.42133s
[mpegts @ 0x55c85b7ee740] New audio stream 0:3 at pos:16907968 and DTS:1.4s
...
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Adding segment 267960679 to queue
[stream.hls][debug] Download of segment 267960658 complete
[stream.hls][debug] Adding segment 267960680 to queue
[mpegts @ 0x55c85b7ee740] DTS 129840 < 1474320 out of order
[stream.hls][debug] Download of segment 267960659 complete
[stream.hls][debug] Adding segment 267960681 to queue
[stream.ffmpegmux][error] Pipe copy aborted: /tmp/ffmpeg-290343-476
[stream.hls][debug] Download of segment 267960660 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Adding segment 267960694 to queue
[stream.hls][debug] Download of segment 267960661 complete
[stream.hls][debug] Adding segment 267960695 to queue

Streamlink is carrying on with the segment downloads after.

@bastimeyer bastimeyer added plugin issue A Plugin does not work correctly and removed does not meet requirements labels Dec 28, 2020
@mkbloke
Copy link
Member

mkbloke commented Dec 28, 2020

Just to note: I've edited the post above to include a bit more info in the log output. The new stream mappings are probably the likely cause I imagine.

@back-to
Copy link
Collaborator

back-to commented Dec 30, 2020

they just use different AD types

redirector ADs which currently won't work (used for Livechannels, but can be replaced with a valid segment)
uri=https://...-.akamaized.net/../redirector/...?url=https%3A%2F%2Fplutotv-.akamaized.net... title='AD'

creative ADs which seems to work
uri=https://....pluto.tv/..._ad/creative/..._ad/720p/.../hls/hls_...-00000.ts title=None

@pcolmer
Copy link

pcolmer commented Nov 27, 2021

@back-to Following up on your last comment, I wonder if you can explain a little further:

they just use different AD types

What is an AD type, please?

redirector ADs which currently won't work

Is there a plan to get them to work?

For my own use case, I'm trying to save the output of a Pluto TV stream to a file. Would it be possible to get streamlink to save its output to a different file each time the stream source changes? If it is, would that help because, in theory, the adverts would get saved to a different file and I'd "just" need to stitch together the programme parts?

I've tried using ffmpeg -c copy to repair a file copy of a stream from Pluto but playback breaks a few minutes into the adverts. I've also tried -c:v libx264 -crf 22 -preset slow to re-mux the file but that doesn't work either :(

@pcolmer
Copy link

pcolmer commented Nov 27, 2021

I'm also getting slightly different output when running streamlink and ffmpeg in debug mode compared with @mkbloke:

streamlink.exe -l debug --ffmpeg-verbose https://pluto.tv/en/live-tv/baywatch-gb best
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.9.8
[cli][debug] Streamlink: 3.0.2
[cli][debug] Requests(2.26.0), Socks(1.7.1), Websocket(1.2.1)
[cli][debug] Arguments:
[cli][debug]  url=https://pluto.tv/en/live-tv/baywatch-gb
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --ffmpeg-ffmpeg=C:\Program Files (x86)\Streamlink\ffmpeg\ffmpeg.exe
[cli][debug]  --ffmpeg-verbose=True
[cli][info] Found matching plugin pluto for URL https://pluto.tv/en/live-tv/baywatch-gb
[utils.l10n][debug] Language code: en_GB
[cli][info] Available streams: 570k (worst), 1000k, 1500k, 2100k, 3100k (best)
[cli][info] Opening stream: 3100k (muxed-stream)
[stream.ffmpegmux][debug] Opening hls substream
[stream.hls][debug] Reloading playlist
[utils.named_pipe][info] Creating pipe streamlinkpipe-5904-1-3924
[stream.ffmpegmux][debug] ffmpeg command: C:\Program Files (x86)\Streamlink\ffmpeg\ffmpeg.exe -nostats -y -i \\.\pipe\streamlinkpipe-5904-1-3924 -c:v copy -c:a copy -map 0 -f mpegts pipe:1
[stream.ffmpegmux][debug] Starting copy to pipe: \\.\pipe\streamlinkpipe-5904-1-3924
[cli][debug] Pre-buffering 8192 bytes
ffmpeg version n4.4.1-20211030 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10-win32 (GCC) 20210610
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=i686-w64-mingw32- --arch=i686 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libvmaf --enable-vulkan --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --disable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --disable-frei0r --enable-libglslang --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --disable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --disable-libsvtav1 --enable-libtwolame --disable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-libx264 --enable-libx265 --disable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20211030
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] First Sequence: 2; Last Sequence: 6
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 4; End Sequence: None
[stream.hls][debug] Adding segment 4 to queue
[stream.hls][debug] Adding segment 5 to queue
[stream.hls][debug] Adding segment 6 to queue
[stream.hls][debug] Segment 4 complete
[stream.hls][debug] Segment 5 complete
Input #0, mpegts, from '\\.\pipe\streamlinkpipe-5904-1-3924':
  Duration: N/A, start: 16.466667, bitrate: N/A
  Program 1
    Metadata:
      service_name    : Service
      service_provider: Hybrik
  Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
  Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 96 kb/s
Output #0, mpegts, to 'pipe:1':
  Metadata:
    encoder         : Lavf58.76.100
  Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 30 fps, 30 tbr, 90k tbn, 90k tbc
  Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 96 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[cli][info] Starting player: "C:\Program Files\VideoLAN\VLC\vlc.exe"
[cli.output][debug] Opening subprocess: "C:\Program Files\VideoLAN\VLC\vlc.exe" --input-title-format https://pluto.tv/en/live-tv/baywatch-gb -
[stream.hls][debug] Segment 6 complete
[cli][debug] Writing stream to output
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 7 to queue
[stream.hls][debug] Segment 7 complete
[mpegts @ 05a28980] New video stream 0:2 at pos:4954176 and DTS:0.111111s
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 8 to queue
[stream.hls][debug] Segment 8 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 9 to queue
[stream.hls][debug] Segment 9 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 10 to queue
[stream.hls][debug] Segment 10 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 11 to queue
[stream.hls][debug] Segment 11 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 12 to queue
[stream.hls][debug] Segment 12 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 13 to queue
[stream.hls][debug] Adding segment 14 to queue
[stream.hls][debug] Segment 13 complete
[stream.hls][debug] Segment 14 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 15 to queue
[stream.hls][debug] Segment 15 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 16 to queue
[stream.hls][debug] Segment 16 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 17 to queue
[stream.hls][debug] Segment 17 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 18 to queue
[stream.hls][debug] Segment 18 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 19 to queue
[stream.hls][debug] Segment 19 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted

If streamlink is started during a programme, VLC seems to be OK showing the video and audio until the end of the first advert. After that, it is audio only.

Once the main programme restarts, stopping and restarting streamlink resumes playback of video and audio, although the output still reports "Segments in this playlist are encrypted" so I'm not sure how relevant that is.

@AdamNo
Copy link

AdamNo commented Nov 30, 2021

Aloha,

i also find it annoying that commercials break playback. i am using tvheandend.
i could not find a robust ffmpeg setting to mitigate the breaks.

playing the streams direct with ffmpeg i could see the segment path and file names.

Sci-Fi Germany:

[tvheadend@tvheadend42 ~/tmp]$ ffmpeg -nostats -hide_banner -headers 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0' -headers 'Accept: */*' -headers 'Accept-Language: en-US,en;q=0.5' -headers 'Origin: https://pluto.tv' -headers 'Connection: keep-alive' -headers 'Sec-Fetch-Dest: empty' -headers 'Sec-Fetch-Mode: cors' -headers 'Sec-Fetch-Site: same-site' -headers 'TE: trailers' -i 'extracted from firefox dev console' -loglevel info -hide_banner -y -codec copy -map 0:0 -map 0:1 -f mpegts ~/tmp/out.ts 2>&1 | egrep -i "redirector|.ts'"
...
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/c6009f_pluto/clip/5e7df5554f626f001a4b431b_Sanctuary_DE_Dem_Untergang_geweiht_Teil_1_S4E12/720p/20200327_054510/hls/hls_2400-00226.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/c6009f_pluto/clip/5e7df5554f626f001a4b431b_Sanctuary_DE_Dem_Untergang_geweiht_Teil_1_S4E12/720p/20200327_054510/hls/hls_2400-00227.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/c6009f_pluto/clip/5e7df5554f626f001a4b431b_Sanctuary_DE_Dem_Untergang_geweiht_Teil_1_S4E12/720p/20200327_054510/hls/hls_2400-00228.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/d71341_Pluto_TV_OandO/clip/602d7eaed9dd8900073e62b3_PlutoTV_Ad_Bumper_GSA_05sec_20_11/720p/20210304_155055/hls/hls_2400-00000.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/006a44_62_ad/creative/617984f2617ed7bacafc7a65_ad/720p/20211027_165722/hls/hls_2400-00000.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/006a44_62_ad/creative/617984f2617ed7bacafc7a65_ad/720p/20211027_165722/hls/hls_2400-00001.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/3258fc_26_ad/creative/61a3d93a5498fdcb886e2eb5_ad/720p/20211128_193210/hls/hls_2400-00000.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/3258fc_26_ad/creative/61a3d93a5498fdcb886e2eb5_ad/720p/20211128_193210/hls/hls_2400-00001.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/3258fc_26_ad/creative/61a3d93a5498fdcb886e2eb5_ad/720p/20211128_193210/hls/hls_2400-00002.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/3258fc_26_ad/creative/61a3d93a5498fdcb886e2eb5_ad/720p/20211128_193210/hls/hls_2400-00003.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/3258fc_26_ad/creative/61a3d93a5498fdcb886e2eb5_ad/720p/20211128_193210/hls/hls_2400-00004.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/3258fc_26_ad/creative/61a3d93a5498fdcb886e2eb5_ad/720p/20211128_193210/hls/hls_2400-00005.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/e90b90_20_ad/creative/61841415a734bbbf9307b8cc_ad/720p/20211104_171045/hls/hls_2400-00000.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/e90b90_20_ad/creative/61841415a734bbbf9307b8cc_ad/720p/20211104_171045/hls/hls_2400-00001.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/6dce30_16_ad/creative/6184141eb858a46705057da5_ad/720p/20211104_171054/hls/hls_2400-00000.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/6dce30_16_ad/creative/6184141eb858a46705057da5_ad/720p/20211104_171054/hls/hls_2400-00001.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/afa1f0_91_ad/creative/619ad515bfdf83a7c5e32484_ad/720p/20211121_232405/hls/hls_2400-00000.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/afa1f0_91_ad/creative/619ad515bfdf83a7c5e32484_ad/720p/20211121_232405/hls/hls_2400-00001.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/afa1f0_91_ad/creative/619ad515bfdf83a7c5e32484_ad/720p/20211121_232405/hls/hls_2400-00002.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/afa1f0_91_ad/creative/619ad515bfdf83a7c5e32484_ad/720p/20211121_232405/hls/hls_2400-00003.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/95bc87_72_ad/creative/61752f1ff46f2d09f5c01f6a_ad/720p/20211024_100207/hls/hls_2400-00000.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/95bc87_72_ad/creative/61752f1ff46f2d09f5c01f6a_ad/720p/20211024_100207/hls/hls_2400-00001.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/95bc87_72_ad/creative/61752f1ff46f2d09f5c01f6a_ad/720p/20211024_100207/hls/hls_2400-00002.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/95bc87_72_ad/creative/61752f1ff46f2d09f5c01f6a_ad/720p/20211024_100207/hls/hls_2400-00003.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/95bc87_72_ad/creative/61752f1ff46f2d09f5c01f6a_ad/720p/20211024_100207/hls/hls_2400-00004.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/95bc87_72_ad/creative/61752f1ff46f2d09f5c01f6a_ad/720p/20211024_100207/hls/hls_2400-00005.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/d03b8d_71_ad/creative/5f47b8d6f024860007963bf0_ad/720p/20200827_064454/hls/hls_2400-00000.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/d03b8d_71_ad/creative/5f47b8d6f024860007963bf0_ad/720p/20200827_064454/hls/hls_2400-00001.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/d03b8d_71_ad/creative/5f47b8d6f024860007963bf0_ad/720p/20200827_064454/hls/hls_2400-00002.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/d03b8d_71_ad/creative/5f47b8d6f024860007963bf0_ad/720p/20200827_064454/hls/hls_2400-00003.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/d03b8d_71_ad/creative/5f47b8d6f024860007963bf0_ad/720p/20200827_064454/hls/hls_2400-00004.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/d03b8d_71_ad/creative/5f47b8d6f024860007963bf0_ad/720p/20200827_064454/hls/hls_2400-00005.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/fca960_76_ad/creative/603f6e8dd6ef440007929024_ad/720p/20210303_031005/hls/hls_2400-00000.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/fca960_76_ad/creative/603f6e8dd6ef440007929024_ad/720p/20210303_031005/hls/hls_2400-00001.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/fca960_76_ad/creative/603f6e8dd6ef440007929024_ad/720p/20210303_031005/hls/hls_2400-00002.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/0c9243_24_ad/creative/602aab0d47af6b0009b11b30_ad/720p/20210215_091037/hls/hls_2400-00000.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/0c9243_24_ad/creative/602aab0d47af6b0009b11b30_ad/720p/20210215_091037/hls/hls_2400-00001.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/0c9243_24_ad/creative/602aab0d47af6b0009b11b30_ad/720p/20210215_091037/hls/hls_2400-00002.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/d71341_Pluto_TV_OandO/clip/602d7eaed9dd8900073e62b3_PlutoTV_Ad_Bumper_GSA_05sec_20_11/720p/20210304_155055/hls/hls_2400-00000.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/c6009f_pluto/clip/5e7df5554f626f001a4b431b_Sanctuary_DE_Dem_Untergang_geweiht_Teil_1_S4E12/720p/20200327_054510/hls/hls_2400-00228.ts' for reading
[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/c6009f_pluto/clip/5e7df5554f626f001a4b431b_Sanctuary_DE_Dem_Untergang_geweiht_Teil_1_S4E12/720p/20200327_054510/hls/hls_2400-00229.ts' for reading

the ads have always "_ad0000[0-5]" in path & filename.

Sci-Fi United Kingdom:

[iptv@iptv-uk ~/tmp]$ ffmpeg -nostats -hide_banner -headers 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0' -headers 'Accept: */*' -headers 'Accept-Language: en-US,en;q=0.5' -headers 'Origin: https://pluto.tv' -headers 'Connection: keep-alive' -headers 'Sec-Fetch-Dest: empty' -headers 'Sec-Fetch-Mode: cors' -headers 'Sec-Fetch-Site: same-site' -headers 'TE: trailers' -i 'taken from firefox dev console' -loglevel info -hide_banner -y -codec copy -map 0:0 -map 0:1 -f mpegts ~/tmp/out.ts 2>&1 | egrep -i "redirector|.ts'"
...
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/e70d97_Multicom/clip/5b18f05f93be6132507af65a_A_Century_of_Science_Fiction_Alien_Life_Forms_S1E2/720p/20191201_070108/hls/0-end/hls_2400-00311.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/e70d97_Multicom/clip/5b18f05f93be6132507af65a_A_Century_of_Science_Fiction_Alien_Life_Forms_S1E2/720p/20191201_070108/hls/0-end/hls_2400-00312.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/e70d97_Multicom/clip/5b18f05f93be6132507af65a_A_Century_of_Science_Fiction_Alien_Life_Forms_S1E2/720p/20191201_070108/hls/0-end/hls_2400-00313.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/d71341_Pluto_TV_OandO/clip/5ba93e771cae2e20876861d3_UK_Bumper/720p/20180924_124353/hls/hls_2400-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/81dbbc_78_ad/creative/6190518073979acfcf7e7623_ad/720p/20211114_000001/hls/hls_2400-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/81dbbc_78_ad/creative/6190518073979acfcf7e7623_ad/720p/20211114_000001/hls/hls_2400-00001.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/81dbbc_78_ad/creative/6190518073979acfcf7e7623_ad/720p/20211114_000001/hls/hls_2400-00002.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/81dbbc_78_ad/creative/6190518073979acfcf7e7623_ad/720p/20211114_000001/hls/hls_2400-00003.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/81dbbc_78_ad/creative/6190518073979acfcf7e7623_ad/720p/20211114_000001/hls/hls_2400-00004.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/81dbbc_78_ad/creative/6190518073979acfcf7e7623_ad/720p/20211114_000001/hls/hls_2400-00005.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/aaeedf_53_ad/creative/5f44e6820753d300073c8630_ad/720p/20200825_032258/hls/hls_2400-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/aaeedf_53_ad/creative/5f44e6820753d300073c8630_ad/720p/20200825_032258/hls/hls_2400-00001.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/aaeedf_53_ad/creative/5f44e6820753d300073c8630_ad/720p/20200825_032258/hls/hls_2400-00002.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/431d82_66_ad/creative/5f44e67f93f4950007dbbfc1_ad/720p/20200825_032255/hls/hls_2400-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/431d82_66_ad/creative/5f44e67f93f4950007dbbfc1_ad/720p/20200825_032255/hls/hls_2400-00001.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/431d82_66_ad/creative/5f44e67f93f4950007dbbfc1_ad/720p/20200825_032255/hls/hls_2400-00002.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/431d82_66_ad/creative/5f44e67f93f4950007dbbfc1_ad/720p/20200825_032255/hls/hls_2400-00003.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/431d82_66_ad/creative/5f44e67f93f4950007dbbfc1_ad/720p/20200825_032255/hls/hls_2400-00004.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/431d82_66_ad/creative/5f44e67f93f4950007dbbfc1_ad/720p/20200825_032255/hls/hls_2400-00005.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/95bc87_72_ad/creative/5f44e67525d19400086dda68_ad/720p/20200825_032245/hls/hls_2400-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/95bc87_72_ad/creative/5f44e67525d19400086dda68_ad/720p/20200825_032245/hls/hls_2400-00001.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/95bc87_72_ad/creative/5f44e67525d19400086dda68_ad/720p/20200825_032245/hls/hls_2400-00002.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/95bc87_72_ad/creative/5f44e67525d19400086dda68_ad/720p/20200825_032245/hls/hls_2400-00003.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/90e005_55_ad/creative/61a4f041e465af459e8a4e22_ad/720p/20211129_152241/hls/hls_2400-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/90e005_55_ad/creative/61a4f041e465af459e8a4e22_ad/720p/20211129_152241/hls/hls_2400-00001.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/90e005_55_ad/creative/61a4f041e465af459e8a4e22_ad/720p/20211129_152241/hls/hls_2400-00002.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/d71341_Pluto_TV_OandO/clip/5ba93e771cae2e20876861d3_UK_Bumper/720p/20180924_124353/hls/hls_2400-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/d71341_Pluto_TV_OandO/clip/56c2dcd7222d7c7767c715e0_Abstract_Color_Icon_5s_v1_Promo/720p/20200309_192618/hls/hls_2400-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/staging3/clip/Pluto_TV_OandO/58e53835dca3c3a22fbdc752_plutotv_filler_1_batch_20170404/720p/20200306_124313/hls/hls_2400-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/779_Pluto_TV_OandO/clip/61a505f1b3a6230007a32c43_Promo_SciFi_StarTrekDiscovery_UK_15s/720p/20211129_085534/hls/hls_2400-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/779_Pluto_TV_OandO/clip/61a505f1b3a6230007a32c43_Promo_SciFi_StarTrekDiscovery_UK_15s/720p/20211129_085534/hls/hls_2400-00001.ts' for reading

the ads have always "_ad0000[0-5]" in path & filename.

Sci-Fi United States:

[iptv@iptv-us ~/tmp]$ ffmpeg -nostats -hide_banner -headers 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0' -headers 'Accept: */*' -headers 'Accept-Language: en-US,en;q=0.5' -headers 'Origin: https://pluto.tv' -headers 'Connection: keep-alive' -headers 'Sec-Fetch-Dest: empty' -headers 'Sec-Fetch-Mode: cors' -headers 'Sec-Fetch-Site: same-site' -headers 'TE: trailers' -i 'taken from firefox dev console' -loglevel info -hide_banner -y -codec copy -map 0:0 -map 0:1 -fflags -f mpegts ~/tmp/out.ts 2>&1 | egrep -i "redirector|.ts'"
...
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/c6009f_pluto/clip/5d5319caad0598d60967c4ea_ReGenesis_Race_Fever_S4E6/720p/20190813_131258/hls/597514-966049/hls_1600-00071.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/c6009f_pluto/clip/5d5319caad0598d60967c4ea_ReGenesis_Race_Fever_S4E6/720p/20190813_131258/hls/597514-966049/hls_1600-00072.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/c6009f_pluto/clip/5d5319caad0598d60967c4ea_ReGenesis_Race_Fever_S4E6/720p/20190813_131258/hls/597514-966049/hls_1600-00073.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/9b4aa4_75_ad/creative/618021386ad722675d4fe249_ad/720p/20211101_171744/hls/hls_1600-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/9b4aa4_75_ad/creative/618021386ad722675d4fe249_ad/720p/20211101_171744/hls/hls_1600-00001.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/9b4aa4_75_ad/creative/618021386ad722675d4fe249_ad/720p/20211101_171744/hls/hls_1600-00002.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/9b4aa4_75_ad/creative/618021386ad722675d4fe249_ad/720p/20211101_171744/hls/hls_1600-00003.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/9b4aa4_75_ad/creative/618021386ad722675d4fe249_ad/720p/20211101_171744/hls/hls_1600-00004.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/9b4aa4_75_ad/creative/618021386ad722675d4fe249_ad/720p/20211101_171744/hls/hls_1600-00005.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/d11384_89_ad/creative/615141c2f5f555fdd78a953b_ad/720p/20210927_040002/hls/hls_1600-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/d11384_89_ad/creative/615141c2f5f555fdd78a953b_ad/720p/20210927_040002/hls/hls_1600-00001.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/d11384_89_ad/creative/615141c2f5f555fdd78a953b_ad/720p/20210927_040002/hls/hls_1600-00002.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/d11384_89_ad/creative/615141c2f5f555fdd78a953b_ad/720p/20210927_040002/hls/hls_1600-00003.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/d11384_89_ad/creative/615141c2f5f555fdd78a953b_ad/720p/20210927_040002/hls/hls_1600-00004.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/d11384_89_ad/creative/615141c2f5f555fdd78a953b_ad/720p/20210927_040002/hls/hls_1600-00005.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/006a44_62_ad/creative/60f8ff556fff397af659f8fe_ad/720p/20210722_051709/hls/hls_1600-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/006a44_62_ad/creative/60f8ff556fff397af659f8fe_ad/720p/20210722_051709/hls/hls_1600-00001.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/006a44_62_ad/creative/60f8ff556fff397af659f8fe_ad/720p/20210722_051709/hls/hls_1600-00002.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/006a44_62_ad/creative/60f8ff556fff397af659f8fe_ad/720p/20210722_051709/hls/hls_1600-00003.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/006a44_62_ad/creative/60f8ff556fff397af659f8fe_ad/720p/20210722_051709/hls/hls_1600-00004.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/006a44_62_ad/creative/60f8ff556fff397af659f8fe_ad/720p/20210722_051709/hls/hls_1600-00005.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/0e880b_27_ad/creative/606bce8f4fe9dd28253e4d5f_ad/720p/20210405_195927/hls/hls_1600-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/0e880b_27_ad/creative/606bce8f4fe9dd28253e4d5f_ad/720p/20210405_195927/hls/hls_1600-00001.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/0e880b_27_ad/creative/606bce8f4fe9dd28253e4d5f_ad/720p/20210405_195927/hls/hls_1600-00002.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/e90b90_20_ad/creative/615a7c6ba2d53b5a0b88288a_ad/720p/20211004_040043/hls/hls_1600-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/e90b90_20_ad/creative/615a7c6ba2d53b5a0b88288a_ad/720p/20211004_040043/hls/hls_1600-00001.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/e90b90_20_ad/creative/615a7c6ba2d53b5a0b88288a_ad/720p/20211004_040043/hls/hls_1600-00002.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/e90b90_20_ad/creative/615a7c6ba2d53b5a0b88288a_ad/720p/20211004_040043/hls/hls_1600-00003.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/e90b90_20_ad/creative/615a7c6ba2d53b5a0b88288a_ad/720p/20211004_040043/hls/hls_1600-00004.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/e90b90_20_ad/creative/615a7c6ba2d53b5a0b88288a_ad/720p/20211004_040043/hls/hls_1600-00005.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/006a44_62_ad/creative/617984f2617ed7bacafc7a65_ad/720p/20211027_165722/hls/hls_1600-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/006a44_62_ad/creative/617984f2617ed7bacafc7a65_ad/720p/20211027_165722/hls/hls_1600-00001.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/e90b90_20_ad/creative/61841415a734bbbf9307b8cc_ad/720p/20211104_171045/hls/hls_1600-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/e90b90_20_ad/creative/61841415a734bbbf9307b8cc_ad/720p/20211104_171045/hls/hls_1600-00001.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/c6009f_pluto/clip/5d5319caad0598d60967c4ea_ReGenesis_Race_Fever_S4E6/720p/20190813_131258/hls/966049-1327452/hls_1600-00000.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/c6009f_pluto/clip/5d5319caad0598d60967c4ea_ReGenesis_Race_Fever_S4E6/720p/20190813_131258/hls/966049-1327452/hls_1600-00001.ts' for reading
[hls @ 0x8060f7000] Opening 'crypto+https://siloh-aka.plutotv.net/c6009f_pluto/clip/5d5319caad0598d60967c4ea_ReGenesis_Race_Fever_S4E6/720p/20190813_131258/hls/966049-1327452/hls_1600-00002.ts' for reading

also, the ads have always "_ad0000[0-5]" in path & filename.

the difference is UK & DE have an ad bumper segment in-front and at the end of ads, where US does not:
i.e.: DE

[hls @ 0x80f455000] Opening 'crypto+https://siloh-aka.plutotv.net/d71341_Pluto_TV_OandO/clip/602d7eaed9dd8900073e62b3_PlutoTV_Ad_Bumper_GSA_05sec_20_11/720p/20210304_155055/hls/hls_2400-00000.ts' for reading
UK
[hls @ 0x8060f7000] Opening 'crypto+https://siloh.pluto.tv/d71341_Pluto_TV_OandO/clip/5ba93e771cae2e20876861d3_UK_Bumper/720p/20180924_124353/hls/hls_2400-00000.ts' for reading

with sl parameter "--hls-segment-ignore-names 000,001,002,003,004,005" i could skip the ad segments but unfortunately also the first segments of the regular content after the ad ends.
it looks then like this:

[tvheadend@tvheadend42 ~/tmp]$ /home/tvheadend/.local/bin/streamlink -f --hls-segment-ignore-names 000,001,002,003,004,005 --loglevel info --default-stream best --locale de_DE --hls-live-edge 10 --hls-audio-select "de" -O "https://pluto.tv/en/live-tv/pluto-tv-star-trek-de" -o ~/tmp/out-sl.ts
[cli][info] Found matching plugin pluto for URL https://pluto.tv/en/live-tv/pluto-tv-star-trek-de
[cli][info] Available streams: 570k (worst), 1000k, 1500k, 2100k, 3100k (best)
[cli][info] Opening stream: 3100k (muxed-stream)
[utils.named_pipe][info] Creating pipe streamlinkpipe-20243-1-9704
[download][out-sl.ts] Written 280.5 MB (14m53s @ 361.4 KB/s)                                                                                                                                                       [stream.hls][info] Filtering out segments and pausing stream output
[stream.hls][info] Resuming stream output
[download][out-sl.ts] Written 624.0 MB (37m16s @ 297.8 KB/s)                                                                                                                                                       [stream.hls][info] Filtering out segments and pausing stream output
[stream.hls][info] Resuming stream output
[download][out-sl.ts] Written 627.9 MB (40m53s @ 24.6 KB/s)                                                                                                                                                        [stream.hls][info] Filtering out segments and pausing stream output
[stream.hls][info] Resuming stream output
[download][out-sl.ts] Written 1.02 GB (1h4m49s @ 241.0 KB/s)                                                                                                                                                       [stream.hls][info] Filtering out segments and pausing stream output
^C[cli][info] Stream ended
Interrupted! Exiting...
[cli][info] Closing currently open stream...

tvheadend starts reconnecting on "Filtering out segments and pausing stream output" and resumes playback on "Resuming stream output".

thats not ideal!

@back-to could you introduce a new parameter, let"s say "--hls-segment-replace-names", as you wrote, to replace segments based on regexp with valid ones?
i.e.: --hls-segment-replace-names _ad*0000[0-5],...

That would give us the most flexibility. I would like to keep the bumper segments i.e..

@mkbloke
Copy link
Member

mkbloke commented Nov 30, 2021

How about this: https://raw.githubusercontent.com/mkbloke/streamlink/pluto/src/streamlink/plugins/pluto.py

$ streamlink https://pluto.tv/en/live-tv/pluto-tv-cine-estelar-1 570k
[cli][info] Found matching plugin pluto for URL https://pluto.tv/en/live-tv/pluto-tv-cine-estelar-1
[cli][info] Available streams: 570k (worst), 1000k, 1500k, 2100k, 3100k (best)
[cli][info] Opening stream: 570k (muxed-stream)
[utils.named_pipe][info] Creating pipe streamlinkpipe-992201-1-9249
[cli][info] Starting player: mpv
[stream.hls][info] Filtering out segments and pausing stream output
[stream.hls][info] Resuming stream output
[cli][info] Player closed
[cli][info] Stream ended
[cli][info] Closing currently open stream...

@bastimeyer
Copy link
Member

Since I haven't commented on this thread yet, let just quickly say that HLS discontinuities are not supported by Streamlink. The only workaround is filtering out segments from the other stream(s) after a discontinuity (eg. advertisements), similar to what other plugins are doing, but that will still leave a gap in the output. The discontinuities are a bigger problem in the plugin here compared to other plugins, because the output is a MuxedStream and not an HLSStream, so FFmpeg will complain when the unfiltered output gets read and a discontinuity occurs.

Why does the PlutoTV plugin even output MuxedStreams instead of HLSStreams? It even sets ffmpeg-fout to mpegts, which doesn't have any effect if the HLS stream is already an mpegts stream, which is the case because fragmented mp4 HLS streams were only implemented by me a few months ago (the second type of HLS stream formats), more than half a year later compared to when the plugin was added, so only mpegts streams were supported at that time anyway.
#3363 (comment)
https://github.com/streamlink/streamlink/blob/3.0.3/src/streamlink/plugins/pluto.py#L94-L96


@mkbloke, HLS segments should not be filtered out via the HLSStreamWriter.ignore_names regex. This is the old "hacky" way that was implemented before I've implemented an actual filtering mechanic and it is only kept for backwards compatiblity or usage via CLI parameters. The entire init method should also not be re-implemented, because otherwise it will introduce bugs later one when the parent class gets updated.

If you want to filter out HLS segments properly, then use the HLSStreamWriter.should_filter_sequence() method. Take a look at the Twitch plugin on how to do this. There are also lots of tests for this.

@mkbloke
Copy link
Member

mkbloke commented Dec 1, 2021

Thanks, @bastimeyer. I've used HLSStreamWriter.should_filter_sequence() instead. I've also dropped the MuxedStreams and self.session.set_option('ffmpeg-fout', 'mpegts').


I've pushed further changes, so if anybody would like to try the plugin as it is now, it's the same URL as above, just reload in your browser to make sure you have the latest version.

I have been trying the latest changes on https://pluto.tv/live-tv/mtv-spankin-new and all seems to be well for me so far.

If folks can test and let me know, that would be great. I have not checked adverts in 'On Demand' content as yet.

$ streamlink --http-proxy 'socks4://localhost:9050' https://pluto.tv/live-tv/mtv-spankin-new 240p
[cli][info] Found matching plugin pluto for URL https://pluto.tv/live-tv/mtv-spankin-new
[cli][info] Available streams: 240p (worst), 360p, 480p_alt, 480p, 720p (best)
[cli][info] Opening stream: 240p (hls-pluto)
[cli][info] Starting player: mpv
[stream.hls][info] Filtering out segments and pausing stream output
[stream.hls][info] Resuming stream output
[stream.hls][info] Filtering out segments and pausing stream output
[stream.hls][info] Resuming stream output
$ streamlink https://pluto.tv/en/live-tv/pluto-tv-sci-fi-gb 570k
[cli][info] Found matching plugin pluto for URL https://pluto.tv/en/live-tv/pluto-tv-sci-fi-gb
[cli][info] Available streams: 570k (worst), 1000k, 1500k, 2100k, 3100k (best)
[cli][info] Opening stream: 570k (hls-pluto)
[cli][info] Starting player: mpv
[stream.hls][info] Filtering out segments and pausing stream output
[stream.hls][info] Resuming stream output

@AdamNo
Copy link

AdamNo commented Dec 1, 2021

Servus @mkbloke,

[tvheadend@tvheadend42 ~/tmp]$ /home/tvheadend/.local/bin/streamlink --version
streamlink 3.0.3+2.g46f4841
[tvheadend@tvheadend42 ~/tmp]$ /home/tvheadend/.local/bin/streamlink -f --loglevel info --default-stream best --locale de_DE --hls-live-edge 10 --hls-audio-select "de" -O "https://pluto.tv/en/live-tv/pluto-tv-sci-fi-de" -o ~/tmp/out-sl.ts
[cli][info] Found matching plugin pluto for URL https://pluto.tv/en/live-tv/pluto-tv-sci-fi-de
[cli][info] Available streams: 570k (worst), 1000k, 1500k, 2100k, 3100k (best)
[cli][info] Opening stream: 3100k (muxed-stream)
[utils.named_pipe][info] Creating pipe streamlinkpipe-96149-1-6439
[download][out-sl.ts] Written 252.4 MB (59m48s @ 14.0 KB/s)                                                                                                                                               ^C[cli][info] Stream ended
Interrupted! Exiting...
[cli][info] Closing currently open stream...

with version 3.0.3+2.g46f4841 no filtering of segments!

am i missing something?

@mkbloke
Copy link
Member

mkbloke commented Dec 1, 2021

@AdamNo, you'll need to download the plugin from the link above and place it into your existing Streamlink installation.

[cli][info] Opening stream: 3100k (muxed-stream)

That line should end with (hls-pluto) when using the plugin from the link above.

@AdamNo
Copy link

AdamNo commented Dec 1, 2021

thx @mkbloke,

with your patch applied i zapped through the pluto.tv channels.

content coming from pluto.tv cdn show no DTS discontinuities.
Players like vlc, totem or mpv stop playback on streamlink output halt/pause.
tvheadend reconnects and resumes.

with $>streamlink -o "filename" recorded/saved streams play the content without the ads.

CBSN channels are different. The content is from cbsn cdn, the ads are from dai.google.com.
i.e. CBSN New York:

[https @ 0x807128000] Opening 'https://cbsn-ny.cbsnstream.cbsnews.com/out/v1/ec3897d58a9b45129a77d67aa247d136/master_7_11828623.ts?m=1558539690' for reading
[https @ 0x806da9000] Opening 'https://cbsn-ny.cbsnstream.cbsnews.com/out/v1/ec3897d58a9b45129a77d67aa247d136/master_7_11828624.ts?m=1558539690' for reading
[https @ 0x806da9000] Opening 'https://cbsn-ny.cbsnstream.cbsnews.com/out/v1/ec3897d58a9b45129a77d67aa247d136/master_7_11828625.ts?m=1558539690' for reading
[hls @ 0x8060f7000] keepalive request failed for 'https://dai.google.com/linear/pods/v1/p/jeTDC610T-OSPdiWhcl0Pg/ca6b5ce9-5447-4c5f-9694-35f421dfabf1:MRN2/30872/0/0/51e8e3fe4ca3e1c91f55abe3391415ad/0.ts' with error: 'Invalid argument' when opening url, retrying with new connection
[hls @ 0x8060f7000] Opening 'https://dai.google.com/linear/pods/v1/p/jeTDC610T-OSPdiWhcl0Pg/ca6b5ce9-5447-4c5f-9694-35f421dfabf1:MRN2/30872/0/0/51e8e3fe4ca3e1c91f55abe3391415ad/0.ts' for reading
[hls @ 0x8060f7000] keepalive request failed for 'https://dai.google.com/linear/pods/v1/p/jeTDC610T-OSPdiWhcl0Pg/ca6b5ce9-5447-4c5f-9694-35f421dfabf1:MRN2/30872/0/0/51e8e3fe4ca3e1c91f55abe3391415ad/1.ts' with error: 'Invalid argument' when opening url, retrying with new connection
[hls @ 0x8060f7000] Opening 'https://dai.google.com/linear/pods/v1/p/jeTDC610T-OSPdiWhcl0Pg/ca6b5ce9-5447-4c5f-9694-35f421dfabf1:MRN2/30872/0/0/51e8e3fe4ca3e1c91f55abe3391415ad/1.ts' for reading
[hls @ 0x8060f7000] keepalive request failed for 'https://dai.google.com/linear/pods/v1/p/jeTDC610T-OSPdiWhcl0Pg/ca6b5ce9-5447-4c5f-9694-35f421dfabf1:MRN2/30872/0/0/51e8e3fe4ca3e1c91f55abe3391415ad/2.ts' with error: 'Invalid argument' when opening url, retrying with new connection
[hls @ 0x8060f7000] Opening 'https://dai.google.com/linear/pods/v1/p/jeTDC610T-OSPdiWhcl0Pg/ca6b5ce9-5447-4c5f-9694-35f421dfabf1:MRN2/30872/0/0/51e8e3fe4ca3e1c91f55abe3391415ad/2.ts' for reading
...
[https @ 0x806da9000] Opening 'https://cbsn-ny.cbsnstream.cbsnews.com/out/v1/ec3897d58a9b45129a77d67aa247d136/master_7_11828649.ts?m=1558539690' for reading
[https @ 0x806da9000] Opening 'https://cbsn-ny.cbsnstream.cbsnews.com/out/v1/ec3897d58a9b45129a77d67aa247d136/master_7_11828650.ts?m=1558539690' for reading
[https @ 0x807128000] Opening 'https://cbsn-ny.cbsnstream.cbsnews.com/out/v1/ec3897d58a9b45129a77d67aa247d136/master_7_11828651.ts?m=1558539690' for reading

the ads play in tvheadend with stutter audio and no/black video and finally tvh reconnets.

vlc, totem and mpv while playing back such recorded stream jump over this part. i saw the video playback progress bar jumping.

when the ads end tvheadend reports:

2021-12-01 17:43:26.571 spawn: [mpegts @ 0x80f455000] New audio stream 0:5 at pos:484064656 and DTS:0s
2021-12-01 17:43:26.571 spawn: [mpegts @ 0x80f455000] New video stream 0:6 at pos:484065032 and DTS:0s

overall, playback over tvheadend does not come into complete disorder as before!

that are my findings so far. i keep on zapping and let you know :)

@mkbloke
Copy link
Member

mkbloke commented Dec 1, 2021

Thanks for the feedback, @AdamNo. I've added dai.google.com to the filtering and tested it on CBSN. It seems to work for me. I've pushed that change to my repo at the link above.

I've also noticed the plugin requires a bit of an update for some of the VoD content. Movies play fine, but not all URLs are recognised for series content and of the series content URLs that are recognised, the slug API lookup results in a 404 with the content I have tried so far. Advert segment filtering for movies has worked for the content I have tried so far as it's caught with the _ad/creative/ part of the regex.

@emveepee
Copy link

emveepee commented Dec 1, 2021

I've pushed further changes, so if anybody would like to try the plugin as it is now, it's the same URL as above, just reload in your browser to make sure you have the latest version.

I have been trying the latest changes on https://pluto.tv/live-tv/mtv-spankin-new and all seems to be well for me so far.

I posted about MTV Spankin' New earlier and see noticeable improvements in the test release with streamlink cli and with recordings and when the logo comes up which was sudden death before things get better. For Live TV in NextPVR the long pause is still an issue.

Unrelated to this be aware there is a v4 VOD format that has been used for a few months for series and AFAIK streamlink doesn't support it.

@mkbloke
Copy link
Member

mkbloke commented Dec 1, 2021

I posted about MTV Spankin' New earlier and see noticeable improvements in the test release with streamlink cli and with recordings and when the logo comes up which was sudden death before things get better. For Live TV in NextPVR the long pause is still an issue.

Thanks for the feedback, @emveepee. I don't know much about NextPVR. It looks to be closed source. I think the issue you're having will need to be resolved by them though.

Unrelated to this be aware there is a v4 VOD format that has been used for a few months for series and AFAIK streamlink doesn't support it.

Thanks for the info. I'll take a look at it soon.

@emveepee
Copy link

emveepee commented Dec 1, 2021

Thanks for the feedback, @emveepee. I don't know much about NextPVR. It looks to be closed source. I think the issue you're having will need to be resolved by them though.

This was more a general comment, since any application using this strategy for Live TV playback from PlutoTV vs recording playback will probably have a difficult time dealing with potential long periods of no video.

@AdamNo
Copy link

AdamNo commented Dec 2, 2021

so far, i have not found another candidate for filtering segments.
VoD i am not using. So, i am of no help here.

mainly i want you to know, that i wanted to donate some money.
unfortunately i was ask to full fill a captcha(s).
i guess it's because my notebook, i am currently writing from, goes per default to VPN Frankfurt Germany.

i wrote support support@opencollective.com that i find it annoying and that i am not doing it.
also, going into my FW and disabling some rules i don't like, but may you guys find a provider without this obstacles.

@pcolmer
Copy link

pcolmer commented Dec 3, 2021

Thank you @mkbloke for improving the handling of adverts by the plugin. Sending the output to a file results in a good "recording" but it is still necessary to run ffmpeg -c copy over that file in order to fix the timestamps.

@mkbloke
Copy link
Member

mkbloke commented Dec 14, 2021

Any thoughts from the Pluto plugin users here on removing the bumpers?

#4249 (comment)

@merrychrishna
Copy link

im having the same porblem with streams freezing on commercials or ads. but the link to the plugin is dead. whats the new link?

@mkbloke
Copy link
Member

mkbloke commented Feb 20, 2023

The Pluto plugin is in the master branch. If there's an issue with it, file a new issue, completing all the required details and including a debug log.

@streamlink streamlink locked as resolved and limited conversation to collaborators Feb 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
plugin issue A Plugin does not work correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants