Compare commits

..

5 Commits

Author SHA1 Message Date
pukkandan
9e76a7ecbc
typo 2024-01-12 06:44:28 +05:30
pukkandan
916acca08f
Add creators
Ref: https://github.com/yt-dlp/yt-dlp/pull/8906#r1440046129
2024-01-12 06:32:53 +05:30
pukkandan
b81745716e
Cleanup 2024-01-12 06:26:30 +05:30
pukkandan
afccd2d730
We weren't able to deprecate 2024-01-12 06:07:39 +05:30
pukkandan
5bed30d642
Future-proof 2024-01-12 06:07:05 +05:30
4 changed files with 37 additions and 28 deletions

View File

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

View File

@ -24,7 +24,6 @@ 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
@ -2642,17 +2641,18 @@ class YoutubeDL:
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])
deprecated_multivalue_fields = {
multivalue_fields = {
'album_artist': 'album_artists',
'artist': 'artists',
'composer': 'composers',
'album_artist': 'album_artists',
'creator': 'creators',
'genre': 'genres',
}
for deprecated_field, new_field in deprecated_multivalue_fields.items():
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(', ')
for old_key, new_key in multivalue_fields.items():
if old_value := info_dict.get(old_key):
info_dict[new_key] = re.split(r', ?', old_value)
elif new_value := info_dict.get(new_key):
info_dict[old_key] = ', '.join(new_value)
def _raise_pending_errors(self, info):
err = info.pop('__pending_error', None)

View File

@ -278,7 +278,7 @@ class InfoExtractor:
description: Full video description.
uploader: Full name of the video uploader.
license: License name the video is licensed under.
creator: The creator of the video.
creators: List of creators of the video.
timestamp: UNIX timestamp of the moment the video was uploaded
upload_date: Video upload date in UTC (YYYYMMDD).
If not explicitly set, calculated from timestamp
@ -432,14 +432,6 @@ class InfoExtractor:
Useful for splits and compilations.
disc_number: Number of the disc or other physical medium the track belongs to,
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:
@ -450,6 +442,18 @@ class InfoExtractor:
rows: Number of rows 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, None is equivalent to absence of information.

View File

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