]> jfr.im git - yt-dlp.git/blobdiff - test/test_YoutubeDL.py
[outtmpl] Pad `playlist_index` etc even when with internal formatting
[yt-dlp.git] / test / test_YoutubeDL.py
index 05dd3ed4124a51e49e5b14be1e7b3d7b61938e0b..3fbcdd01f3f3d33f8f09baa2118806685d1edc7e 100644 (file)
@@ -630,6 +630,7 @@ def test_add_extra_info(self):
         self.assertEqual(test_dict['playlist'], 'funny videos')
 
     outtmpl_info = {
+        'id': '1234',
         'id': '1234',
         'ext': 'mp4',
         'width': None,
@@ -683,7 +684,7 @@ def test(tmpl, expected, *, info=None, **params):
         test('%(id)s.%(ext)s', '1234.mp4')
         test('%(duration_string)s', ('27:46:40', '27-46-40'))
         test('%(resolution)s', '1080p')
-        test('%(playlist_index)s', '001')
+        test('%(playlist_index|)s', '001')
         test('%(playlist_autonumber)s', '02')
         test('%(autonumber)s', '00001')
         test('%(autonumber+2)03d', '005', autonumber_start=3)
@@ -754,6 +755,7 @@ def expect_same_infodict(out):
         test('%(ext)c', 'm')
         test('%(id)d %(id)r', "1234 '1234'")
         test('%(id)r %(height)r', "'1234' 1080")
+        test('%(title5)a %(height)a', (R"'\xe1\xe9\xed \U0001d400' 1080", None))
         test('%(ext)s-%(ext|def)d', 'mp4-def')
         test('%(width|0)04d', '0')
         test('a%(width|b)d', 'ab', outtmpl_na_placeholder='none')