diff options
| author | dirkf <fieldhouse@gmx.net> | 2024-03-03 12:38:00 +0000 | 
|---|---|---|
| committer | dirkf <fieldhouse@gmx.net> | 2024-03-27 13:11:17 +0000 | 
| commit | 21792b88b791b16e3ab0a0fb2e26e5bb8a4e2ff3 (patch) | |
| tree | 9bba85e51064a62cb17701ad9038ffdd7c2afb79 /test | |
| parent | d8f134a664d7be2c10aba44fc2d54a8f7b0542ff (diff) | |
[external/FFmpeg] Fix and improve --ffmpeg-location handling
* pass YoutubeDL (FileDownloader) to FFmpegPostProcessor constructor
* consolidate path search in FFmpegPostProcessor
* make availability of FFmpegFD depend on existence of FFmpegPostProcessor
* detect ffmpeg executable on instantiation of FFmpegFD
* resolves #32735
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_downloader_external.py | 16 | 
1 files changed, 15 insertions, 1 deletions
| diff --git a/test/test_downloader_external.py b/test/test_downloader_external.py index 029f9b05f..4491bd9de 100644 --- a/test/test_downloader_external.py +++ b/test/test_downloader_external.py @@ -18,6 +18,7 @@ from test.helper import (  )  from youtube_dl import YoutubeDL  from youtube_dl.compat import ( +    compat_contextlib_suppress,      compat_http_cookiejar_Cookie,      compat_http_server,      compat_kwargs, @@ -35,6 +36,9 @@ from youtube_dl.downloader.external import (      HttpieFD,      WgetFD,  ) +from youtube_dl.postprocessor import ( +    FFmpegPostProcessor, +)  import threading  TEST_SIZE = 10 * 1024 @@ -227,7 +231,17 @@ class TestAria2cFD(unittest.TestCase):              self.assertIn('--load-cookies=%s' % downloader._cookies_tempfile, cmd) -@ifExternalFDAvailable(FFmpegFD) +# Handle delegated availability +def ifFFmpegFDAvailable(externalFD): +    # raise SkipTest, or set False! +    avail = ifExternalFDAvailable(externalFD) and False +    with compat_contextlib_suppress(Exception): +        avail = FFmpegPostProcessor(downloader=None).available +    return unittest.skipUnless( +        avail, externalFD.get_basename() + ' not found') + + +@ifFFmpegFDAvailable(FFmpegFD)  class TestFFmpegFD(unittest.TestCase):      _args = [] | 
