1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-04 14:44:53 -04:00

[cleanup, docs] Misc cleanup

Closes #2828, closes #2734, closes #2802, closes #2937
This commit is contained in:
pukkandan
2022-03-04 19:38:55 +05:30
parent c89bec262c
commit 08d30158ec
20 changed files with 114 additions and 87 deletions

View File

@@ -3094,6 +3094,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
# Some formats may have much smaller duration than others (possibly damaged during encoding)
# Eg: 2-nOtRESiUc Ref: https://github.com/yt-dlp/yt-dlp/issues/2823
is_damaged = try_get(fmt, lambda x: float(x['approxDurationMs']) < approx_duration - 10000)
if is_damaged:
self.report_warning(f'{video_id}: Some formats are possibly damaged. They will be deprioritized', only_once=True)
dct = {
'asr': int_or_none(fmt.get('audioSampleRate')),
'filesize': int_or_none(fmt.get('contentLength')),