Skip to content

Commit

Permalink
[VrtNU] Handle empty title (yt-dlp#2147)
Browse files Browse the repository at this point in the history
Closes yt-dlp#2146
Authored by: pgaig
  • Loading branch information
pgaig committed Dec 31, 2021
1 parent 497d77e commit 3464a27
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions yt_dlp/extractor/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,16 @@ def _real_extract(self, url):
'vrtPlayerToken': vrtPlayerToken,
'client': 'null',
}, expected_status=400)
if not data.get('title'):
if 'title' not in data:
code = data.get('code')
if code == 'AUTHENTICATION_REQUIRED':
self.raise_login_required()
elif code == 'INVALID_LOCATION':
self.raise_geo_restricted(countries=['BE'])
raise ExtractorError(data.get('message') or code, expected=True)

title = data['title']
# Note: The title may be an empty string
title = data['title'] or f'{site_id} {video_id}'
description = data.get('description')

formats = []
Expand Down

0 comments on commit 3464a27

Please sign in to comment.