Compare commits

..

3 Commits

Author SHA1 Message Date
Lev Plyusnin
482a971bc2
Fix linting 2024-01-08 21:29:26 +07:00
Lev Plyusnin
4bfd8ed511
Update README to reflect changes in FFMpegMetadataPP 2024-01-08 21:16:28 +07:00
Lev Plyusnin
84c89c3c7b
Better backward compatibility 2024-01-08 21:06:40 +07:00
3 changed files with 13 additions and 10 deletions

View File

@ -1762,11 +1762,11 @@ Metadata fields | From
`description`, `synopsis` | `description`
`purl`, `comment` | `webpage_url`
`track` | `track_number`
`artist` | `artists`, `creator`, `uploader` or `uploader_id`
`composer` | `composers`
`genre` | `genres`
`artist` | `artist`, `creator`, `uploader` or `uploader_id`
`composer` | `composer`
`genre` | `genre`
`album` | `album`
`album_artist` | `album_artists`
`album_artist` | `album_artist`
`disc` | `disc_number`
`show` | `series`
`season_number` | `season_number`

View File

@ -24,6 +24,7 @@ import traceback
import unicodedata
from .cache import Cache
from .compat import functools, urllib # isort: split
from .compat import compat_os_name, compat_shlex_quote, urllib_req_to_req
from .cookies import LenientSimpleCookie, load_cookies
@ -2648,8 +2649,10 @@ class YoutubeDL:
'genre': 'genres',
}
for deprecated_field, new_field in deprecated_multivalue_fields.items():
if info_dict.get(deprecated_field):
info_dict[new_field] = re.split(r', ?', info_dict[deprecated_field])
if deprecated_value := info_dict.get(deprecated_field):
info_dict[new_field] = re.split(r', ?', deprecated_value)
elif new_value := info_dict.get(new_field):
info_dict[deprecated_field] = new_value.join(', ')
def _raise_pending_errors(self, info):
err = info.pop('__pending_error', None)

View File

@ -755,11 +755,11 @@ class FFmpegMetadataPP(FFmpegPostProcessor):
add(('description', 'synopsis'), 'description')
add(('purl', 'comment'), 'webpage_url')
add('track', 'track_number')
add('artist', ('artists', 'creator', 'uploader', 'uploader_id'))
add('composer', 'composers')
add('genre', 'genres')
add('artist', ('artist', 'creator', 'uploader', 'uploader_id'))
add('composer', 'composer')
add('genre', 'genre')
add('album')
add('album_artist', 'album_artists')
add('album_artist', 'album_artist')
add('disc', 'disc_number')
add('show', 'series')
add('season_number')