Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cli.output.player: add flatpak detection#6717

Merged
bastimeyer merged 2 commits into
streamlink:masterfrom
bastimeyer:cli/output/player-args-flatpak
Nov 11, 2025
Merged

cli.output.player: add flatpak detection#6717
bastimeyer merged 2 commits into
streamlink:masterfrom
bastimeyer:cli/output/player-args-flatpak

Conversation

@bastimeyer

Copy link
Copy Markdown
Member

This adds player detection for players run via flatpak.

The PlayerArgs currently does only detect specific player executable names and then builds the player arguments accordingly, with the formatted title and player input.

In order to support player titles for flatpak players though, the --player path file name needs to be checked for "flatpak" and the --player-args need to be parsed accordingly for the run command:
https://man7.org/linux/man-pages/man1/flatpak-run.1.html

The added flatpak app identifiers for VLC and mpv are org.videolan.VLC and io.mpv.Mpv.

We should probably add a note to the docs on how to run flatpak players. I'll have a look at this tomorrow.


Example (see the formatted title):

$ streamlink --no-config -l debug -p flatpak -a 'run io.mpv.Mpv' --title '{author} - {category} - {title}' --stream-segmented-duration=1 twitch.tv/wirtual best
[cli][debug] OS:         Linux-6.17.5-1-git-x86_64-with-glibc2.42
[cli][debug] Python:     3.14.0
[cli][debug] OpenSSL:    OpenSSL 3.6.0 1 Oct 2025
[cli][debug] Streamlink: 7.6.0+65.gceff8582
[cli][debug] Dependencies:
[cli][debug]  certifi: 2025.10.5
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 6.0.2
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.23.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.5
[cli][debug]  trio: 0.32.0
[cli][debug]  trio-websocket: 0.12.2
[cli][debug]  urllib3: 2.5.0
[cli][debug]  websocket-client: 1.9.0
[cli][debug] Arguments:
[cli][debug]  url=twitch.tv/wirtual
[cli][debug]  stream=['best']
[cli][debug]  --no-config=True
[cli][debug]  --loglevel=debug
[cli][debug]  --player=flatpak
[cli][debug]  --player-args=run io.mpv.Mpv
[cli][debug]  --title={author} - {category} - {title}
[cli][debug]  --stream-segmented-duration=1.0
[cli][info] Found matching plugin twitch for URL twitch.tv/wirtual
[plugins.twitch][debug] Getting live HLS streams for wirtual
[plugins.twitch][debug] {'adblock': False, 'geoblock_reason': '', 'hide_ads': False, 'server_ads': True, 'show_ads': True}
[utils.l10n][debug] Language code: en_US
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p60, 1080p60 (best)
[cli][info] Opening stream: 1080p60 (hls)
[cli][info] Starting player: flatpak
[plugins.twitch][info] Will skip ad segments
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
[plugins.twitch][info] Waiting for pre-roll ads to finish, be patient
[plugins.twitch][info] Detected advertisement break of 15 seconds
[stream.hls][debug] First Sequence: 0; Last Sequence: 4
[stream.hls][debug] Start offset: 0; Duration: 1.0; Start Sequence: 2; End Sequence: None
[stream.hls][debug] Adding segment 2 to queue
[stream.hls][debug] Adding segment 3 to queue
[stream.hls][debug] Adding segment 4 to queue
[stream.hls][debug] Discarding segment 2
[stream.hls][info] Filtering out segments and pausing stream output
[stream.hls][debug] Discarding segment 3
[stream.hls][debug] Discarding segment 4
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Adding segment 5 to queue
[stream.hls][debug] Adding segment 6 to queue
[stream.hls][debug] Discarding segment 5
[stream.hls][debug] Discarding segment 6
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Adding segment 7 to queue
[stream.hls][debug] Discarding segment 7
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Adding segment 8 to queue
[stream.segmented][info] Stopping stream early after 1.00s
[stream.segmented][debug] Closing worker thread
[stream.hls][debug] Writing segment 8 to output
[stream.hls][debug] Segment 8 complete
[stream.hls][warning] Encountered a stream discontinuity. This is unsupported and will result in incoherent output data.
[stream.hls][info] Resuming stream output
[stream.segmented][debug] Closing writer thread
[cli.output][debug] Opening subprocess: ['/usr/bin/flatpak', 'run', 'io.mpv.Mpv', "--force-media-title=Wirtual - Trackmania - KACKY [43/75] 🔴HARD MAPS LEFT ONLY 🔴BUT THAT WON'T STOP US", '-']
[cli][debug] Writing stream to output
[cli][info] Stream ended
[cli][info] Closing currently open stream...

@bastimeyer bastimeyer added the CLI label Nov 10, 2025
- Add the `PlayerArgsMeta` metaclass and return the type dynamically
  based on the `path` argument
- Replace `EXECUTABLES` list with an optional `EXECUTABLE` regex pattern
@bastimeyer bastimeyer force-pushed the cli/output/player-args-flatpak branch from ceff858 to 49f0b05 Compare November 10, 2025 21:14
@bastimeyer bastimeyer merged commit 85c4b62 into streamlink:master Nov 11, 2025
25 checks passed
@bastimeyer bastimeyer deleted the cli/output/player-args-flatpak branch November 11, 2025 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant