I have the following HTML output I’d like to parse as JSON in python
<script>
window.__PRELOADED_STATE__ = JSON.parse('{"deviceType":"desktop","session":{"cmpEnabled":false,"showAds":true,"logClientMetrics":false,"fringeEnabled":true,"features":["song_stories_public_launch"]},"currentPage":"songPage","songPage":{"longTailCacheExperiment":null,"song":4779945,"pinnedQuestions":[],"metadataQuestions":["producer:song:4779945","release-date:song:4779945","writer:song:4779945"],"lyricsData":{"referents":[],"body":{"html":"<p>[Intro]<br>\n(1,2,3,4)<br>\nHey, hey, hey, hey, hey, hey, hey, hey, hey, hey<br>\nHey, hey, hey, hey, hey, hey, hey, hey, hey, hey, hey<br>\n<br>\n[Verse 1]<br>\nHey (Hey), I'm your life, I'm the one who takes you there<br>\
I’v tried with beautifuloup and using a regular expression but didn’t get the desired results. I’d like to use json.loads in Python to convert what’s inside window.PRELOADED_STATE = JSON.parse to a dictionary.