1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-17 00:22:34 +01:00

Apply suggestions from code review

Co-authored-by: dirkf <fieldhouse@gmx.net>
This commit is contained in:
Sean Ellingham 2024-06-24 19:07:52 +01:00 committed by GitHub
parent 159b3bbf19
commit caae2e6233
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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: