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 - `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
- `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 - `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
@ -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_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
- `composers` (list): Composer(s) of the piece - `artist` (string): Artist(s) of the track; comma-separated
- `genres` (list): Genre(s) of the track - `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` (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): 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 - `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:
@ -1762,11 +1767,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`, `creator`, `uploader` or `uploader_id` `artist` | `artist`, `artists`, `creator`, `uploader` or `uploader_id`
`composer` | `composer` `composer` | `composer`, `composers`
`genre` | `genre` `genre` | `genre`, `genres`
`album` | `album` `album` | `album`
`album_artist` | `album_artist` `album_artist` | `album_artist`, `album_artists`
`disc` | `disc_number` `disc` | `disc_number`
`show` | `series` `show` | `series`
`season_number` | `season_number` `season_number` | `season_number`

View File

@ -24,7 +24,6 @@ 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
@ -2642,17 +2641,18 @@ 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])
deprecated_multivalue_fields = { multivalue_fields = {
'album_artist': 'album_artists',
'artist': 'artists', 'artist': 'artists',
'composer': 'composers', 'composer': 'composers',
'album_artist': 'album_artists', 'creator': 'creators',
'genre': 'genres', 'genre': 'genres',
} }
for deprecated_field, new_field in deprecated_multivalue_fields.items(): for old_key, new_key in multivalue_fields.items():
if deprecated_value := info_dict.get(deprecated_field): if old_value := info_dict.get(old_key):
info_dict[new_field] = re.split(r', ?', deprecated_value) info_dict[new_key] = re.split(r', ?', old_value)
elif new_value := info_dict.get(new_field): elif new_value := info_dict.get(new_key):
info_dict[deprecated_field] = new_value.join(', ') info_dict[old_key] = ', '.join(new_value)
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.
creator: The creator of the video. creators: List of creators 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,14 +432,6 @@ 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:
@ -450,6 +442,18 @@ 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', 'creator', 'uploader', 'uploader_id')) add('artist', ('artist', 'artists', 'creator', 'creators', 'uploader', 'uploader_id'))
add('composer', 'composer') add('composer', ('composer', 'composers'))
add('genre', 'genre') add('genre', ('genre', 'genres'))
add('album') add('album')
add('album_artist', 'album_artist') add('album_artist', ('album_artist', 'album_artists'))
add('disc', 'disc_number') add('disc', 'disc_number')
add('show', 'series') add('show', 'series')
add('season_number') add('season_number')