Repository: yt-dlp/yt-dlp
Issue category: Feature Request

Issue:
[soundcloud] How to fetch "artist" field
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm asking a question and **not** reporting a bug or requesting a feature
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar questions **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)

### Please make sure the question is worded well enough to be understood

## Description

Unfortunately, I cannot find the `artist` field in the JSON file downloaded from a SoundCloud song.

Recently, SoundCloud changed the way track artists are displayed, meaning that `uploader` no longer equals `artist`, and the `uploader` now has the freedom to define other track artists.

## Example

Consider the following sample song: https://soundcloud.com/i-am-aika/nefarious

When we view the site source: `view-source:https://soundcloud.com/i-am-aika/nefarious`, it has the field: `"artist":"I-YU, WarHawk, XYKI"`, but I cannot find it in the downloaded JSON:

[NA - NEFARIOUS.info.json](https://github.com/user-attachments/files/17535228/NA.-.NEFARIOUS.info.json)

If I run such a command:

```bash
yt-dlp --add-metadata --embed-thumbnail -o "%(uploader)s - %(title)s.%(ext)s" https://soundcloud.com/i-am-aika/nefarious
```

It downloads a file named `AIKA 🌸 - NEFARIOUS.opus` containing the following metadata:

- Artist: `AIKA 🌸`
- Title: `NEFARIOUS`

## Question

How can I download this song so that it will be named `I-YU, WarHawk, XYKI.opus` and contain this metadata:

- Artist: `I-YU, WarHawk, XYKI`
- Title: `NEFARIOUS`

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['--add-metadata', '--write-info-json', '-vU', 'https://soundcloud.com/i-am-aika/nefarious']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.10.07 from yt-dlp/yt-dlp [1a176d874] (pip)
[debug] Python 3.12.7 (CPython AMD64 64bit) - Windows-11-10.0.26100-SP0 (OpenSSL 3.3.2 3 Sep 2024)
[debug] exe versions: ffmpeg 7.1-essentials_build-www.gyan.dev (setts), ffprobe 7.1-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.17, brotli-1.1.0, certifi-2024.08.30, mutagen-1.47.0, requests-2.32.3, urllib3-2.2.3, websockets-13.1
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1838 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
[debug] Downloading _update_spec from https://github.com/yt-dlp/yt-dlp/releases/latest/download/_update_spec
Current version: stable@2024.10.07 from yt-dlp/yt-dlp
Latest version: stable@2024.10.22 from yt-dlp/yt-dlp
ERROR: You installed yt-dlp with pip or using the wheel from PyPi; Use that to update
[debug] Loading soundcloud.client_id from cache
[soundcloud] Extracting URL: https://soundcloud.com/i-am-aika/nefarious
[soundcloud] i-am-aika/nefarious: Downloading info JSON
[soundcloud] 1942739463: Downloading hls_mp3 format info JSON
[soundcloud] 1942739463: Downloading http_mp3 format info JSON
[soundcloud] 1942739463: Downloading hls_opus format info JSON
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 1942739463: Downloading 1 format(s): hls_opus_64
[info] Writing video metadata as JSON to: NEFARIOUS [1942739463].info.json
[debug] Invoking hlsnative downloader on "https://cf-hls-opus-media.sndcdn.com/playlist/2da69c87-6019-445e-ab26-7e8826854a86.64.opus/playlist.m3u8?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiKjovL2NmLWhscy1vcHVzLW1lZGlhLnNuZGNkbi5jb20vcGxheWxpc3QvMmRhNjljODctNjAxOS00NDVlLWFiMjYtN2U4ODI2ODU0YTg2LjY0Lm9wdXMvcGxheWxpc3QubTN1OCoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE3MzAwNTg0MDd9fX1dfQ__&Signature=NALMbi-j7lqBwd4GEksrMTL2zldLWqChd8wVDgw36FpO3~guaqWn70rEFnn5-5H~o3gJje2g45YTO4f7MB04-nXn1Fvt6x7sn9kfPakQR9aZvVecHz42H5k~BOu0C1APf8aL9GLps7Ph0g~DdRFjgKTLXFZS8jddh9ka2SswiMS5XBpPzvWUe8qBrUZ5xTKOnzfDzl4PcExDFkY9VU7AqZ3NRhB1zLa131gQAVV8H7FL-gujeOPc~rR5Uj9fd9PFZ~uZCMGiV0lzt7C66FV2x6ZeVUBjUtnTMjZu1wg2H1lJK~A6vRHxarlhHjPb3X671k62O~nQVY1cmpfuJQ~K3Q__&Key-Pair-Id=APKAI6TU7MMXM5DG6EPQ"
[download] NEFARIOUS [1942739463].opus has already been downloaded
[download] 100% of    1.61MiB
[Metadata] Adding metadata to "NEFARIOUS [1942739463].opus"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i "file:NEFARIOUS [1942739463].opus" -map 0 -dn -ignore_unknown -c copy -write_id3v1 1 -metadata "title=NEFARIOUS" -metadata "date=20241026" -metadata "description=Track 6 of APEXA's Debut Compilation Album" -metadata "synopsis=Track 6 of APEXA's Debut Compilation Album" -metadata "purl=https://soundcloud.com/i-am-aika/nefarious" -metadata "comment=https://soundcloud.com/i-am-aika/nefarious" -metadata "artist=AIKA 🌸" -metadata "genre=Dance & EDM" -movflags +faststart "file:NEFARIOUS [1942739463].temp.opus"
```



Hints:

Patch:
diff --git a/yt_dlp/extractor/soundcloud.py b/yt_dlp/extractor/soundcloud.py
index 4f8d96407d0a..f4beab75b7df 100644
--- a/yt_dlp/extractor/soundcloud.py
+++ b/yt_dlp/extractor/soundcloud.py
@@ -208,7 +208,6 @@ def sign(self, user, pw, clid):
 
     def _extract_info_dict(self, info, full_title=None, secret_token=None, extract_flat=False):
         track_id = str(info['id'])
-        title = info['title']
 
         format_urls = set()
         formats = []
@@ -367,7 +366,7 @@ def extract_count(key):
             'uploader_id': str_or_none(user.get('id')) or user.get('permalink'),
             'uploader_url': user.get('permalink_url'),
             'timestamp': unified_timestamp(info.get('created_at')),
-            'title': title,
+            'title': info.get('title'),
             'description': info.get('description'),
             'thumbnails': thumbnails,
             'duration': float_or_none(info.get('duration'), 1000),
@@ -377,7 +376,8 @@ def extract_count(key):
             'like_count': extract_count('favoritings') or extract_count('likes'),
             'comment_count': extract_count('comment'),
             'repost_count': extract_count('reposts'),
-            'genres': traverse_obj(info, ('genre', {str}, {lambda x: x or None}, all)),
+            'genres': traverse_obj(info, ('genre', {str}, filter, all, filter)),
+            'artists': traverse_obj(info, ('publisher_metadata', 'artist', {str}, filter, all, filter)),
             'formats': formats if not extract_flat else None,
         }
 
@@ -429,7 +429,6 @@ class SoundcloudIE(SoundcloudBaseIE):
                 'repost_count': int,
                 'thumbnail': 'https://i1.sndcdn.com/artworks-000031955188-rwb18x-original.jpg',
                 'uploader_url': 'https://soundcloud.com/ethmusic',
-                'genres': [],
             },
         },
         # geo-restricted
@@ -453,6 +452,7 @@ class SoundcloudIE(SoundcloudBaseIE):
                 'uploader_url': 'https://soundcloud.com/the-concept-band',
                 'thumbnail': 'https://i1.sndcdn.com/artworks-v8bFHhXm7Au6-0-original.jpg',
                 'genres': ['Alternative'],
+                'artists': ['The Royal Concept'],
             },
         },
         # private link
@@ -525,6 +525,7 @@ class SoundcloudIE(SoundcloudBaseIE):
                 'repost_count': int,
                 'view_count': int,
                 'genres': ['Dance & EDM'],
+                'artists': ['80M'],
             },
         },
         # private link, downloadable format
@@ -549,6 +550,7 @@ class SoundcloudIE(SoundcloudBaseIE):
                 'thumbnail': 'https://i1.sndcdn.com/artworks-000240712245-kedn4p-original.jpg',
                 'uploader_url': 'https://soundcloud.com/oriuplift',
                 'genres': ['Trance'],
+                'artists': ['Ori Uplift'],
             },
         },
         # no album art, use avatar pic for thumbnail
@@ -572,7 +574,7 @@ class SoundcloudIE(SoundcloudBaseIE):
                 'comment_count': int,
                 'repost_count': int,
                 'uploader_url': 'https://soundcloud.com/garyvee',
-                'genres': [],
+                'artists': ['MadReal'],
             },
             'params': {
                 'skip_download': True,


Test patch: