Repository: streamlink/streamlink

Issue:
plugins.youtube: Checking if stream on pause or no video is playing while youtube shows it as live
### Checklist

- [X] This is a feature request and not a different kind of issue
- [X] [I have read the contribution guidelines](https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#contributing-to-streamlink)
- [X] [I have checked the list of open and recently closed plugin requests](https://github.com/streamlink/streamlink/issues?q=is%3Aissue+label%3A%22feature+request%22)

### Description

I'm checking if youtube live stream is running via command:

`streamlink -Q --json --config cookie.txt https://www.youtube.com/channel/<channel_id>/live`

Everything works as expected but there is one issue:
When the streamer doesn't end live stream properly (shuts down phone, phone loosing connection, etc.), streamlink (and youtube itself) keeps showing that channel is still live. 

Is there an option or any way to detect if the video is really playing? It's a bit annoying to see that someone is streaming but when I open up video, turns out there is just a "youtube's circle making rounds on video".



Discussion:
Debug log with difference in couple minutes when youtube shows it as live while the video is on pause:

```
$ streamlink --loglevel=debug -Q --json --config cookie.txt https://www.youtube.com/channel/UCNcuCP5IAI6My3e5Z-vKkBQ/live
{
  "plugin": "youtube",
  "metadata": {
    "id": "keMGL6OA6m4",
    "author": "VJLinkHero",
    "category": "Entertainment",
    "title": "\u0412 \u043a\u0430\u043a\u0430\u0445\u0443"
  },
  "streams": {
    "144p": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/91/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D139/sgovp/gir%3Dyes%3Bitag%3D160/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pcm2cms/yes/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246,51000022/mt/1684472925/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRgIhAMKP3ePcXM3v03EqI7dhbi1ERY2AEJhKnSKgkFsbIKxhAiEAmahyD4U88d0ZydSknHT07JBzKg7mtMgSxmvL0cnNTls%3D/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pcm2cms,pl/lsig/AG3C_xAwRQIhALMEOEtNZPL9KeI7DGKCdajw2kfITtXx9AkOHNxgD3a0AiAYIj3I3RE2O3R4KSY9UxcAH4aLJhp9L86sRCSaskiZXg%3D%3D/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246%2C51000022/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRQIhALvYuCrAiA-JX73OgUgC2hC9Jp3zwqPdhmZ3J8l7gBblAiA-tsmb01Jw6dA4Mba37-U8CT1fSg1vwNRPfxJF6RbZow%3D%3D/file/index.m3u8"
    },
    "240p": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/92/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D139/sgovp/gir%3Dyes%3Bitag%3D133/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pcm2cms/yes/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246,51000022/mt/1684472925/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRQIhAN4BxUXVtGdgPotil2AVIV9UvsZV1ZzfzMcbDYzrzHzKAiAun1FJCJU9EhP0OmzdROGXCVP1gYZDlndffsgqund49g%3D%3D/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pcm2cms,pl/lsig/AG3C_xAwRgIhALVYV7DKcRe3F_X1P1zOC-eDDf_ZmEDrldJFQjCzyn2MAiEAkTZD8AXRZONaWp7UfUrXe8oC5Si2bDEdluF0RbJnYQ0%3D/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246%2C51000022/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRQIhALvYuCrAiA-JX73OgUgC2hC9Jp3zwqPdhmZ3J8l7gBblAiA-tsmb01Jw6dA4Mba37-U8CT1fSg1vwNRPfxJF6RbZow%3D%3D/file/index.m3u8"
    },
    "360p": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/93/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D134/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pcm2cms/yes/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246,51000022/mt/1684472925/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRAIgXkxh1Hil1g3CqMwghcz_SWLQ1cDTZaOiyQ8r9Y4imzwCIAZzZMjjWJhzCxeaJ_eLeD_PChHAdlWQDLxA_fe5O_Wr/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pcm2cms,pl/lsig/AG3C_xAwRQIgeACTE8wEfNbNkcEZMhw-DWDlmkMhk8RH_JFYkx6TrokCIQCwmzUFtNjEAtMaMMMZovJoO7ZHoAjeB1160ZRrJ9H3EA%3D%3D/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246%2C51000022/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRQIhALvYuCrAiA-JX73OgUgC2hC9Jp3zwqPdhmZ3J8l7gBblAiA-tsmb01Jw6dA4Mba37-U8CT1fSg1vwNRPfxJF6RbZow%3D%3D/file/index.m3u8"
    },
    "480p": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/94/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D135/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pcm2cms/yes/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246,51000022/mt/1684472925/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRAIgRgn9RQgToe2Kq-zxjcfvFnCA0vH5yeE12WrA6fs9Gr8CID_Ky8RrkSOFZio1j-X_ewtXvvfe-0lNA5G4wU6_WsiN/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pcm2cms,pl/lsig/AG3C_xAwRAIgb-itzsMzGYpPEHHaC7GVln9gdsHP7gzLjp5Z1Nh8H6QCIFh8uvGOAr0MzcrBD_RgXdhqEXZX79hayaG_xfUdZ8ux/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246%2C51000022/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRQIhALvYuCrAiA-JX73OgUgC2hC9Jp3zwqPdhmZ3J8l7gBblAiA-tsmb01Jw6dA4Mba37-U8CT1fSg1vwNRPfxJF6RbZow%3D%3D/file/index.m3u8"
    },
    "720p": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/95/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D136/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pcm2cms/yes/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246,51000022/mt/1684472925/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRgIhALfc18qFLqLM8YK3TboBFMVqPFStKyQrbEKr3xpt0PAnAiEA3WNLIafe4kapoy4-MToyp3q4k8_AbQaAvXmT12Uzenc%3D/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pcm2cms,pl/lsig/AG3C_xAwRQIhAKTX4T9x6piKqJjMaYv5eOhpD8shHw59o8cZpkNxxYcnAiAiwUJmAyjnUWlaAPIoORoc0N2DGThEF5DlIEVj552cOA%3D%3D/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246%2C51000022/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRQIhALvYuCrAiA-JX73OgUgC2hC9Jp3zwqPdhmZ3J8l7gBblAiA-tsmb01Jw6dA4Mba37-U8CT1fSg1vwNRPfxJF6RbZow%3D%3D/file/index.m3u8"
    },
    "worst": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/91/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D139/sgovp/gir%3Dyes%3Bitag%3D160/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pcm2cms/yes/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246,51000022/mt/1684472925/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRgIhAMKP3ePcXM3v03EqI7dhbi1ERY2AEJhKnSKgkFsbIKxhAiEAmahyD4U88d0ZydSknHT07JBzKg7mtMgSxmvL0cnNTls%3D/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pcm2cms,pl/lsig/AG3C_xAwRQIhALMEOEtNZPL9KeI7DGKCdajw2kfITtXx9AkOHNxgD3a0AiAYIj3I3RE2O3R4KSY9UxcAH4aLJhp9L86sRCSaskiZXg%3D%3D/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246%2C51000022/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRQIhALvYuCrAiA-JX73OgUgC2hC9Jp3zwqPdhmZ3J8l7gBblAiA-tsmb01Jw6dA4Mba37-U8CT1fSg1vwNRPfxJF6RbZow%3D%3D/file/index.m3u8"
    },
    "best": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/95/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D136/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pcm2cms/yes/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246,51000022/mt/1684472925/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRgIhALfc18qFLqLM8YK3TboBFMVqPFStKyQrbEKr3xpt0PAnAiEA3WNLIafe4kapoy4-MToyp3q4k8_AbQaAvXmT12Uzenc%3D/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pcm2cms,pl/lsig/AG3C_xAwRQIhAKTX4T9x6piKqJjMaYv5eOhpD8shHw59o8cZpkNxxYcnAiAiwUJmAyjnUWlaAPIoORoc0N2DGThEF5DlIEVj552cOA%3D%3D/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495804/ei/XAlnZPOoIMfm1gL1zISIDg/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246%2C51000022/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRQIhALvYuCrAiA-JX73OgUgC2hC9Jp3zwqPdhmZ3J8l7gBblAiA-tsmb01Jw6dA4Mba37-U8CT1fSg1vwNRPfxJF6RbZow%3D%3D/file/index.m3u8"
    }
  }
}
```

Log taken after 5 minutes of absence of stream:

```
$ streamlink --loglevel=debug -Q --json --config cookie.txt https://www.youtube.com/channel/UCNcuCP5IAI6My3e5Z-vKkBQ/live
{
  "plugin": "youtube",
  "metadata": {
    "id": "keMGL6OA6m4",
    "author": "VJLinkHero",
    "category": "Entertainment",
    "title": "\u0412 \u043a\u0430\u043a\u0430\u0445\u0443"
  },
  "streams": {
    "144p": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/91/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D139/sgovp/gir%3Dyes%3Bitag%3D160/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246/beids/24350017/mt/1684473968/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRAIgIyzqP-Fxg8-6zgBLrTKqPPLU12mBfUf3R61_iTDT4mECIFEA1QFphuIb4lhPafdoiaBIr-EOAZ35TCxJ61fnLabd/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRAIgNLguE-VJkd_dXpawXNhvPVSOhGiz72JL-RVwuSerVQsCIH-8U8usRI3NxAU7_s9qiUGSCJoihHRPUxOcqY-gj8CY/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246/beids/24350017/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRgIhAIiPE0FnGEyjxLoC-1Y6zp2ynHFIPmkKyjxE7DuY8WtaAiEA9aq-A7W1wIL5nzVxg2l2oVgd455-VXVcnWrWNtFTHYk%3D/file/index.m3u8"
    },
    "240p": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/92/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D139/sgovp/gir%3Dyes%3Bitag%3D133/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246/beids/24350017/mt/1684473968/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRAIgGrYgWXmKdeh5HKcXry04_VUJ_csVwx93PL-sh98hNrECIDi4BoHQPDITpiQeog5V2mo1ix_ly8_FT4Txd_OmFoGd/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRQIgQJGb_Lr5NltLyCokmeB01kvA7sfOTwQkBIo27x4rnAQCIQDYe8R-GjxJhhDAKHFjmwAXiCjD4QDdYE6OoWiEaRsgfg%3D%3D/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246/beids/24350017/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRgIhAIiPE0FnGEyjxLoC-1Y6zp2ynHFIPmkKyjxE7DuY8WtaAiEA9aq-A7W1wIL5nzVxg2l2oVgd455-VXVcnWrWNtFTHYk%3D/file/index.m3u8"
    },
    "360p": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/93/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D134/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246/beids/24350017/mt/1684473968/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRgIhAPAHmFWjeJUG4dwFWP7ukqQk7v7Nyp_H52Kg9DFl2uBAAiEAvNPo-vSxHO2-cn6RTdjzKf6jdz8iF5x9p_Ouzxrwmak%3D/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRgIhAM4VbthkBMo2NqUW-7PXfnjsV-cXgDm0NADkaM95lVJSAiEAol-5st83_EaRX70HmFa5SlUhI6LAnpu6Mga7h3Rm3Q4%3D/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246/beids/24350017/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRgIhAIiPE0FnGEyjxLoC-1Y6zp2ynHFIPmkKyjxE7DuY8WtaAiEA9aq-A7W1wIL5nzVxg2l2oVgd455-VXVcnWrWNtFTHYk%3D/file/index.m3u8"
    },
    "480p": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/94/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D135/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246/beids/24350017/mt/1684473968/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRQIhAJ4KSoirqUkrCZtOng9FlC60JmSlF3HBnYU5tTxWvc5RAiBxkNzDBw4j1zee3u01-ILNsyA3D1novtUXy8E7Vmf_Dw%3D%3D/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRQIhAI9jjUJsxePe8ObtxpSEbt9z0zWb6IzdQkAJiIfl8b3_AiBFPPeGzUjmOYE-pik2zRjaUVhRw_R8CWqUx1L8dDztlw%3D%3D/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246/beids/24350017/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRgIhAIiPE0FnGEyjxLoC-1Y6zp2ynHFIPmkKyjxE7DuY8WtaAiEA9aq-A7W1wIL5nzVxg2l2oVgd455-VXVcnWrWNtFTHYk%3D/file/index.m3u8"
    },
    "720p": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/95/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D136/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246/beids/24350017/mt/1684473968/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRAIgQeUrPrOTPNjZOZCq29Z5bVsValW1rvGaxvU8inF-5qYCIBwsKLRgqBvIWH9Bdhua9zQCkpu1OEJYYL80tzApU4mX/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRQIhAPFxP5meouDp2XYtjdup4iStawEEduWwzB2BLBfPETINAiBjtskf4gJYh85IpVW1P_3HtRsOHGdo9hOSJQgdJSTbTA%3D%3D/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246/beids/24350017/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRgIhAIiPE0FnGEyjxLoC-1Y6zp2ynHFIPmkKyjxE7DuY8WtaAiEA9aq-A7W1wIL5nzVxg2l2oVgd455-VXVcnWrWNtFTHYk%3D/file/index.m3u8"
    },
    "worst": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/91/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D139/sgovp/gir%3Dyes%3Bitag%3D160/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246/beids/24350017/mt/1684473968/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRAIgIyzqP-Fxg8-6zgBLrTKqPPLU12mBfUf3R61_iTDT4mECIFEA1QFphuIb4lhPafdoiaBIr-EOAZ35TCxJ61fnLabd/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRAIgNLguE-VJkd_dXpawXNhvPVSOhGiz72JL-RVwuSerVQsCIH-8U8usRI3NxAU7_s9qiUGSCJoihHRPUxOcqY-gj8CY/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246/beids/24350017/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRgIhAIiPE0FnGEyjxLoC-1Y6zp2ynHFIPmkKyjxE7DuY8WtaAiEA9aq-A7W1wIL5nzVxg2l2oVgd455-VXVcnWrWNtFTHYk%3D/file/index.m3u8"
    },
    "best": {
      "type": "hls",
      "url": "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/itag/95/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D136/hls_chunk_host/rr2---sn-bn251-btql.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/mh/hr/mm/44/mn/sn-bn251-btql/ms/lva/mv/u/mvi/2/pl/24/dover/11/pacing/0/keepalive/yes/fexp/24007246/beids/24350017/mt/1684473968/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRAIgQeUrPrOTPNjZOZCq29Z5bVsValW1rvGaxvU8inF-5qYCIBwsKLRgqBvIWH9Bdhua9zQCkpu1OEJYYL80tzApU4mX/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRQIhAPFxP5meouDp2XYtjdup4iStawEEduWwzB2BLBfPETINAiBjtskf4gJYh85IpVW1P_3HtRsOHGdo9hOSJQgdJSTbTA%3D%3D/playlist/index.m3u8",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive"
      },
      "master": "https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1684495912/ei/yAlnZPf3FYbWgAeBlLHwBw/ip/46.32.191.206/id/keMGL6OA6m4.1/source/yt_live_broadcast/requiressl/yes/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/vprv/1/go/1/pacing/0/nvgoi/1/keepalive/yes/fexp/24007246/beids/24350017/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRgIhAIiPE0FnGEyjxLoC-1Y6zp2ynHFIPmkKyjxE7DuY8WtaAiEA9aq-A7W1wIL5nzVxg2l2oVgd455-VXVcnWrWNtFTHYk%3D/file/index.m3u8"
    }
  }
}
```
> (and youtube itself) keeps showing that channel is still live

There's a problem with YouTube's returned metadata. Here's the relevant stuff:

```json
{
  "playabilityStatus": {
    "status": "OK",
    "reason": "Es gibt ein technisches Problem.",
    "playableInEmbed": true,
    "liveStreamability": {
      "liveStreamabilityRenderer": {
        "videoId": "keMGL6OA6m4",
        "broadcastId": "1",
        "pollDelayMs": "15000"
      }
    },
    "miniplayer": {
      "miniplayerRenderer": {
        "playbackMode": "PLAYBACK_MODE_ALLOW"
      }
    },
    "contextParams": "Q0FFU0FnZ0M="
  },
  "videoDetails": {
    "videoId": "keMGL6OA6m4",
    "title": "...",
    "lengthSeconds": "0",
    "isLive": true,
    "channelId": "UCNcuCP5IAI6My3e5Z-vKkBQ",
    "isOwnerViewing": false,
    "shortDescription": "...",
    "isCrawlable": true,
    "isLiveDvrEnabled": true,
    "thumbnail": {...},
    "liveChunkReadahead": 3,
    "allowRatings": true,
    "viewCount": "13757",
    "author": "VJLinkHero",
    "isLowLatencyLiveStream": true,
    "isPrivate": false,
    "isUnpluggedCorpus": false,
    "latencyClass": "MDE_STREAM_OPTIMIZATIONS_RENDERER_LATENCY_LOW",
    "isLiveContent": true
  }
}
```

As you can see, the `playabilityStatus.status` value is `OK`. This is checked by Streamlink's YouTube plugin:
https://github.com/streamlink/streamlink/blob/5.5.1/src/streamlink/plugins/youtube.py#L340-L348

However, the `playabilityStatus.reason` value, at least when requested with a German IP, is `Es gibt ein technisches Problem.`, which means "There's a technical problem.". The `playabilityStatus.status` value should not be `OK` in this case. Interpreting this kind of error is a bit awkward in this situation. Checking the reason string value in different languages is obviously not a solution, so only known valid reason string values need to checked and compared against. The reason is set to `None` on valid live streams and videos though (those I've checked).

The HLS stream URLs themselves are totally fine here. What's happening is that no new HLS segments get added to the playlist, so the stream will time out eventually (`--stream-timeout` default value of 60). There's an open and unmerged PR which lets the stream end early in those cases, but that's unrelated to the YouTube issue and just an HLS playlist polling optimization. #5330 
When requesting the data from the API instead of reading the embedded JSON payload, the `playabilityStatus.reason` value is `We're experiencing technical difficulties.`.

But I don't think there's any reason to check the different string values. Checking whether it's not `None` should probably be okay.
Thanks for the information.

Could you please provide command that us used to get that parameter for
checking? I'm just passing `--json` argument but I don't get
playabilityStatus parameter in output.

On Fri, May 19, 2023, 11:15 AM Sebastian Meyer ***@***.***>
wrote:

> (and youtube itself) keeps showing that channel is still live
>
> There's a problem with YouTube's returned metadata. Here's the relevant
> stuff:
>
> {
>   "playabilityStatus": {
>     "status": "OK",
>     "reason": "Es gibt ein technisches Problem.",
>     "playableInEmbed": true,
>     "liveStreamability": {
>       "liveStreamabilityRenderer": {
>         "videoId": "keMGL6OA6m4",
>         "broadcastId": "1",
>         "pollDelayMs": "15000"
>       }
>     },
>     "miniplayer": {
>       "miniplayerRenderer": {
>         "playbackMode": "PLAYBACK_MODE_ALLOW"
>       }
>     },
>     "contextParams": "Q0FFU0FnZ0M="
>   },
>   "videoDetails": {
>     "videoId": "keMGL6OA6m4",
>     "title": "...",
>     "lengthSeconds": "0",
>     "isLive": true,
>     "channelId": "UCNcuCP5IAI6My3e5Z-vKkBQ",
>     "isOwnerViewing": false,
>     "shortDescription": "...",
>     "isCrawlable": true,
>     "isLiveDvrEnabled": true,
>     "thumbnail": {...},
>     "liveChunkReadahead": 3,
>     "allowRatings": true,
>     "viewCount": "13757",
>     "author": "VJLinkHero",
>     "isLowLatencyLiveStream": true,
>     "isPrivate": false,
>     "isUnpluggedCorpus": false,
>     "latencyClass": "MDE_STREAM_OPTIMIZATIONS_RENDERER_LATENCY_LOW",
>     "isLiveContent": true
>   }
> }
>
> As you can see, the playabilityStatus.status value is OK. This is checked
> by Streamlink's YouTube plugin:
>
> https://github.com/streamlink/streamlink/blob/5.5.1/src/streamlink/plugins/youtube.py#L340-L348
>
> However, the playabilityStatus.reason value, at least when requested with
> a German IP, is Es gibt ein technisches Problem., which means "There's a
> technical problem.". The playabilityStatus.status value should not be OK
> in this case. Interpreting this kind of error is a bit awkward in this
> situation. Checking the reason string value in different languages is
> obviously not a solution, so only known valid reason string values need to
> checked and compared against. The reason is set to None on valid live
> streams and videos though (those I've checked).
>
> The HLS stream URLs themselves are totally fine here. What's happening is
> that no new HLS segments get added to the playlist, so the stream will time
> out eventually (--stream-timeout default value of 60). There's an open
> and unmerged PR which lets the stream end early in those cases, but that's
> unrelated to the YouTube issue and just an HLS playlist polling
> optimization. #5330 <https://github.com/streamlink/streamlink/pull/5330>
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/streamlink/streamlink/issues/5350#issuecomment-1554136399>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AIL5QKJYTHBUY7MQ5QG7RX3XG4MXTANCNFSM6AAAAAAYHJ74DA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>

Streamlink's `--json` output is completely unrelated to any internal YouTube plugin HTTP responses.

With an improved check, the return value will simply be

```
$ streamlink 'https://www.youtube.com/channel/UCNcuCP5IAI6My3e5Z-vKkBQ/live' best
[cli][info] Found matching plugin youtube for URL https://www.youtube.com/channel/UCNcuCP5IAI6My3e5Z-vKkBQ/live
[plugins.youtube][error] Could not get video info - OK: We're experiencing technical difficulties.
error: No playable streams found on this URL: https://www.youtube.com/channel/UCNcuCP5IAI6My3e5Z-vKkBQ/live

$ streamlink -j 'https://www.youtube.com/channel/UCNcuCP5IAI6My3e5Z-vKkBQ/live' best
{
  "error": "No playable streams found on this URL: https://www.youtube.com/channel/UCNcuCP5IAI6My3e5Z-vKkBQ/live"
}
```

Streamlink doesn't support plugins providing a reason why a stream lookup failed. Plugins therefore write data to the error log channel.

Resolving patch:
diff --git a/src/streamlink/plugins/youtube.py b/src/streamlink/plugins/youtube.py
--- a/src/streamlink/plugins/youtube.py
+++ b/src/streamlink/plugins/youtube.py
@@ -135,7 +135,7 @@ def _schema_playabilitystatus(cls, data):
         schema = validate.Schema(
             {"playabilityStatus": {
                 "status": str,
-                validate.optional("reason"): str,
+                validate.optional("reason"): validate.any(str, None),
             }},
             validate.get("playabilityStatus"),
             validate.union_get("status", "reason"),
@@ -341,7 +341,8 @@ def _data_status(self, data, errorlog=False):
         if not data:
             return False
         status, reason = self._schema_playabilitystatus(data)
-        if status != "OK":
+        # assume that there's an error if reason is set (status will still be "OK" for some reason)
+        if status != "OK" or reason:
             if errorlog:
                 log.error(f"Could not get video info - {status}: {reason}")
             return False


Test patch: