mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-16 16:13:35 +01:00
Apply suggestions from code review
Co-authored-by: dirkf <fieldhouse@gmx.net>
This commit is contained in:
parent
159b3bbf19
commit
caae2e6233
@ -39,10 +39,10 @@ def _real_extract(self, url):
|
||||
'episode_number': int_or_none(episode_number),
|
||||
}
|
||||
|
||||
if video_info['title'] is None:
|
||||
if not video_info.get('title'):
|
||||
video_info['title'] = self._html_search_meta(['og:title', 'twitter:title'], webpage)
|
||||
|
||||
if video_info['description'] is None:
|
||||
if not video_info.get('description'):
|
||||
video_info['description'] = self._html_search_meta(['og:description', 'twitter:description'], webpage)
|
||||
|
||||
return video_info
|
||||
|
@ -300,13 +300,13 @@ def _extract_embed_urls(cls, url, webpage):
|
||||
|
||||
# Extract inline/lightbox embeds
|
||||
for embed_elm in re.findall(r'(<img[^>]+class=(["\'])(?:[^>"\']* )?vidyard-player-embed(?: [^>"\']*)?\2[^>]+[^>]*>)', webpage):
|
||||
embed = extract_attributes(embed_elm[0]) or {}
|
||||
embed = extract_attributes(embed_elm[0])
|
||||
uuid = embed.get('data-uuid')
|
||||
if uuid:
|
||||
yield f'https://play.vidyard.com/{uuid}.html'
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_valid_url(url).group('id')
|
||||
video_id = self._match_id(url)
|
||||
video_json = self._fetch_video_json(video_id)
|
||||
|
||||
if len(video_json['chapters']) == 1:
|
||||
|
Loading…
Reference in New Issue
Block a user