Streamlink

I made a snap (snapcraft.io/test-streamlink) for Streamlink to see what is involved. It was to try issue 3010.
So the question about classic confinement brought me here to ask for help. Is that (classic) the recommended option to allow the Streamlink tool to launch players like VLC, mpv, and ffplay?

VLC is installed via snappy, but mpv and ffplay were installed with apt-get.

A new question just occurred, should the Streamlink issue 3010 just be converted into a request here? to be handled by snapcrafters builders.
This is the snapcraft.yaml:

name: test-streamlink
base: core18
summary: test-Streamlink
description: |
  Streamlink is a CLI utility which pipes video streams from various 
  services into a video player https://streamlink.github.io/
confinement: strict
adopt-info: slink-build
apps:
  test-streamlink:
    command: bin/streamlink
    plugs: [network]
parts:
  slink-build:
    plugin: python
    source: .
    build-packages:
      - python-future
      - python-requests
      - python-singledispatch
      - python-pycryptodome
      - python-iso3166
      - python-isodate
      - python-websocket
      - python-backports-shutil-get-terminal-size
    override-pull: |
        snapcraftctl pull
        version="$(git describe --tags --long)"
        snapcraftctl set-version "$version"
        snapcraftctl set-grade stable

Here is what I would do. Open streams in ffplay and in you want to use specific media player pipe to that media player with --stdout. And I would also include LiveProxy because it makes Streamlink much more usable by allowing use of playlists in any player.

name: streamlink
summary: Streamlink and LiveProxy in one package
description: |
  Streamlink is a CLI utility which pipes video streams from various services into a video player, such as VLC.

      streamlink <URL> 720p
      streamlink <URL> 720p --stdout | vlc -

  LiveProxy is a local proxy server for Streamlink.

      vlc http://127.0.0.1:53422/play/?url=<URL>&default-stream=best

version: '1.4.1'
base: core18
grade: stable
confinement: strict

layout:
  # required for sound to work with ffplay
  # https://bugs.launchpad.net/snapd/+bug/1835290/comments/1
  /usr/share/alsa:
    bind: $SNAP/usr/share/alsa

apps:
  streamlink:
    command: bin/streamlink --player="$SNAP/usr/bin/ffplay -window_title Streamlink"
    plugs:
      # Some of these might not be needed
      - home
      - network
      - desktop
      - desktop-legacy
      - wayland
      - x11
      - opengl
      - audio-playback
      
  proxy:
    command: bin/liveproxy
    daemon: simple
    plugs:
      - network
      - network-bind

parts:
  streamlink:
    plugin: python
    python-version: python3
    source: https://github.com/streamlink/streamlink.git
    source-tag: 1.4.1
    stage-packages:
      # Some of these might not be needed
      - ffmpeg
      - libglu1-mesa
      - freeglut3
      - libslang2
      - libpulse0
      - gstreamer1.0-plugins-good
      - gstreamer1.0-plugins-bad
      - gstreamer1.0-plugins-ugly
      - libgpm2

  liveproxy:
    plugin: python
    python-version: python3
    source: https://github.com/back-to/liveproxy.git
    source-tag: 1.0.0
    after:
      - streamlink

Thanks, this is very helpful. I will give it a try!

What about a snap with Twitch-GUI in Streamlink? Could it be possible?

Streamlink Twitch GUI is a multi platform Twitch.tv browser for Streamlink to browse Twitch.tv and watch streams in your video player of choice.

A graphical user interface (GUI) on top of the Streamlink command line interface (CLI).

Built with NW.js, a web application platform written in JavaScript (EmberJS), HTML (Handlebars), and CSS (LessCSS). Powered by Chromium and Node.js.

Yes please, could we have this? Is it possible nowadays? Streamlink-Twitch-GUI can’t be gotten going because the repositories (apt install streamlink) version is too old and at least a Streamlink 6.0 is required :confused: