def run_tests(self, ydl_bin, tmpl):
        """Run the main test.

        Args:
            ydl_bin (str): Name of the youtube-dl binary
            tmpl (str): Youtube-dl output template

        """
        utils.YOUTUBEDL_BIN = ydl_bin
        self.options[1] = tmpl  # Plug the template in our options

        result = self.result.format(ydl_bin=ydl_bin, tmpl=tmpl)

        self.assertEqual(utils.build_command(self.options, self.url), result)
    def run_tests(self, ydl_bin, tmpl):
        """Run the main test.

        Args:
            ydl_bin (str): Name of the youtube-dl binary
            tmpl (str): Youtube-dl output template

        """
        utils.YOUTUBEDL_BIN = ydl_bin
        self.options[1] = tmpl  # Plug the template in our options

        result = self.result.format(ydl_bin=ydl_bin, tmpl=tmpl)

        self.assertEqual(utils.build_command(self.options, self.url), result)
Exemple #3
0
    def test_build_command_windows(self):
        result = "youtube-dl.exe -o \"C:\\downloads\\%(upload_date)s\\%(id)" \
        "s_%(playlist_id)s - %(format)s.%(ext)s\" -f mp4 --ignore-config " \
        "\"https://www.youtube.com/watch?v=aaaaaaaaaaa&list=AAAAAAAAAAA\""

        options = [
            "-o",
            "C:\\downloads\\%(upload_date)s\\%(id)s_%(playlist_id)s - %(format)s.%(ext)s",
            "-f", "mp4", "--ignore-config"
        ]

        url = "https://www.youtube.com/watch?v=aaaaaaaaaaa&list=AAAAAAAAAAA"

        utils.YOUTUBEDL_BIN = "youtube-dl.exe"

        self.assertEqual(utils.build_command(options, url), result)