Closed endkb closed 6 months ago
$Getjson = "(?<=<script> window.__PRELOADED_STATE__ = )(.*?)(?=; </script>)"
$jsonResult = [regex]::match($SoundsShowPage, $Getjson)
$jsonData = $jsonResult | ConvertFrom-Json
Implemented. Needs to be tested.
Happy with the testing. Merged test-json-metadata to main.
SoundsDownloadScript.ps1 uses regex and ConvertFrom-StringData to parse the program metadata from the BBC Sounds page. This isn't always reliable when there are certain characters, especially quotes and commas.
The metadata is already in JSON format.
Recommend using regex to pull the whole JSON string, and then ConvertFrom-Json to parse the needed data.