From 3de370796e378dd20ea3d8c4c706b39d9360a832 Mon Sep 17 00:00:00 2001 From: John Hawkinson Date: Sun, 12 Feb 2017 13:03:05 -0500 Subject: [PATCH] [Brightcove] dict_get not if .get(x): .get(y) --- youtube_dl/extractor/brightcove.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py index 7cef3657d..cdc3d6024 100644 --- a/youtube_dl/extractor/brightcove.py +++ b/youtube_dl/extractor/brightcove.py @@ -16,6 +16,7 @@ from ..compat import ( ) from ..utils import ( determine_ext, + dict_get, ExtractorError, extract_attributes, find_xpath_attr, @@ -513,10 +514,7 @@ class BrightcoveNewIE(InfoExtractor): for video in re.findall(r'(?i)(]+>)', webpage): attrs = extract_attributes(video) - video_id = attrs.get('data-brightcove-video-id') - if video_id is None: - video_id = attrs.get('data-video-id') - + video_id = dict_get(attrs, ['data-brightcove-video-id', 'data-video-id']) account_id = attrs.get('data-account') player_id = attrs.get('data-player') embed = attrs.get('data-embed')