Skip to content

plugins.tf1: fix stream matcher #6439

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

Merged

Conversation

bastimeyer
Copy link
Member

@bastimeyer bastimeyer commented Feb 18, 2025

Fixes #6438

The format of the URLs that are supposed to be matched by the plugin's "stream" matcher have changed and incorrectly get matched by its "live" matcher, leading to a different API URL request that returns 404. The "stream" matcher needs a simple update and the "live" matcher must not match the format of the "stream" matcher.

$ HTTPS_PROXY=socks5://localhost:1920 ./script/test-plugin-urls.py tf1
:: https://lci.fr/direct
::  234p, 360p, 576p_alt, 576p, 720p, worst, best
:: https://tf1.fr/tf1/direct
::  234p, 360p, 576p_alt, 576p, 720p, worst, best
:: https://tf1info.fr/direct/
::  234p, 360p, 576p_alt, 576p, 720p, worst, best
:: https://www.lci.fr/direct
::  234p, 360p, 576p_alt, 576p, 720p, worst, best
:: https://www.tf1.fr/chante-69061019/direct
::  234p, 270p, 360p, 576p, worst, best
:: https://www.tf1.fr/tf1-series-films/direct
::  234p, 360p, 576p_alt, 576p, 720p, worst, best
:: https://www.tf1.fr/tf1/direct
::  234p, 360p, 576p_alt, 576p, 720p, worst, best
:: https://www.tf1.fr/tfx/direct
::  234p, 360p, 576p_alt, 576p, 720p, worst, best
:: https://www.tf1.fr/thriller-fiction-89242722/direct
::  234p, 270p, 360p, 576p, worst, best
:: https://www.tf1info.fr/direct/
::  234p, 360p, 576p_alt, 576p, 720p, worst, best

Throw-away account with a throw-away email address

$ streamlink -l debug --http-proxy socks5h://localhost:1920 --tf1-email xoras36325@btcours.com --tf1-password Qwerty123! --tf1-purge-credentials https://www.tf1.fr/thriller-fiction-89242722/direct best
[cli][debug] OS:         Linux-6.13.3-1-git-x86_64-with-glibc2.41
[cli][debug] Python:     3.13.2
[cli][debug] OpenSSL:    OpenSSL 3.4.1 11 Feb 2025
[cli][debug] Streamlink: 7.1.3+1.g75ed38e2
[cli][debug] Dependencies:
[cli][debug]  certifi: 2025.1.31
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 5.3.1
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.21.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.3
[cli][debug]  trio: 0.29.0
[cli][debug]  trio-websocket: 0.11.1
[cli][debug]  urllib3: 2.3.0
[cli][debug]  websocket-client: 1.8.0
[cli][debug] Arguments:
[cli][debug]  url=https://www.tf1.fr/thriller-fiction-89242722/direct
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --player=/usr/bin/mpv
[cli][debug]  --http-proxy=socks5h://localhost:1920
[cli][debug]  --webbrowser-headless=True
[cli][debug]  --tf1-email=xoras36325@btcours.com
[cli][debug]  --tf1-password=********
[cli][debug]  --tf1-purge-credentials=True
[cli][info] Found matching plugin tf1 for URL https://www.tf1.fr/thriller-fiction-89242722/direct
[plugins.tf1][debug] Found channel thriller-fiction-89242722 (L_FAST_v2l-thriller-fiction-89242722)
[plugins.tf1][info] Removing cached user-authentication token...
[plugins.tf1][info] Acquiring new user-authentication token...
[plugins.tf1][debug] uid='955496d149b342ac8c077abafcd79926' uid_signature='RKKFFt8F3d8+0ub2MXeDYrku2nk=' signature_timestamp='1739918358'
[utils.l10n][debug] Language code: en_US
[stream.ffmpegmux][debug] ffmpeg version n7.1 Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 14.2.1 (GCC) 20240910
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan
libavutil      59. 39.100 / 59. 39.100
libavcodec     61. 19.100 / 61. 19.100
libavformat    61.  7.100 / 61.  7.100
libavdevice    61.  3.100 / 61.  3.100
libavfilter    10.  4.100 / 10.  4.100
libswscale      8.  3.100 /  8.  3.100
libswresample   5.  3.100 /  5.  3.100
libpostproc    58.  3.100 / 58.  3.100
[stream.hls][debug] Using external audio tracks for stream 576p (language=fr, name=French)
[stream.hls][debug] Using external audio tracks for stream 360p (language=fr, name=French)
[stream.hls][debug] Using external audio tracks for stream 270p (language=fr, name=French)
[stream.hls][debug] Using external audio tracks for stream 234p (language=fr, name=French)
[cli][info] Available streams: 234p (worst), 270p, 360p, 576p (best)
[cli][info] Opening stream: 576p (hls-multi)
[cli][info] Starting player: /usr/bin/mpv
[stream.ffmpegmux][debug] Opening hls substream
[stream.hls][debug] Reloading playlist
[stream.ffmpegmux][debug] Opening hls substream
[stream.hls][debug] Reloading playlist
[utils.named_pipe][info] Creating pipe streamlinkpipe-214112-1-6149
[utils.named_pipe][info] Creating pipe streamlinkpipe-214112-2-9315
[stream.ffmpegmux][debug] ffmpeg command: ['/usr/bin/ffmpeg', '-y', '-nostats', '-loglevel', 'info', '-i', '/tmp/streamlinkpipe-214112-1-6149', '-i', '/tmp/streamlinkpipe-214112-2-9315', '-c:v', 'copy', '-c:a', 'copy', '-map', '0:v?', '-map', '0:a?', '-map', '1:a', '-f', 'mpegts', 'pipe:1']
[stream.ffmpegmux][debug] Starting copy to pipe: /tmp/streamlinkpipe-214112-1-6149
[stream.ffmpegmux][debug] Starting copy to pipe: /tmp/streamlinkpipe-214112-2-9315
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][debug] First Sequence: 13160638; Last Sequence: 13160652
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 13160650; End Sequence: None
[stream.hls][debug] Adding segment 13160650 to queue
[stream.hls][debug] Adding segment 13160651 to queue
[stream.hls][debug] Adding segment 13160652 to queue
[stream.hls][debug] First Sequence: 13160638; Last Sequence: 13160652
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 13160650; End Sequence: None
[stream.hls][debug] Adding segment 13160650 to queue
[stream.hls][debug] Adding segment 13160651 to queue
[stream.hls][debug] Adding segment 13160652 to queue
[stream.hls][debug] Writing segment 13160650 to output
[stream.hls][debug] Segment 13160650 complete
[stream.hls][debug] Writing segment 13160651 to output
[stream.hls][debug] Segment 13160651 complete
[stream.hls][debug] Writing segment 13160652 to output
[stream.hls][debug] Segment 13160652 complete
[stream.hls][debug] Writing segment 13160650 to output
[stream.hls][debug] Segment 13160650 complete
[cli.output][debug] Opening subprocess: ['/usr/bin/mpv', '--force-media-title=https://www.tf1.fr/thriller-fiction-89242722/direct', '-']
[stream.hls][debug] Writing segment 13160651 to output
[stream.hls][debug] Segment 13160651 complete
[cli][debug] Writing stream to output
[stream.hls][debug] Writing segment 13160652 to output
[stream.hls][debug] Segment 13160652 complete
[cli][info] Player closed
[stream.ffmpegmux][debug] Closing ffmpeg thread
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[stream.segmented][debug] Closing worker thread
[stream.ffmpegmux][debug] Pipe copy complete: /tmp/streamlinkpipe-214112-1-6149
[stream.segmented][debug] Closing writer thread
[stream.segmented][debug] Closing writer thread
[stream.ffmpegmux][debug] Pipe copy complete: /tmp/streamlinkpipe-214112-2-9315
[stream.ffmpegmux][debug] Closed all the substreams
[cli][info] Stream ended
[cli][info] Closing currently open stream...

@bastimeyer bastimeyer added the plugin issue A Plugin does not work correctly label Feb 18, 2025
@bastimeyer bastimeyer merged commit 9705129 into streamlink:master Feb 18, 2025
23 checks passed
@bastimeyer bastimeyer deleted the plugins/tf1/fix-stream-matcher branch February 18, 2025 22:45
@novazur972
Copy link

Something broken again ?

Patch applied but stream never starts:

[cli][debug] OS:         Linux-6.12.16-gentoo-x86_64-Intel-R-_Core-TM-_i5-9600K_CPU_@_3.70GHz-with-glibc2.40
[cli][debug] Python:     3.12.9
[cli][debug] OpenSSL:    OpenSSL 3.3.3 11 Feb 2025
[cli][debug] Streamlink: 7.1.3
[cli][debug] Dependencies:
[cli][debug]  certifi: 3024.7.22
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 5.3.1
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.21.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.3
[cli][debug]  trio: 0.29.0
[cli][debug]  trio-websocket: 0.12.2
[cli][debug]  urllib3: 2.3.0
[cli][debug]  websocket-client: 1.8.0
[cli][debug] Arguments:
[cli][debug]  url=https://www.tf1.fr/tf1/direct
[cli][debug]  stream=['576p']
[cli][debug]  --loglevel=debug
[cli][debug]  --player=mpv
[cli][debug]  --tf1-email=christophe.perez@novazur.fr
[cli][debug]  --tf1-password=********
[cli][info] Found matching plugin tf1 for URL https://www.tf1.fr/tf1/direct
[plugins.tf1][debug] Found channel tf1 (L_TF1)
[utils.l10n][debug] Language code: fr_FR
[stream.ffmpegmux][debug] ffmpeg version 6.1.2 Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 14 (Gentoo 14.2.1_p20241221 p7)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/share/doc/ffmpeg-6.1.2/html --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --nm=x86_64-pc-linux-gnu-nm --strip=x86_64-pc-linux-gnu-strip --ranlib=x86_64-pc-linux-gnu-ranlib --pkg-config=x86_64-pc-linux-gnu-pkg-config --optflags='-march=skylake -O2 -pipe' --disable-static --disable-libaribcaption --enable-avfilter --disable-stripping --disable-optimizations --disable-libcelt --enable-nonfree --disable-indev=oss --disable-indev=jack --disable-indev=sndio --disable-outdev=oss --disable-outdev=sndio --enable-version3 --enable-nonfree --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-gcrypt --enable-gnutls --disable-gmp --enable-gpl --disable-hardcoded-tables --enable-iconv --disable-libxml2 --disable-lzma --enable-network --disable-opencl --enable-openssl --enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl2 --enable-vaapi --disable-vdpau --enable-vulkan --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-zlib --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --enable-openal --enable-opengl --disable-libv4l2 --enable-libpulse --disable-libdrm --disable-libjack --enable-libopencore-amrwb --enable-libopencore-amrnb --disable-libcodec2 --enable-libdav1d --enable-libfdk-aac --disable-libopenjpeg --disable-libjxl --disable-libbluray --disable-libgme --disable-libgsm --disable-libaribb24 --disable-libmodplug --enable-libopus --disable-libvpl --disable-libilbc --disable-librtmp --disable-libssh --enable-libspeex --disable-libsrt --enable-librsvg --disable-ffnvcodec --enable-libvorbis --enable-libvpx --disable-libzvbi --disable-appkit --disable-libbs2b --disable-chromaprint --disable-cuda-llvm --disable-libflite --enable-fontconfig --disable-frei0r --disable-libfribidi --disable-libglslang --disable-ladspa --enable-lcms2 --enable-libass --disable-libplacebo --disable-libtesseract --disable-lv2 --disable-librubberband --disable-libshaderc --enable-libfreetype --enable-libharfbuzz --disable-libvidstab --disable-libvmaf --disable-libzmq --disable-libzimg --disable-libsoxr --enable-pthreads --disable-amf --disable-libvo-amrwbenc --disable-libkvazaar --disable-libaom --enable-libmp3lame --disable-libopenh264 --disable-librav1e --disable-libsnappy --disable-libsvtav1 --enable-libtheora --disable-libtwolame --disable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --disable-gnutls --enable-version3 --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp --disable-vfpv3 --disable-armv8 --disable-dotprod --disable-i8mm --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-altivec --disable-vsx --disable-power8 --disable-amd3dnow --disable-amd3dnowext --disable-fma4 --disable-xop --enable-pic --cpu=skylake --disable-doc --disable-htmlpages --enable-manpages
libavutil      58. 29.100 / 58. 29.100
libavcodec     60. 31.102 / 60. 31.102
libavformat    60. 16.100 / 60. 16.100
libavdevice    60.  3.100 / 60.  3.100
libavfilter     9. 12.100 /  9. 12.100
libswscale      7.  5.100 /  7.  5.100
libswresample   4. 12.100 /  4. 12.100
libpostproc    57.  3.100 / 57.  3.100
[stream.hls][debug] Using external audio tracks for stream 720p (language=fra, name=fra)
[stream.hls][debug] Using external audio tracks for stream 576p (language=fra, name=fra)
[stream.hls][debug] Using external audio tracks for stream 576p_alt (language=fra, name=fra)
[stream.hls][debug] Using external audio tracks for stream 360p (language=fra, name=fra)
[stream.hls][debug] Using external audio tracks for stream 234p (language=fra, name=fra)
[cli][info] Available streams: 234p (worst), 360p, 576p_alt, 576p, 720p (best)
[cli][info] Opening stream: 576p (hls-multi)
[cli][info] Starting player: mpv
[stream.ffmpegmux][debug] Opening hls substream
[stream.hls][debug] Reloading playlist
[stream.ffmpegmux][debug] Opening hls substream
[stream.hls][debug] Reloading playlist
[utils.named_pipe][info] Creating pipe streamlinkpipe-32717-1-7970
[utils.named_pipe][info] Creating pipe streamlinkpipe-32717-2-3163
[stream.ffmpegmux][debug] ffmpeg command: ['/usr/bin/ffmpeg', '-y', '-nostats', '-loglevel', 'info', '-i', '/tmp/streamlinkpipe-32717-1-7970', '-i', '/tmp/streamlinkpipe-32717-2-3163', '-c:v', 'copy', '-c:a', 'copy', '-map', '0:v?', '-map', '0:a?', '-map', '1:a', '-f', 'mpegts', 'pipe:1']
[stream.ffmpegmux][debug] Starting copy to pipe: /tmp/streamlinkpipe-32717-1-7970
[stream.ffmpegmux][debug] Starting copy to pipe: /tmp/streamlinkpipe-32717-2-3163
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] First Sequence: 10499191; Last Sequence: 10499194
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 10499192; End Sequence: None
[stream.hls][debug] Adding segment 10499192 to queue
[stream.hls][debug] Adding segment 10499193 to queue
[stream.hls][debug] Adding segment 10499194 to queue
[stream.hls][debug] Writing segment 10499192 to output
[stream.hls][debug] Segment initialization 10499192 complete
[stream.hls][debug] First Sequence: 10499191; Last Sequence: 10499194
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 10499192; End Sequence: None
[stream.hls][debug] Adding segment 10499192 to queue
[stream.hls][debug] Adding segment 10499193 to queue
[stream.hls][debug] Adding segment 10499194 to queue
[stream.hls][debug] Writing segment 10499192 to output
[stream.hls][debug] Segment initialization 10499192 complete
[stream.hls][debug] Writing segment 10499192 to output
[stream.hls][debug] Segment 10499192 complete
[stream.hls][debug] Writing segment 10499192 to output
[stream.hls][error] Failed to create decryptor: Unable to decrypt cipher SAMPLE-AES
[stream.segmented][debug] Closing writer thread
[stream.segmented][debug] Closing worker thread
[stream.ffmpegmux][debug] Pipe copy complete: /tmp/streamlinkpipe-32717-1-7970
[stream.hls][debug] Writing segment 10499193 to output
[stream.hls][debug] Segment 10499193 complete
[cli.output][debug] Opening subprocess: ['/usr/bin/mpv', '--force-media-title=https://www.tf1.fr/tf1/direct', '-']
[cli][debug] Writing stream to output
[stream.hls][debug] Writing segment 10499194 to output
[stream.hls][debug] Segment 10499194 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Adding segment 10499195 to queue
[stream.hls][debug] Writing segment 10499195 to output
[stream.hls][debug] Segment 10499195 complete
^C[stream.ffmpegmux][debug] Closing ffmpeg thread
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[stream.ffmpegmux][debug] Pipe copy complete: /tmp/streamlinkpipe-32717-2-3163
[stream.ffmpegmux][debug] Closed all the substreams
[cli][info] Stream ended
Interrupted! Exiting...
[cli][info] Closing currently open stream...

@bastimeyer
Copy link
Member Author

[stream.hls][error] Failed to create decryptor: Unable to decrypt cipher SAMPLE-AES

Duplicate of your own issue: #6245

Also, please don't comment on merged PRs. Locking...

@streamlink streamlink locked as resolved and limited conversation to collaborators Mar 20, 2025
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 this pull request may close these issues.

plugins.tf1: "stream" matcher URL format has changed
2 participants