- r'window\.__INITIAL_STATE__\s*=\s*({.+?})</script>',
- webpage, 'inital state'), video_id).get('watch', {}).get('mediaResource') or {}
+ [
+ r'window\.__INITIAL_STATE__\s*=\s*({.+?})(?:</script>|;)',
+ r'window\.__INITIAL_STATE__\s*=\s*({.+})'
+ ], webpage, 'inital state'), video_id).get('watch', {}).get('mediaResource') or {}