Repository: streamlink/streamlink

Issue:
BBC iPlayer plugin broken (can no longer validate JSON)
<!--
Thanks for reporting a bug!
USE THE TEMPLATE. Otherwise your bug report may be rejected.

First, see the contribution guidelines:
https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#contributing-to-streamlink

Also check the list of open and closed bug reports:
https://github.com/streamlink/streamlink/issues?q=is%3Aissue+label%3A%22bug%22

Please see the text preview to avoid unnecessary formatting errors.
-->


## Bug Report

<!-- Replace [ ] with [x] in order to check the box -->
- [x] This is a bug report and I have read the contribution guidelines.

### Description

<!-- Explain the bug as thoroughly as you can. Don't leave out information which is necessary for us to reproduce and debug this issue. -->

As of 15th Nov 2018, attempting to stream any bbc iplayer url gives: "error: Unable to validate JSON" (see full log below). It would seem the BBC has changed the format of their JSON output, because everything worked fine up until that day.

### Expected / Actual behavior

<!-- What do you expect to happen, and what is actually happening? -->

It should stream the content, instead of giving an error.

### Reproduction steps / Explicit stream URLs to test

<!-- How can we reproduce this? Please note the exact steps below using the list format supplied. If you need more steps please add them. -->

`streamlink --bbciplayer-username 'user' --bbciplayer-password 'pass' https://www.bbc.co.uk/iplayer/episode/b0074mhp/the-blue-planet-1-introduction`

### Log output

<!--
TEXT LOG OUTPUT IS REQUIRED for a bug report!
Use the `--loglevel debug` parameter and avoid using parameters which suppress log output.
https://streamlink.github.io/cli.html#cmdoption-l

Make sure to **remove usernames and passwords**
You can copy the output to https://gist.github.com/ or paste it below.
-->

```
$ streamlink --bbciplayer-username 'user' --bbciplayer-password 'pass' https://www.bbc.co.uk/iplayer/episode/b0074mhp/the-blue-planet-1-introduction
[cli][info] Found matching plugin bbciplayer for URL https://www.bbc.co.uk/iplayer/episode/b0074mhp/the-blue-planet-1-introduction
[plugin.bbciplayer][info] A TV License is required to watch BBC iPlayer streams, see the BBC website for more information: https://www.bbc.co.uk/iplayer/help/tvlicence
error: Unable to validate JSON: Key 'episode' not found in {'appBundleSrc': 'https://iplayer-web.files.bbci.co.uk/iplayer-web-app-playback-v2/1.0.0-216/js/app.bundle.js', 'appStoreState': {'translations': {'page_title_version_ad': 'Audio Described', 'page_title_version_sign': 'Signed', 'related_episodes_this_episode_label': 'This episode', 'related_episodes_title': 'More episodes', 'related_episodes_view_all': 'View all', 'msi_modal_title': "You need to sign in. It's quick & easy.", 'msi_modal_text': "And we'll keep you signed in.", 'msi_modal_why_sign_in': 'Why sign in to the BBC?', 'duration': 'Duration', 'next_episode': 'Next episode', 'next_recommended': 'Recommended for you', 'cancel': 'Cancel', 'cancel_autoplay': 'Cancel autoplay of %s', 'programme_ended_aria_label': 'The current programme has ended. %s will autoplay in %s seconds. Activate the cancel button to stop it playing', 'showhide_button_show': 'Show more', 'showhide_button_hide': 'Hide', 'showhide_button_aria_show': 'Show more programmes', 'showhide_button_aria_hide': 'Return to the player', 'skip_trailer': 'Skip Trailer', 'restart_programme': 'Restart programme', 'accessibility_banner_sign': 'This is a Signed version of this programme.', 'accessibility_banner_sign_non_available': "The non-Signed version isn't available.", 'accessibility_banner_sign_turn_off': 'Turn off Sign Language', 'accessibility_banner_ad': 'This is an Audio Described version of this programme.', 'accessibility_banner_ad_non_available': "The non-Audio Described version isn't available.", 'accessibility_banner_ad_turn_off': 'Turn off Audio Description', 'accessibility_banner_find_out_why': 'Find out why', 'expand_synopsis': 'More', 'collapse_synopsis': 'Less', 'first_shown': 'First shown', 'version_button_ad': 'Audio Described', 'version_button_ad_aria': 'Watch Audio Described version', 'version_button_ad_turn_off_aria': 'Watch non-Audio Described version', 'version_button_sign': 'Sign Language', 'version_button_sign_aria': 'Watch Sign Language version', 'version_button_sign_turn_off_aria': 'Watch non-Sign Language version', 'learn_more_about_availability': 'Learn more about availability', 'download': 'Download', 'add': 'Add', 'added': 'Added', 'remove': 'Remove', 'added_banner_message': ':episodeTitle has been added to', 'my_programmes': 'My Programmes', 'download_not_available_why_aria_label': "Why can't I download?", 'download_modal_title': 'Programme Downloads', 'download_modal_have_you_installed': 'Have you installed BBC iPlayer Downloads?', 'download_modal_help_faq': 'Help & FAQ', 'download_button_hd': 'Yes, download in HD', 'download_button_sd': 'Yes, download in SD', 'download_button_install_now': 'No, install now', 'rrc_why_aria_label': 'More information about revisions, revocations and corrections', 'programme_footer_link_label': 'Programme links', 'programme_footer_link_programme_website': 'Programme website', 'programme_footer_link_credits': 'Credits', 'programme_footer_link_more_from_bbc_three': 'More from BBC Three', 'preroll_available_now': 'Available now on BBC iPlayer', 'preroll_coming_soon': 'Coming soon on BBC iPlayer', 'foreign_region_banner': 'BBC iPlayer only works in the UK. Sorry, it’s due to rights issues.', 'foreign_region_banner_advice': "In the UK? Here's some advice."}, 'episode': {'status': 'success', 'resumeOffset': None, 'added': None, 'addSuccess': None, 'id': 'b0074mhp', 'live': False, 'title': 'The Blue Planet', 'subtitle': '1. Introduction', 'synopses': {'large': 'Although 70 per cent of our planet is covered by water, the oceans and many of their inhabitants - such as the blue whale - remain an unexplored mystery. This edition travels to the very depths of the seas to reveal a spectacular variety of life - from alien monsters of the deep to pack-hunting killer whales attacking a grey whale calf.', 'small': 'This travels to the very depths of the seas, to reveal a spectacular variety of life.', 'medium': 'David Attenborough narrates a natural history of the oceans. We travel to the depths of the seas to reveal a spectacular variety of life, some never filmed before.', 'editorial': "Giant creatures, alien lifeforms, microscopic colonies - it's all here under the waves."}, 'images': {'type': 'image', 'standard': 'https://ichef.bbci.co.uk/images/ic/{recipe}/p06mnw3k.jpg'}, 'masterBrand': {'id': 'bbc_one', 'titles': {'large': 'BBC One', 'small': 'BBC One', 'medium': 'BBC One'}, 'ident_id': 'p06g87jc', 'attribution': 'bbc_one'}, 'requiresSignIn': True, 'tleoId': 'b008044n', 'tleoType': 'series', 'guidance': False, 'labels': {'category': 'Science & Nature'}, 'hasCredits': True, 'currentVersion': 'standard'}, 'relatedEpisodes': {'episodes': [{'id': 'b0074mhp', 'live': False, 'type': 'episode', 'title': 'The Blue Planet', 'images': {'type': 'image', 'standard': 'https://ichef.bbci.co.uk/images/ic/{recipe}/p06mnw3k.jpg'}, 'subtitle': '1. Introduction', 'synopses': {'large': 'Although 70 per cent of our planet is covered by water, the oceans and many of their inhabitants - such as the blue whale - remain an unexplored mystery. This edition travels to the very depths of the seas to reveal a spectacular variety of life - from alien monsters of the deep to pack-hunting killer whales attacking a grey whale calf.', 'small': 'This travels to the very depths of the seas, to reveal a spectacular variety of life.', 'medium': 'David Attenborough narrates a natural history of the oceans. We travel to the depths of the seas to reveal a spectacular variety of life, some never filmed before.', 'editorial': "Giant creatures, alien lifeforms, microscopic colonies - it's all here under the waves."}, 'versions': [{'duration': {'text': '58 mins'}, 'kind': 'original', 'download': True, 'availability': {'remaining': {'text': 'Available for 4 months'}}}], 'labels': {'category': 'Science & Nature'}}, {'id': 'b0074mjc', 'live': False, 'type': 'episode', 'title': 'The Blue Planet', 'images': {'type': 'image', 'standard': 'https://ichef.bbci.co.uk/images/ic/{recipe}/p05rr2wn.jpg'}, 'subtitle': '2. The Deep', 'synopses': {'large': 'More people have walked on the moon than have travelled to the very depths of the deep ocean. David Attenborough journeys into the abyss to show us, for the very first time, strange creatures straight out of the film Alien, many of which are new to science. Terrifying fish with massive teeth that eat prey twice their size and weird jellyfish that flash in the darkness. And deep sea sharks never filmed before and submerged mountain ranges and volcanoes far larger than anything on land.', 'small': 'David Attenborough looks at the strange creatures that live in the depths of the ocean.', 'medium': 'David Attenborough narrates a natural history of the oceans to uncover the strange, otherworldly creatures living in the depths of the ocean.'}, 'versions': [{'duration': {'text': '58 mins'}, 'kind': 'original', 'download': True, 'availability': {'remaining': {'text': 'Available for 4 months'}}}, {'duration': {'text': '58 mins'}, 'kind': 'audio-described', 'download': False, 'availability': {'remaining': {'text': 'Available for 4 months'}}}], 'labels': {'category': 'Science & Nature'}}, {'id': 'b0080pjz', 'live': False, 'type': 'episode', 'title': 'The Blue Planet', 'images': {'type': 'image', 'standard': 'https://ichef.bbci.co.uk/images/ic/{recipe}/p05rr3ds.jpg'}, 'subtitle': '3. Open Ocean', 'synopses': {'large': "This programme focuses on the predatory skills of some of the most charismatic hunters found on the planet: whales, dolphins, tuna, shark and rapier-nosed billfish. The open ocean is unimaginably immense - it covers more than 360 million square kilometres of the Earth's surface. Much of this huge expanse of seawater is marine desert with virtually no sign of life. Yet the fastest and most powerful survive, playing a deadly game of hide-and-seek with their prey. This charts how they track down prey in the seemingly featureless seas, following the extraordinary life of yellowfin tuna from a minute egg to a 200 kilogram, voracious predatory giant.", 'small': 'Looking at the hunting skills of whales, dolphins, tuna, shark and rapier-nosed billfish.', 'medium': "David Attenborough narrates a natural history of the oceans. The deadly game of hide-and-seek played by the sea's charismatic hunters - whales, shark and billfish."}, 'versions': [{'duration': {'text': '58 mins'}, 'kind': 'original', 'download': True, 'availability': {'remaining': {'text': 'Available for 4 months'}}}, {'duration': {'text': '58 mins'}, 'kind': 'audio-described', 'download': False, 'availability': {'remaining': {'text': 'Available for 4 months'}}}], 'labels': {'category': 'Science & Nature'}}, {'id': 'b00818zy', 'live': False, 'type': 'episode', 'title': 'The Blue Planet', 'images': {'type': 'image', 'standard': 'https://ichef.bbci.co.uk/images/ic/{recipe}/p05rr5cm.jpg'}, 'subtitle': '4. Frozen Seas', 'synopses': {'large': 'A look at the survival techniques of creatures that endure the harsh conditions of the Arctic and Antarctic. For animals at both poles, life is dominated by the annual retreat and advance of the freezing sea ice and the challenge of surviving winters when temperatures drop.\n\nIn the Arctic the polar bear is the top predator, catching seals on the ice and forcing seabirds to nest high up on cliffs. In Antarctica the flightless penguins have no ground-based predators to deal with but lurking in the water is the constant threat from leopard seals.\n\nNarrated by David Attenborough.', 'small': 'A look at the survival techniques of creatures in the Arctic and Antarctic.', 'medium': 'A natural history of the oceans. A look at the survival techniques of creatures that endure the harsh conditions of the Arctic and Antarctic.'}, 'versions': [{'duration': {'text': '58 mins'}, 'kind': 'original', 'download': True, 'availability': {'remaining': {'text': 'Available for 4 months'}}}], 'labels': {'category': 'Nature'}}], 'count': 9}, 'recommendations': None, 'versions': [{'id': 'b001fkdj', 'kind': 'original', 'download': True, 'hd': False, 'guidance': False, 'rrc': False, 'events': [{'name': 'started', 'offset': 30, 'system': 'uas'}, {'name': 'iplxp-ep-started', 'offset': 30, 'system': 'optimizely'}, {'name': 'iplxp-ep-started', 'offset': 30, 'system': 'dax'}, {'name': 'iplxp-ep-watched', 'offset': 3123, 'system': 'optimizely'}, {'name': 'iplxp-ep-watched', 'offset': 3123, 'system': 'dax'}, {'name': 'ended', 'offset': 3380, 'system': 'uas'}], 'firstBroadcast': '9pm 12 Sep 2001', 'duration': {'text': '58 mins', 'seconds': 3470}, 'availability': {'remaining': {'text': 'Available for 4 months'}}, 'creditsStart': 3464, 'startTime': None, 'endTime': 1554278400}], 'player': {'status': 'loading', 'playingState': None, 'volume': 0.6, 'subtitles': False, 'continuousPlay': None}, 'config': {'staticAssetsPath': 'https://iplayer-web.files.bbci.co.uk/iplayer-web-app-playback-v2/1.0.0-216', 'host': 'www.bbc.co.uk', 'iblBaseUrl': 'https://ibl.api.bbc.co.uk/ibl/v1', 'tipBaseUrl': 'https://iplayer-web.files.bbci.co.uk/iplayer-web-tip-playback/7.1.1'}, 'stats': {'countername': 'iplayer.tv.episode.the_blue_planet.1_introduction.b0074mhp.page', 'firedEvents': []}, 'id': {'status': 'green', 'signedIn': False, 'ageBracket': None, 'enablePersonalisation': False, 'ctaMarkup': "%3Cp%20class%3D%22id4-cta%22%20id%3D%22id4-cta-d73a0a66-62f8-49be-bfe8-b293b61f035e%22%3E%3Cspan%20class%3D%22id5-cta%20id4-cta-size-medium%20id4-cta-color-mixed%20id4-cta-medium-mixed%22%3E%3Ca%20href%3D%22https%3A%2F%2Fsession.bbc.co.uk%2Fsession%3Fptrt%3Dhttps%253A%252F%252Fwww.bbc.co.uk%252Fiplayer%252Fepisode%252Fb0074mhp%252Fthe-blue-planet-1-introduction%26context%3Dtvandiplayer%26userOrigin%3Dtvandiplayer%22%20class%3D%22id4-cta-signin%20id4-cta-button%22%3ESign%20in%3C%2Fa%3E%3Cspan%20class%3D%22id4-cta-with%22%3E%20to%20the%20BBC%2C%3C%2Fspan%3E%20or%20%3Ca%20href%3D%22https%3A%2F%2Fsession.bbc.co.uk%2Fsession%3Faction%3Dregister%26ptrt%3Dhttps%253A%252F%252Fwww.bbc.co.uk%252Fiplayer%252Fepisode%252Fb0074mhp%252Fthe-blue-planet-1-introduction%26context%3Dtvandiplayer%26userOrigin%3Dtvandiplayer%22%20class%3D%22id4-cta-register%22%3ERegister%3C%2Fa%3E%3Cscript%20type%3D%22text%2Fjavascript%22%3Eif%20(require.s.contexts._.config.paths%5B'idcta-v2'%5D)%20%7Brequire(%5B'idcta-v2%2Fidcta-1'%5D%2C%20function(idcta)%20%7Bif%20(idcta%20%26%26%20typeof%20idcta.addUserOrigin%20%3D%3D%3D%20'function')%20%7Bidcta.addUserOrigin('id4-cta-d73a0a66-62f8-49be-bfe8-b293b61f035e')%3B%7D%7D)%3B%7D%3C%2Fscript%3E%3C%2Fspan%3E%3C%2Fp%3E%3Cscript%20type%3D%22text%2Fjavascript%22%3Erequire(%5B'idcta-v2%2Fidcta-1'%5D%2C%20function(idcta)%20%7Bnew%20idcta.Cta(%7Bid%3A%20'id4-cta-d73a0a66-62f8-49be-bfe8-b293b61f035e'%2C%20states%3A%20%7B%7D%2C%20policyname%3A%20''%7D)%3B%7D)%3B%3C%2Fscript%3E"}, 'user': {'hasPolyfills': None, 'supportsDownloads': None, 'isForeignRegion': None}, 'nextEpisode': {'id': 'b0074mjc', 'live': False, 'type': 'episode', 'title': 'The Blue Planet', 'images': {'type': 'image', 'standard': 'https://ichef.bbci.co.uk/images/ic/{recipe}/p05rr2wn.jpg'}, 'subtitle': '2. The Deep', 'synopses': {'large': 'More people have walked on the moon than have travelled to the very depths of the deep ocean. David Attenborough journeys into the abyss to show us, for the very first time, strange creatures straight out of the film Alien, many of which are new to science. Terrifying fish with massive teeth that eat prey twice their size and weird jellyfish that flash in the darkness. And deep sea sharks never filmed before and submerged mountain ranges and volcanoes far larger than anything on land.', 'small': 'David Attenborough looks at the strange creatures that live in the depths of the ocean.', 'medium': 'David Attenborough narrates a natural history of the oceans to uncover the strange, otherworldly creatures living in the depths of the ocean.'}, 'versions': [{'duration': {'text': '58 mins'}, 'kind': 'original', 'download': True, 'availability': {'remaining': {'text': 'Available for 4 months'}}}, {'duration': {'text': '58 mins'}, 'kind': 'audio-described', 'download': False, 'availability': {'remaining': {'text': 'Available for 4 months'}}}], 'labels': {'category': 'Science & Nature'}}, 'journey': {'status': 'success'}, 'modal': {'msi': False, 'download': False}, 'preroll': None, 'variants': {'iplxp_pb15_trailers': None}}}
```
### Additional comments, screenshots, etc.

[Love Streamlink? Please consider supporting our collective. Thanks!](https://opencollective.com/streamlink/donate)



Discussion:
@kachelaqa I'm not sure what the difference is in how they detect the video, but I just tried this application and the Dr Who episode I was after showed the error you described with Streamlink but could be downloaded via get_iplayer.

https://github.com/get-iplayer/get_iplayer

Doesn't seem quite as efficient as this ... but hey it's working!
@hogarthj That isn't really relevant, because get_iplayer doesn't support streaming any more. I only use streamlink for streaming iplayer content, so this bug is a complete show-stopper for me.
@kachelaqa can you include a debug log? Add `-l debug` to you command, to help debug/reproduce your issue. Thanks. 
@beardypig Sorry - I thought I'd done that. Does that mean you weren't able to reproduce the problem?

**LOG OUTPUT**:
```
[cli][debug] OS:         Linux-4.19.2-arch1-1-ARCH-x86_64-with-arch
[cli][debug] Python:     3.7.1
[cli][debug] Streamlink: 0.14.2
[cli][debug] Requests(2.20.1), Socks(1.6.7), Websocket(0.54.0)
[cli][info] Found matching plugin bbciplayer for URL https://www.bbc.co.uk/iplayer/episode/b0074mhp/the-blue-planet-1-introduction
[cli][debug] Plugin specific arguments:
[cli][debug]  --bbciplayer-username=mulberoo@gmx.com (username)
[cli][debug]  --bbciplayer-password=******** (password)
[plugin.bbciplayer][info] A TV License is required to watch BBC iPlayer streams, see the BBC website for more information: https://www.bbc.co.uk/iplayer/help/tvlicence
[plugin.bbciplayer][debug] Loading streams for episode: b0074mhp
[plugin.bbciplayer][debug] Looking for vpid on https://www.bbc.co.uk/iplayer/episode/b0074mhp/the-blue-planet-1-introduction
error: Unable to validate JSON: Key 'episode' not found in {'appBundleSrc': 'https://iplayer-web.files.bbci.co.uk/iplayer-web-app-playback-v2/1.0.0-245/js/app.bundle.js', 'appStoreState': {'translations': {'page_title_version_ad': 'Audio Described', 'page_title_version_sign': 'Signed', 'related_episodes_this_episode_label': 'This episode', 'related_episodes_title': 'More episodes', 'related_episodes_view_all': 'View all', 'msi_modal_title': "You need to sign in. It's quick & easy.", 'msi_modal_text': "And we'll keep you signed in.", 'msi_modal_why_sign_in': 'Why sign in to the BBC?', 'childrens_modal_why_sign_in': 'Why sign in to the BBC?', 'duration': 'Duration', 'next_episode': 'Next episode', 'next_recommended': 'Recommended for you', 'cancel': 'Cancel', 'cancel_autoplay': 'Cancel autoplay of %s', 'programme_ended_aria_label': 'The current programme has ended. %s will autoplay in %s seconds. Activate the cancel button to stop it playing', 'showhide_button_show': 'Show more', 'showhide_button_hide': 'Hide', 'showhide_button_aria_show': 'Show more programmes', 'showhide_button_aria_hide': 'Return to the player', 'skip_trailer': 'Skip Trailer', 'restart_programme': 'Restart programme', 'accessibility_banner_sign': 'This is a Signed version of this programme.', 'accessibility_banner_sign_non_available': "The non-Signed version isn't available.", 'accessibility_banner_sign_turn_off': 'Turn off Sign Language', 'accessibility_banner_ad': 'This is an Audio Described version of this programme.', 'accessibility_banner_ad_non_available': "The non-Audio Described version isn't available.", 'accessibility_banner_ad_turn_off': 'Turn off Audio Description', 'accessibility_banner_find_out_why': 'Find out why', 'expand_synopsis': 'More', 'collapse_synopsis': 'Less', 'first_shown': 'First shown', 'version_button_ad': 'Audio Described', 'version_button_ad_aria': 'Watch Audio Described version', 'version_button_ad_turn_off_aria': 'Watch non-Audio Described version', 'version_button_sign': 'Sign Language', 'version_button_sign_aria': 'Watch Sign Language version', 'version_button_sign_turn_off_aria': 'Watch non-Sign Language version', 'learn_more_about_availability': 'Learn more about availability', 'download': 'Download', 'add': 'Add', 'added': 'Added', 'remove': 'Remove', 'added_banner_message': ':episodeTitle has been added to', 'my_programmes': 'My Programmes', 'download_not_available_why_aria_label': "Why can't I download?", 'download_modal_title': 'Programme Downloads', 'download_modal_have_you_installed': 'Have you installed BBC iPlayer Downloads?', 'download_modal_help_faq': 'Help & FAQ', 'download_button_hd': 'Yes, download in HD', 'download_button_sd': 'Yes, download in SD', 'download_button_install_now': 'No, install now', 'rrc_why_aria_label': 'More information about revisions, revocations and corrections', 'programme_footer_link_label': 'Programme links', 'programme_footer_link_programme_website': 'Programme website', 'programme_footer_link_credits': 'Credits', 'programme_footer_link_more_from_bbc_three': 'More from BBC Three', 'preroll_available_now': 'Available now on BBC iPlayer', 'preroll_coming_soon': 'Coming soon on BBC iPlayer', 'foreign_region_banner': 'BBC iPlayer only works in the UK. Sorry, it’s due to rights issues.', 'foreign_region_banner_advice': "In the UK? Here's some advice."}, 'episode': {'status': 'success', 'resumeOffset': None, 'added': None, 'addSuccess': None, 'id': 'b0074mhp', 'live': False, 'title': 'The Blue Planet', 'subtitle': '1. Introduction', 'synopses': {'large': 'Although 70 per cent of our planet is covered by water, the oceans and many of their inhabitants - such as the blue whale - remain an unexplored mystery. This edition travels to the very depths of the seas to reveal a spectacular variety of life - from alien monsters of the deep to pack-hunting killer whales attacking a grey whale calf.', 'small': 'This travels to the very depths of the seas, to reveal a spectacular variety of life.', 'medium': 'David Attenborough narrates a natural history of the oceans. We travel to the depths of the seas to reveal a spectacular variety of life, some never filmed before.', 'editorial': "Giant creatures, alien lifeforms, microscopic colonies - it's all here under the waves."}, 'images': {'type': 'image', 'standard': 'https://ichef.bbci.co.uk/images/ic/{recipe}/p06mnw3k.jpg'}, 'masterBrand': {'id': 'bbc_one', 'titles': {'large': 'BBC One', 'small': 'BBC One', 'medium': 'BBC One'}, 'ident_id': 'p06g87jc', 'attribution': 'bbc_one'}, 'requiresSignIn': True, 'tleoId': 'b008044n', 'tleoType': 'series', 'guidance': False, 'labels': {'category': 'Science & Nature'}, 'hasCredits': True, 'currentVersion': 'standard'}, 'relatedEpisodes': {'episodes': [{'id': 'b0074mhp', 'live': False, 'type': 'episode', 'title': 'The Blue Planet', 'images': {'type': 'image', 'standard': 'https://ichef.bbci.co.uk/images/ic/{recipe}/p06mnw3k.jpg'}, 'subtitle': '1. Introduction', 'synopses': {'large': 'Although 70 per cent of our planet is covered by water, the oceans and many of their inhabitants - such as the blue whale - remain an unexplored mystery. This edition travels to the very depths of the seas to reveal a spectacular variety of life - from alien monsters of the deep to pack-hunting killer whales attacking a grey whale calf.', 'small': 'This travels to the very depths of the seas, to reveal a spectacular variety of life.', 'medium': 'David Attenborough narrates a natural history of the oceans. We travel to the depths of the seas to reveal a spectacular variety of life, some never filmed before.', 'editorial': "Giant creatures, alien lifeforms, microscopic colonies - it's all here under the waves."}, 'versions': [{'duration': {'text': '58 mins'}, 'kind': 'original', 'download': True, 'availability': {'remaining': {'text': 'Available for 4 months'}}}], 'labels': {'category': 'Science & Nature'}}, {'id': 'b0074mjc', 'live': False, 'type': 'episode', 'title': 'The Blue Planet', 'images': {'type': 'image', 'standard': 'https://ichef.bbci.co.uk/images/ic/{recipe}/p05rr2wn.jpg'}, 'subtitle': '2. The Deep', 'synopses': {'large': 'More people have walked on the moon than have travelled to the very depths of the deep ocean. David Attenborough journeys into the abyss to show us, for the very first time, strange creatures straight out of the film Alien, many of which are new to science. Terrifying fish with massive teeth that eat prey twice their size and weird jellyfish that flash in the darkness. And deep sea sharks never filmed before and submerged mountain ranges and volcanoes far larger than anything on land.', 'small': 'David Attenborough looks at the strange creatures that live in the depths of the ocean.', 'medium': 'David Attenborough narrates a natural history of the oceans to uncover the strange, otherworldly creatures living in the depths of the ocean.'}, 'versions': [{'duration': {'text': '58 mins'}, 'kind': 'original', 'download': True, 'availability': {'remaining': {'text': 'Available for 4 months'}}}, {'duration': {'text': '58 mins'}, 'kind': 'audio-described', 'download': False, 'availability': {'remaining': {'text': 'Available for 4 months'}}}], 'labels': {'category': 'Science & Nature'}}, {'id': 'b0080pjz', 'live': False, 'type': 'episode', 'title': 'The Blue Planet', 'images': {'type': 'image', 'standard': 'https://ichef.bbci.co.uk/images/ic/{recipe}/p05rr3ds.jpg'}, 'subtitle': '3. Open Ocean', 'synopses': {'large': "This programme focuses on the predatory skills of some of the most charismatic hunters found on the planet: whales, dolphins, tuna, shark and rapier-nosed billfish. The open ocean is unimaginably immense - it covers more than 360 million square kilometres of the Earth's surface. Much of this huge expanse of seawater is marine desert with virtually no sign of life. Yet the fastest and most powerful survive, playing a deadly game of hide-and-seek with their prey. This charts how they track down prey in the seemingly featureless seas, following the extraordinary life of yellowfin tuna from a minute egg to a 200 kilogram, voracious predatory giant.", 'small': 'Looking at the hunting skills of whales, dolphins, tuna, shark and rapier-nosed billfish.', 'medium': "David Attenborough narrates a natural history of the oceans. The deadly game of hide-and-seek played by the sea's charismatic hunters - whales, shark and billfish."}, 'versions': [{'duration': {'text': '58 mins'}, 'kind': 'original', 'download': True, 'availability': {'remaining': {'text': 'Available for 4 months'}}}, {'duration': {'text': '58 mins'}, 'kind': 'audio-described', 'download': False, 'availability': {'remaining': {'text': 'Available for 4 months'}}}], 'labels': {'category': 'Science & Nature'}}, {'id': 'b00818zy', 'live': False, 'type': 'episode', 'title': 'The Blue Planet', 'images': {'type': 'image', 'standard': 'https://ichef.bbci.co.uk/images/ic/{recipe}/p05rr5cm.jpg'}, 'subtitle': '4. Frozen Seas', 'synopses': {'large': 'A look at the survival techniques of creatures that endure the harsh conditions of the Arctic and Antarctic. For animals at both poles, life is dominated by the annual retreat and advance of the freezing sea ice and the challenge of surviving winters when temperatures drop.\n\nIn the Arctic the polar bear is the top predator, catching seals on the ice and forcing seabirds to nest high up on cliffs. In Antarctica the flightless penguins have no ground-based predators to deal with but lurking in the water is the constant threat from leopard seals.\n\nNarrated by David Attenborough.', 'small': 'A look at the survival techniques of creatures in the Arctic and Antarctic.', 'medium': 'A natural history of the oceans. A look at the survival techniques of creatures that endure the harsh conditions of the Arctic and Antarctic.'}, 'versions': [{'duration': {'text': '58 mins'}, 'kind': 'original', 'download': True, 'availability': {'remaining': {'text': 'Available for 4 months'}}}], 'labels': {'category': 'Nature'}}], 'count': 9}, 'recommendations': None, 'versions': [{'id': 'b001fkdj', 'kind': 'original', 'download': True, 'hd': False, 'guidance': False, 'rrc': False, 'events': [{'name': 'started', 'offset': 30, 'system': 'uas'}, {'name': 'iplxp-ep-started', 'offset': 30, 'system': 'optimizely'}, {'name': 'iplxp-ep-started', 'offset': 30, 'system': 'dax'}, {'name': 'iplxp-ep-watched', 'offset': 3123, 'system': 'optimizely'}, {'name': 'iplxp-ep-watched', 'offset': 3123, 'system': 'dax'}, {'name': 'ended', 'offset': 3380, 'system': 'uas'}], 'firstBroadcast': '9pm 12 Sep 2001', 'duration': {'text': '58 mins', 'seconds': 3470}, 'availability': {'remaining': {'text': 'Available for 4 months'}}, 'creditsStart': 3464, 'startTime': None, 'endTime': 1554278400}], 'player': {'status': 'loading', 'playingState': None, 'volume': 0.6, 'subtitles': False, 'continuousPlay': None}, 'config': {'staticAssetsPath': 'https://iplayer-web.files.bbci.co.uk/iplayer-web-app-playback-v2/1.0.0-245', 'host': 'www.bbc.co.uk', 'iblBaseUrl': 'https://ibl.api.bbc.co.uk/ibl/v1', 'tipBaseUrl': 'https://iplayer-web.files.bbci.co.uk/iplayer-web-tip-playback/7.2.0'}, 'stats': {'countername': 'iplayer.tv.episode.the_blue_planet.1_introduction.b0074mhp.page', 'firedEvents': []}, 'id': {'status': 'green', 'signedIn': False, 'ageBracket': None, 'enablePersonalisation': False, 'ctaMarkup': "%3Cp%20class%3D%22id4-cta%22%20id%3D%22id4-cta-2c0561a8-945f-4eef-935a-94eaa9015a0f%22%3E%3Cspan%20class%3D%22id5-cta%20id4-cta-size-medium%20id4-cta-color-mixed%20id4-cta-medium-mixed%22%3E%3Ca%20href%3D%22https%3A%2F%2Fsession.bbc.co.uk%2Fsession%3Fptrt%3Dhttps%253A%252F%252Fwww.bbc.co.uk%252Fiplayer%252Fepisode%252Fb0074mhp%252Fthe-blue-planet-1-introduction%26context%3Dtvandiplayer%26userOrigin%3Dtvandiplayer%22%20class%3D%22id4-cta-signin%20id4-cta-button%22%3ESign%20in%3C%2Fa%3E%3Cspan%20class%3D%22id4-cta-with%22%3E%20to%20the%20BBC%2C%3C%2Fspan%3E%20or%20%3Ca%20href%3D%22https%3A%2F%2Fsession.bbc.co.uk%2Fsession%3Faction%3Dregister%26ptrt%3Dhttps%253A%252F%252Fwww.bbc.co.uk%252Fiplayer%252Fepisode%252Fb0074mhp%252Fthe-blue-planet-1-introduction%26context%3Dtvandiplayer%26userOrigin%3Dtvandiplayer%22%20class%3D%22id4-cta-register%22%3ERegister%3C%2Fa%3E%3Cscript%20type%3D%22text%2Fjavascript%22%3Eif%20(require.s.contexts._.config.paths%5B'idcta-v2'%5D)%20%7Brequire(%5B'idcta-v2%2Fidcta-1'%5D%2C%20function(idcta)%20%7Bif%20(idcta%20%26%26%20typeof%20idcta.addUserOrigin%20%3D%3D%3D%20'function')%20%7Bidcta.addUserOrigin('id4-cta-2c0561a8-945f-4eef-935a-94eaa9015a0f')%3B%7D%7D)%3B%7D%3C%2Fscript%3E%3C%2Fspan%3E%3C%2Fp%3E%3Cscript%20type%3D%22text%2Fjavascript%22%3Erequire(%5B'idcta-v2%2Fidcta-1'%5D%2C%20function(idcta)%20%7Bnew%20idcta.Cta(%7Bid%3A%20'id4-cta-2c0561a8-945f-4eef-935a-94eaa9015a0f'%2C%20states%3A%20%7B%7D%2C%20policyname%3A%20''%7D)%3B%7D)%3B%3C%2Fscript%3E", 'cdnFailover': False}, 'user': {'hasPolyfills': None, 'supportsDownloads': None, 'isForeignRegion': None}, 'nextEpisode': {'id': 'b0074mjc', 'live': False, 'type': 'episode', 'title': 'The Blue Planet', 'images': {'type': 'image', 'standard': 'https://ichef.bbci.co.uk/images/ic/{recipe}/p05rr2wn.jpg'}, 'subtitle': '2. The Deep', 'synopses': {'large': 'More people have walked on the moon than have travelled to the very depths of the deep ocean. David Attenborough journeys into the abyss to show us, for the very first time, strange creatures straight out of the film Alien, many of which are new to science. Terrifying fish with massive teeth that eat prey twice their size and weird jellyfish that flash in the darkness. And deep sea sharks never filmed before and submerged mountain ranges and volcanoes far larger than anything on land.', 'small': 'David Attenborough looks at the strange creatures that live in the depths of the ocean.', 'medium': 'David Attenborough narrates a natural history of the oceans to uncover the strange, otherworldly creatures living in the depths of the ocean.'}, 'versions': [{'duration': {'text': '58 mins'}, 'kind': 'original', 'download': True, 'availability': {'remaining': {'text': 'Available for 4 months'}}}, {'duration': {'text': '58 mins'}, 'kind': 'audio-described', 'download': False, 'availability': {'remaining': {'text': 'Available for 4 months'}}}], 'labels': {'category': 'Science & Nature'}}, 'journey': {'status': 'success'}, 'modal': {'msi': False, 'download': False, 'kidsUpsell': False}, 'preroll': None, 'variants': {'iplxp_pb15_trailers': None}}}
```
@kachelaqa, it also failed for me, but I wanted to make sure it was failing in the same place as yours :)

Resolving patch:
diff --git a/src/streamlink/plugins/bbciplayer.py b/src/streamlink/plugins/bbciplayer.py
--- a/src/streamlink/plugins/bbciplayer.py
+++ b/src/streamlink/plugins/bbciplayer.py
@@ -45,11 +45,11 @@ class BBCiPlayer(Plugin):
 
     mediator_schema = validate.Schema(
         {
-            "episode": {
+            "appStoreState": {
                 "versions": [{"id": validate.text}]
             }
         },
-        validate.get("episode"), validate.get("versions"), validate.get(0),
+        validate.get("appStoreState"), validate.get("versions"), validate.get(0),
         validate.get("id")
     )
     mediaselector_schema = validate.Schema(


Test patch: