Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self tests fail on postprocessors-> thumbnails #4745

Closed
9 tasks done
mauricioquintela opened this issue Aug 23, 2022 · 3 comments
Closed
9 tasks done

Self tests fail on postprocessors-> thumbnails #4745

mauricioquintela opened this issue Aug 23, 2022 · 3 comments
Labels
bug Bug that is not site-specific duplicate This issue or pull request already exists

Comments

@mauricioquintela
Copy link

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I remove or skip any mandatory* field

Checklist

  • I'm reporting a bug unrelated to a specific site
  • I've verified that I'm running yt-dlp version 2022.08.19 (update instructions) or later (specify commit)
  • I've checked that all provided URLs are playable in a browser with the same IP and same login details
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I've read the guidelines for opening an issue

Provide a description that is worded well enough to be understood

Building yt-dlp from source using aur package yt-dlp-git, self-test sequence fails at test/test_postprocessors.py::TestConvertThumbnail::test_escaping, preventing correct instalation.

Specifically, the error outputed from the self-test is:

===================================================== FAILURES ======================================================
________________________________________ TestConvertThumbnail.test_escaping _________________________________________

self = <test.test_postprocessors.TestConvertThumbnail testMethod=test_escaping>

    def test_escaping(self):
        pp = FFmpegThumbnailsConvertorPP()
        if not pp.available:
            print('Skipping: ffmpeg not found')
            return
    
        file = 'test/testdata/thumbnails/foo %d bar/foo_%d.{}'
        tests = (('webp', 'png'), ('png', 'jpg'))
    
        for inp, out in tests:
            out_file = file.format(out)
            if os.path.exists(out_file):
                os.remove(out_file)
>           pp.convert_thumbnail(file.format(inp), out)

test/test_postprocessors.py:56: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
yt_dlp/postprocessor/ffmpeg.py:1093: in convert_thumbnail
    self.real_run_ffmpeg(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <yt_dlp.postprocessor.ffmpeg.FFmpegThumbnailsConvertorPP object at 0x7fb03a700250>
input_path_opts = [('test/testdata/thumbnails/foo %d bar/foo_%d.webp', ['-f', 'image2', '-pattern_type', 'none'])]
output_path_opts = [('test/testdata/thumbnails/foo %%d bar/foo_%%d.png', [])]

    def real_run_ffmpeg(self, input_path_opts, output_path_opts, *, expected_retcodes=(0,)):
        self.check_version()
    
        oldest_mtime = min(
            os.stat(encodeFilename(path)).st_mtime for path, _ in input_path_opts if path)
    
        cmd = [encodeFilename(self.executable, True), encodeArgument('-y')]
        # avconv does not have repeat option
        if self.basename == 'ffmpeg':
            cmd += [encodeArgument('-loglevel'), encodeArgument('repeat+info')]
    
        def make_args(file, args, name, number):
            keys = ['_%s%d' % (name, number), '_%s' % name]
            if name == 'o':
                args += ['-movflags', '+faststart']
                if number == 1:
                    keys.append('')
            args += self._configuration_args(self.basename, keys)
            if name == 'i':
                args.append('-i')
            return (
                [encodeArgument(arg) for arg in args]
                + [encodeFilename(self._ffmpeg_filename_argument(file), True)])
    
        for arg_type, path_opts in (('i', input_path_opts), ('o', output_path_opts)):
            cmd += itertools.chain.from_iterable(
                make_args(path, list(opts), arg_type, i + 1)
                for i, (path, opts) in enumerate(path_opts) if path)
    
        self.write_debug('ffmpeg command line: %s' % shell_quote(cmd))
        _, stderr, returncode = Popen.run(
            cmd, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
        if returncode not in variadic(expected_retcodes):
            self.write_debug(stderr)
>           raise FFmpegPostProcessorError(stderr.strip().splitlines()[-1])
E           yt_dlp.postprocessor.ffmpeg.FFmpegPostProcessorError: Conversion failed!

yt_dlp/postprocessor/ffmpeg.py:361: FFmpegPostProcessorError

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

Issue with self-test, preventing further installation of yt-dlp. As such, output of yt-dlp commands will be associated with last version that managed to build, instead of the one creating the issues.
@mauricioquintela mauricioquintela added bug Bug that is not site-specific triage Untriaged issue labels Aug 23, 2022
@Lesmiscore
Copy link
Contributor

My environment is able to pass this test

$ pytest test/test_postprocessors.py -k test_escaping
========================================= test session starts ==========================================
platform linux -- Python 3.9.13, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /home/linuxbrew/.linuxbrew/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /home/lesmi/yt-dlp, configfile: setup.cfg
plugins: parallel-0.1.0, timeout-1.4.2
collected 55 items / 54 deselected / 1 selected                                                        

test/test_postprocessors.py::TestConvertThumbnail::test_escaping PASSED                          [100%]

=================================== 1 passed, 54 deselected in 0.76s ===================================

Probably ffmpeg in your environment can't handle webp files, since yt-dlp uses ffmpeg to convert thumbnails

@pukkandan
Copy link
Member

Same issue as #4604

@pukkandan pukkandan closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2022
@pukkandan pukkandan added duplicate This issue or pull request already exists and removed triage Untriaged issue labels Aug 23, 2022
@pukkandan
Copy link
Member

Issue with self-test, preventing further installation of yt-dlp.

You will need to talk to the package maintainer about skipping the test during installation if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that is not site-specific duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants