Repository: yt-dlp/yt-dlp

Issue:
get artist metadata from Jamendo
### Checklist

- [X] I'm asking a question and **not** reporting a bug/feature request
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar questions including closed ones

### Question

Hi guys, how can I save the "artist" name in the metadata when I download from Jamendo? i use this

yt-dlp --embed-metadata --embed-thumbnail -o "%(title)s.%(ext)s" *url*

All working fine, picture cover and other metadata, but artist name is not save, how can I fix it?

### Verbose log

_No response_


Discussion:
@zakiloki0 Pls show the verbose log and url as well
> @zakiloki0 Pls show the verbose log and url as well

yt-dlp --embed-metadata --embed-thumbnail -o "%(title)s.%(ext)s" --verbose https://www.jamendo.com/track/1901140/under-water
[debug] Command-line config: ['--embed-metadata', '--embed-thumbnail', '-o', '%(title)s.%(ext)s', '--verbose', 'https://www.jamendo.com/track/1901140/under-water']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, err utf-8, pref UTF-8
[debug] yt-dlp version 2022.03.08.1 [c0c2c57d3]
[debug] Python version 3.10.4 (CPython 64bit) - Linux-5.17.1-arch1-1-x86_64-with-glibc2.35
[debug] exe versions: ffmpeg 5.0 (setts), ffprobe 5.0
[debug] Optional libraries: brotlicffi, Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] [Jamendo] Extracting URL: https://www.jamendo.com/track/1901140/under-water
[Jamendo] 1901140: Downloading JSON metadata
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 1901140: Downloading 1 format(s): flac
[info] Downloading video thumbnail size100 ...
[info] Writing video thumbnail size100 to: Under Water.com
[debug] Invoking downloader on "https://flac.jamendo.com/?trackid=1901140&format=flac&from=app-97dab294"
[download] Destination: Under Water.flac
[download] 100% of 24.84MiB in 00:03
[Metadata] Adding metadata to "Under Water.flac"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Under Water.flac' -map 0 -dn -ignore_unknown -c copy -metadata 'title=Under Water' -metadata date=20211119 -metadata 'description=Simple but meaningful: &quot;You can'"'"'t run under water&quot;... It'"'"'s all about life and love with all the obstacles, but also about getting stronger.' -metadata 'synopsis=Simple but meaningful: &quot;You can'"'"'t run under water&quot;... It'"'"'s all about life and love with all the obstacles, but also about getting stronger.' -metadata purl=https://www.jamendo.com/track/1901140/under-water -metadata comment=https://www.jamendo.com/track/1901140/under-water -movflags +faststart 'file:Under Water.temp.flac'
[ThumbnailsConvertor] Converting thumbnail "Under Water.com" to png
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -f image2 -pattern_type none -i 'file:Under Water.com' -movflags +faststart 'file:Under Water.png'
[EmbedThumbnail] mutagen: Adding thumbnail to "Under Water.flac"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Under Water.png'
Deleting original file Under Water.com (pass -k to keep)
Deleting original file Under Water.png (pass -k to keep)

The Jamedo extractor currently does not extract artist metadata
> The Jamedo extractor currently does not extract artist metadata

There is no way to fix it then?

Resolving patch:
diff --git a/yt_dlp/extractor/jamendo.py b/yt_dlp/extractor/jamendo.py
--- a/yt_dlp/extractor/jamendo.py
+++ b/yt_dlp/extractor/jamendo.py
@@ -28,10 +28,11 @@ class JamendoIE(InfoExtractor):
             'ext': 'flac',
             # 'title': 'Maya Filipič - Stories from Emona I',
             'title': 'Stories from Emona I',
-            # 'artist': 'Maya Filipič',
+            'artist': 'Maya Filipič',
+            'album': 'Between two worlds',
             'track': 'Stories from Emona I',
             'duration': 210,
-            'thumbnail': r're:^https?://.*\.jpg',
+            'thumbnail': 'https://usercontent.jamendo.com?type=album&id=29279&width=300&trackid=196219',
             'timestamp': 1217438117,
             'upload_date': '20080730',
             'license': 'by-nc-nd',
@@ -45,11 +46,11 @@ class JamendoIE(InfoExtractor):
         'only_matching': True,
     }]
 
-    def _call_api(self, resource, resource_id):
+    def _call_api(self, resource, resource_id, fatal=True):
         path = '/api/%ss' % resource
         rand = compat_str(random.random())
         return self._download_json(
-            'https://www.jamendo.com' + path, resource_id, query={
+            'https://www.jamendo.com' + path, resource_id, fatal=fatal, query={
                 'id[]': resource_id,
             }, headers={
                 'X-Jam-Call': '$%s*%s~' % (hashlib.sha1((path + rand).encode()).hexdigest(), rand)
@@ -71,6 +72,8 @@ def _real_extract(self, url):
         # if artist_name:
         #     title = '%s - %s' % (artist_name, title)
         # album = get_model('album')
+        artist = self._call_api("artist", track.get('artistId'), fatal=False)
+        album = self._call_api("album", track.get('albumId'), fatal=False)
 
         formats = [{
             'url': 'https://%s.jamendo.com/?trackid=%s&format=%s&from=app-97dab294'
@@ -118,9 +121,9 @@ def _real_extract(self, url):
             'title': title,
             'description': track.get('description'),
             'duration': int_or_none(track.get('duration')),
-            # 'artist': artist_name,
+            'artist': artist.get('name'),
             'track': track_name,
-            # 'album': album.get('name'),
+            'album': album.get('name'),
             'formats': formats,
             'license': '-'.join(license) if license else None,
             'timestamp': int_or_none(track.get('dateCreated')),
@@ -145,22 +148,38 @@ class JamendoAlbumIE(JamendoIE):
             'info_dict': {
                 'id': '1032333',
                 'ext': 'flac',
-                'title': 'Shearer - Warmachine',
+                'title': 'Warmachine',
                 'artist': 'Shearer',
                 'track': 'Warmachine',
                 'timestamp': 1368089771,
                 'upload_date': '20130509',
+                'view_count': int,
+                'thumbnail': 'https://usercontent.jamendo.com?type=album&id=121486&width=300&trackid=1032333',
+                'duration': 190,
+                'license': 'by',
+                'album': 'Duck On Cover',
+                'average_rating': 4,
+                'tags': ['rock', 'drums', 'bass', 'world', 'punk', 'neutral'],
+                'like_count': int,
             }
         }, {
             'md5': '1f358d7b2f98edfe90fd55dac0799d50',
             'info_dict': {
                 'id': '1032330',
                 'ext': 'flac',
-                'title': 'Shearer - Without Your Ghost',
+                'title': 'Without Your Ghost',
                 'artist': 'Shearer',
                 'track': 'Without Your Ghost',
                 'timestamp': 1368089771,
                 'upload_date': '20130509',
+                'duration': 192,
+                'tags': ['rock', 'drums', 'bass', 'world', 'punk'],
+                'album': 'Duck On Cover',
+                'thumbnail': 'https://usercontent.jamendo.com?type=album&id=121486&width=300&trackid=1032330',
+                'view_count': int,
+                'average_rating': 4,
+                'license': 'by',
+                'like_count': int,
             }
         }],
         'params': {


Test patch: