aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/extractor/bravotv.py
diff options
context:
space:
mode:
authorsepro <sepro@sepr0.com>2024-11-04 01:33:21 +0100
committerGitHub <noreply@github.com>2024-11-04 01:33:21 +0100
commit197d0b03b6a3c8fe4fa5ace630eeffec629bf72c (patch)
tree577bda6784f8c1dbd9bcdf5e3a524a3c3c650f75 /yt_dlp/extractor/bravotv.py
parentb03267bf0675eeb8df5baf1daac7cf67840c91a5 (diff)
[cleanup] Misc (#11347)
Closes #11361 Authored by: avagordon01, bashonly, grqz, Grub4K, seproDev Co-authored-by: Ava Gordon <avagordon01@gmail.com> Co-authored-by: bashonly <bashonly@protonmail.com> Co-authored-by: N/Ame <173015200+grqz@users.noreply.github.com> Co-authored-by: Simon Sawicki <contact@grub4k.xyz>
Diffstat (limited to 'yt_dlp/extractor/bravotv.py')
-rw-r--r--yt_dlp/extractor/bravotv.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/yt_dlp/extractor/bravotv.py b/yt_dlp/extractor/bravotv.py
index ec72f0d88..0b2c44798 100644
--- a/yt_dlp/extractor/bravotv.py
+++ b/yt_dlp/extractor/bravotv.py
@@ -145,10 +145,9 @@ class BravoTVIE(AdobePassIE):
tp_metadata = self._download_json(
update_url_query(tp_url, {'format': 'preview'}), video_id, fatal=False)
- seconds_or_none = lambda x: float_or_none(x, 1000)
chapters = traverse_obj(tp_metadata, ('chapters', ..., {
- 'start_time': ('startTime', {seconds_or_none}),
- 'end_time': ('endTime', {seconds_or_none}),
+ 'start_time': ('startTime', {float_or_none(scale=1000)}),
+ 'end_time': ('endTime', {float_or_none(scale=1000)}),
}))
# prune pointless single chapters that span the entire duration from short videos
if len(chapters) == 1 and not traverse_obj(chapters, (0, 'end_time')):
@@ -168,8 +167,8 @@ class BravoTVIE(AdobePassIE):
**merge_dicts(traverse_obj(tp_metadata, {
'title': 'title',
'description': 'description',
- 'duration': ('duration', {seconds_or_none}),
- 'timestamp': ('pubDate', {seconds_or_none}),
+ 'duration': ('duration', {float_or_none(scale=1000)}),
+ 'timestamp': ('pubDate', {float_or_none(scale=1000)}),
'season_number': (('pl1$seasonNumber', 'nbcu$seasonNumber'), {int_or_none}),
'episode_number': (('pl1$episodeNumber', 'nbcu$episodeNumber'), {int_or_none}),
'series': (('pl1$show', 'nbcu$show'), (None, ...), {str}),