From 5ac23244609314e3e76da89a992ae76160a68238 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sat, 9 Jan 2021 21:29:58 +0530 Subject: [PATCH] [youtube] Show if video is embeddable in info Closes https://github.com/ytdl-org/youtube-dl/issues/27730 --- youtube_dlc/extractor/youtube.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py index 9c9292a38..44acb069a 100644 --- a/youtube_dlc/extractor/youtube.py +++ b/youtube_dlc/extractor/youtube.py @@ -1817,6 +1817,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor): if not isinstance(video_info, dict): video_info = {} + playable_in_embed = try_get( + player_response, lambda x: x['playabilityStatus']['playableInEmbed']) + video_details = try_get( player_response, lambda x: x['videoDetails'], dict) or {} @@ -2538,6 +2541,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'release_date': release_date, 'release_year': release_year, 'subscriber_count': subscriber_count, + 'playable_in_embed': playable_in_embed, }