Compare commits

..

No commits in common. "9e76a7ecbc04a596ccef6b2f8fd9a81bd6da722c" and "482a971bc2decdb72d2f3dea949a82a5baf4219d" have entirely different histories.

4 changed files with 28 additions and 37 deletions

View File

@ -1305,8 +1305,7 @@ The available fields are:
- `display_id` (string): An alternative identifier for the video - `display_id` (string): An alternative identifier for the video
- `uploader` (string): Full name of the video uploader - `uploader` (string): Full name of the video uploader
- `license` (string): License name the video is licensed under - `license` (string): License name the video is licensed under
- `creators` (list): The creators of the video - `creator` (string): The creator of the video
- `creator` (string): The creators of the video; comma-separated
- `timestamp` (numeric): UNIX timestamp of the moment the video became available - `timestamp` (numeric): UNIX timestamp of the moment the video became available
- `upload_date` (string): Video upload date in UTC (YYYYMMDD) - `upload_date` (string): Video upload date in UTC (YYYYMMDD)
- `release_timestamp` (numeric): UNIX timestamp of the moment the video was released - `release_timestamp` (numeric): UNIX timestamp of the moment the video was released
@ -1381,15 +1380,11 @@ Available for the media that is a track or a part of a music album:
- `track_number` (numeric): Number of the track within an album or a disc - `track_number` (numeric): Number of the track within an album or a disc
- `track_id` (string): Id of the track - `track_id` (string): Id of the track
- `artists` (list): Artist(s) of the track - `artists` (list): Artist(s) of the track
- `artist` (string): Artist(s) of the track; comma-separated
- `genres` (list): Genre(s) of the track
- `genre` (string): Genre(s) of the track; comma-separated
- `composers` (list): Composer(s) of the piece - `composers` (list): Composer(s) of the piece
- `composer` (string): Composer(s) of the piece; comma-separated - `genres` (list): Genre(s) of the track
- `album` (string): Title of the album the track belongs to - `album` (string): Title of the album the track belongs to
- `album_type` (string): Type of the album - `album_type` (string): Type of the album
- `album_artists` (list): All artists appeared on the album - `album_artists` (list): List of all artists appeared on the album
- `album_artist` (string): All artists appeared on the album; comma-separated
- `disc_number` (numeric): Number of the disc or other physical medium the track belongs to - `disc_number` (numeric): Number of the disc or other physical medium the track belongs to
Available only when using `--download-sections` and for `chapter:` prefix when using `--split-chapters` for videos with internal chapters: Available only when using `--download-sections` and for `chapter:` prefix when using `--split-chapters` for videos with internal chapters:
@ -1767,11 +1762,11 @@ Metadata fields | From
`description`, `synopsis` | `description` `description`, `synopsis` | `description`
`purl`, `comment` | `webpage_url` `purl`, `comment` | `webpage_url`
`track` | `track_number` `track` | `track_number`
`artist` | `artist`, `artists`, `creator`, `uploader` or `uploader_id` `artist` | `artist`, `creator`, `uploader` or `uploader_id`
`composer` | `composer`, `composers` `composer` | `composer`
`genre` | `genre`, `genres` `genre` | `genre`
`album` | `album` `album` | `album`
`album_artist` | `album_artist`, `album_artists` `album_artist` | `album_artist`
`disc` | `disc_number` `disc` | `disc_number`
`show` | `series` `show` | `series`
`season_number` | `season_number` `season_number` | `season_number`

View File

@ -24,6 +24,7 @@ import traceback
import unicodedata import unicodedata
from .cache import Cache from .cache import Cache
from .compat import functools, urllib # isort: split from .compat import functools, urllib # isort: split
from .compat import compat_os_name, compat_shlex_quote, urllib_req_to_req from .compat import compat_os_name, compat_shlex_quote, urllib_req_to_req
from .cookies import LenientSimpleCookie, load_cookies from .cookies import LenientSimpleCookie, load_cookies
@ -2641,18 +2642,17 @@ class YoutubeDL:
if final and info_dict.get('%s_number' % field) is not None and not info_dict.get(field): if final and info_dict.get('%s_number' % field) is not None and not info_dict.get(field):
info_dict[field] = '%s %d' % (field.capitalize(), info_dict['%s_number' % field]) info_dict[field] = '%s %d' % (field.capitalize(), info_dict['%s_number' % field])
multivalue_fields = { deprecated_multivalue_fields = {
'album_artist': 'album_artists',
'artist': 'artists', 'artist': 'artists',
'composer': 'composers', 'composer': 'composers',
'creator': 'creators', 'album_artist': 'album_artists',
'genre': 'genres', 'genre': 'genres',
} }
for old_key, new_key in multivalue_fields.items(): for deprecated_field, new_field in deprecated_multivalue_fields.items():
if old_value := info_dict.get(old_key): if deprecated_value := info_dict.get(deprecated_field):
info_dict[new_key] = re.split(r', ?', old_value) info_dict[new_field] = re.split(r', ?', deprecated_value)
elif new_value := info_dict.get(new_key): elif new_value := info_dict.get(new_field):
info_dict[old_key] = ', '.join(new_value) info_dict[deprecated_field] = new_value.join(', ')
def _raise_pending_errors(self, info): def _raise_pending_errors(self, info):
err = info.pop('__pending_error', None) err = info.pop('__pending_error', None)

View File

@ -278,7 +278,7 @@ class InfoExtractor:
description: Full video description. description: Full video description.
uploader: Full name of the video uploader. uploader: Full name of the video uploader.
license: License name the video is licensed under. license: License name the video is licensed under.
creators: List of creators of the video. creator: The creator of the video.
timestamp: UNIX timestamp of the moment the video was uploaded timestamp: UNIX timestamp of the moment the video was uploaded
upload_date: Video upload date in UTC (YYYYMMDD). upload_date: Video upload date in UTC (YYYYMMDD).
If not explicitly set, calculated from timestamp If not explicitly set, calculated from timestamp
@ -432,6 +432,14 @@ class InfoExtractor:
Useful for splits and compilations. Useful for splits and compilations.
disc_number: Number of the disc or other physical medium the track belongs to, disc_number: Number of the disc or other physical medium the track belongs to,
as an integer. as an integer.
composer: Deprecated; use "composers" instead.
Composer(s) of the piece, comma-separated.
artist: Deprecated; use "artists" instead.
Artist(s) of the track, comma-separated.
genre: Deprecated; use "genres" instead.
Genre(s) of the track, comma-separated.
album_artist: Deprecated; use "album_artists" instead.
All artists appeared on the album, comma-separated.
The following fields should only be set for clips that should be cut from the original video: The following fields should only be set for clips that should be cut from the original video:
@ -442,18 +450,6 @@ class InfoExtractor:
rows: Number of rows in each storyboard fragment, as an integer rows: Number of rows in each storyboard fragment, as an integer
columns: Number of columns in each storyboard fragment, as an integer columns: Number of columns in each storyboard fragment, as an integer
The following fields are deprecated and should not be set by new code:
composer: Use "composers" instead.
Composer(s) of the piece, comma-separated.
artist: Use "artists" instead.
Artist(s) of the track, comma-separated.
genre: Use "genres" instead.
Genre(s) of the track, comma-separated.
album_artist: Use "album_artists" instead.
All artists appeared on the album, comma-separated.
creator: Use "creators" instead.
The creator of the video.
Unless mentioned otherwise, the fields should be Unicode strings. Unless mentioned otherwise, the fields should be Unicode strings.
Unless mentioned otherwise, None is equivalent to absence of information. Unless mentioned otherwise, None is equivalent to absence of information.

View File

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