From 899e2b6b2b0f85a627c8241384ed5d28e43a49c1 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 24 Jul 2024 00:26:54 +0200 Subject: [PATCH] [youtube] sloppy fix --- src/you_get/extractors/youtube.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/you_get/extractors/youtube.py b/src/you_get/extractors/youtube.py index f87ea31b..dd06daf8 100644 --- a/src/you_get/extractors/youtube.py +++ b/src/you_get/extractors/youtube.py @@ -201,7 +201,7 @@ class YouTube(VideoExtractor): self.js = get_content(self.html5player).replace('\n', ' ') logging.debug('Loading ytInitialPlayerResponse...') - ytInitialPlayerResponse = json.loads(re.search('ytInitialPlayerResponse\s*=\s*([^\n]+?});(\n|)', video_page).group(1)) + ytInitialPlayerResponse = json.loads(re.search('ytInitialPlayerResponse\s*=\s*([^\n]+?});(\n||var )', video_page).group(1)) # Get the video title self.title = ytInitialPlayerResponse["videoDetails"]["title"]