A feature-rich command-line audio/video downloader
bugfix for a44ca5a470e09b5170fc9c3a46733f050fadbfae, 19a0394044bfad36cd665450271b8eb048a41c02, 77f9033095cd8e1092a80db67f2b577cf13f95a8
pukkandan1e9969f4f517
diff --git a/yt_dlp/extractor/facebook.py b/yt_dlp/extractor/facebook.pyindex f15a364249..de45f92987 100644--- a/yt_dlp/extractor/facebook.py+++ b/yt_dlp/extractor/facebook.py@@ -394,10 +394,8 @@ class FacebookIE(InfoExtractor):r'handleWithCustomApplyEach\(\s*ScheduledApplyEach\s*,\s*(\{.+?\})\s*\);', webpage)]post = traverse_obj(post_data, (..., 'require', ..., ..., ..., '__bbox', 'result', 'data'), expected_type=dict) or []- media = traverse_obj(- post,- (..., 'attachments', ..., 'media', lambda _, m: str(m['id']) == video_id and m['__typename'] == 'Video'),- expected_type=dict)+ media = traverse_obj(post, (..., 'attachments', ..., lambda k, v: (+ k == 'media' and str(v['id']) == video_id and v['__typename'] == 'Video')), expected_type=dict)title = get_first(media, ('title', 'text'))description = get_first(media, ('creation_story', 'comet_sections', 'message', 'story', 'message', 'text'))uploader_data = get_first(media, 'owner') or get_first(post, ('node', 'actors', ...)) or {}diff --git a/yt_dlp/postprocessor/ffmpeg.py b/yt_dlp/postprocessor/ffmpeg.pyindex 6fe1b6cdd6..d909149ef3 100644--- a/yt_dlp/postprocessor/ffmpeg.py+++ b/yt_dlp/postprocessor/ffmpeg.py@@ -1151,7 +1151,7 @@ class FFmpegConcatPP(FFmpegPostProcessor):entries = info.get('entries') or []if not any(entries) or (self._only_multi_video and info['_type'] != 'multi_video'):return [], info- elif traverse_obj(entries, (..., 'requested_downloads', lambda _, v: len(v) > 1)):+ elif traverse_obj(entries, (..., lambda k, v: k == 'requested_downloads' and len(v) > 1)):raise PostProcessingError('Concatenation is not supported when downloading multiple separate formats')in_files = traverse_obj(entries, (..., 'requested_downloads', 0, 'filepath')) or []diff --git a/yt_dlp/postprocessor/metadataparser.py b/yt_dlp/postprocessor/metadataparser.pyindex 98885bd194..51b927b911 100644--- a/yt_dlp/postprocessor/metadataparser.py+++ b/yt_dlp/postprocessor/metadataparser.py@@ -6,12 +6,12 @@ from ..utils import Namespaceclass MetadataParserPP(PostProcessor):def __init__(self, downloader, actions):- super().__init__(self, downloader)+ super().__init__(downloader)self._actions = []for f in actions:action, *args = fassert action in self.Actions- self._actions.append(action(*args))+ self._actions.append(action(self, *args))@classmethoddef validate_action(cls, action, *data):@@ -21,7 +21,7 @@ class MetadataParserPP(PostProcessor):"""if action not in cls.Actions:raise ValueError(f'{action!r} is not a valid action')- getattr(cls, action.value)(cls, *data) # So this can raise error to validate+ action(cls, *data) # So this can raise error to validate@staticmethoddef field_to_template(tmpl):diff --git a/yt_dlp/utils.py b/yt_dlp/utils.pyindex cf52fb2b63..e1db7b8681 100644--- a/yt_dlp/utils.py+++ b/yt_dlp/utils.py@@ -1,5 +1,4 @@#!/usr/bin/env python3-import asyncioimport atexitimport base64import binascii@@ -41,6 +40,7 @@ import xml.etree.ElementTreeimport zlibfrom .compat import (+ asyncio,compat_brotli,compat_chr,compat_cookiejar,