mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-31 22:55:18 +00:00
[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>
This commit is contained in:
@@ -3611,7 +3611,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
'frameworkUpdates', 'entityBatchUpdate', 'mutations',
|
||||
lambda _, v: v['payload']['macroMarkersListEntity']['markersList']['markerType'] == 'MARKER_TYPE_HEATMAP',
|
||||
'payload', 'macroMarkersListEntity', 'markersList', 'markers', ..., {
|
||||
'start_time': ('startMillis', {functools.partial(float_or_none, scale=1000)}),
|
||||
'start_time': ('startMillis', {float_or_none(scale=1000)}),
|
||||
'end_time': {lambda x: (int(x['startMillis']) + int(x['durationMillis'])) / 1000},
|
||||
'value': ('intensityScoreNormalized', {float_or_none}),
|
||||
})) or None
|
||||
@@ -3637,7 +3637,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
'author_is_verified': ('author', 'isVerified', {bool}),
|
||||
'author_url': ('author', 'channelCommand', 'innertubeCommand', (
|
||||
('browseEndpoint', 'canonicalBaseUrl'), ('commandMetadata', 'webCommandMetadata', 'url'),
|
||||
), {lambda x: urljoin('https://www.youtube.com', x)}),
|
||||
), {urljoin('https://www.youtube.com')}),
|
||||
}, get_all=False),
|
||||
'is_favorited': (None if toolbar_entity_payload is None else
|
||||
toolbar_entity_payload.get('heartState') == 'TOOLBAR_HEART_STATE_HEARTED'),
|
||||
@@ -4304,7 +4304,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
continue
|
||||
|
||||
tbr = float_or_none(fmt.get('averageBitrate') or fmt.get('bitrate'), 1000)
|
||||
format_duration = traverse_obj(fmt, ('approxDurationMs', {lambda x: float_or_none(x, 1000)}))
|
||||
format_duration = traverse_obj(fmt, ('approxDurationMs', {float_or_none(scale=1000)}))
|
||||
# Some formats may have much smaller duration than others (possibly damaged during encoding)
|
||||
# E.g. 2-nOtRESiUc Ref: https://github.com/yt-dlp/yt-dlp/issues/2823
|
||||
# Make sure to avoid false positives with small duration differences.
|
||||
|
||||
Reference in New Issue
Block a user