Repository: yt-dlp/yt-dlp

Issue:
[ximalaya] Improve handling for album link types
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

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

### Checklist

- [X] I'm requesting a site-specific feature
- [X] I've verified that I'm running yt-dlp version **2023.01.06** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **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)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

Anywhere

### Example URLs

Test link:
https://www.ximalaya.com/album/6912905


### Provide a description that is worded well enough to be understood

Looks like Ximalaya playlist links formatting has slightly changed now and are missing "id" section before /album/ 
Old stile links looked like this: https://www.ximalaya.com/61425525/album/6912905

As a result extractor sends new link format handling to general extractor instead of XimalayaAlbumIE

I assume line 126 in ximalaya.py needs to be improved 
    _VALID_URL = r'https?://(?:www\.|m\.)?ximalaya\.com/\d+/album/(?P<id>[0-9]+)'

The rest of the extractor and individual tracks are working just fine.

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
./yt-dlp -vU -F "https://www.ximalaya.com/album/6912905"
[debug] Command-line config: ['-vU', '-F', 'https://www.ximalaya.com/album/6912905']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.01.06 [6becd2508] (zip)
[debug] Python 3.10.9 (CPython arm64 64bit) - macOS-12.6.2-arm64-arm-64bit (OpenSSL 1.1.1s  1 Nov 2022)
[debug] exe versions: phantomjs 2.1.1
[debug] Optional libraries: sqlite3-2.6.0
[debug] Proxy map: {}
[debug] Extractor Plugins: SamplePluginIE
[debug] Post-Processor Plugins: SamplePluginPP
[debug] Loaded 1819 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.01.06, Current version: 2023.01.06
yt-dlp is up to date (2023.01.06)
[generic] Extracting URL: https://www.ximalaya.com/album/6912905
[generic] 6912905: Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] 6912905: Extracting information
[debug] Looking for embeds
ERROR: Unsupported URL: https://www.ximalaya.com/album/6912905
Traceback (most recent call last):
  File "./yt-dlp/yt_dlp/YoutubeDL.py", line 1502, in wrapper
    return func(self, *args, **kwargs)
  File "./yt-dlp/yt_dlp/YoutubeDL.py", line 1578, in __extract_info
    ie_result = ie.extract(url)
  File "./yt-dlp/yt_dlp/extractor/common.py", line 682, in extract
    ie_result = self._real_extract(url)
  File "./yt-dlp/yt_dlp/extractor/generic.py", line 2523, in _real_extract
    raise UnsupportedError(url)
yt_dlp.utils.UnsupportedError: Unsupported URL: https://www.ximalaya.com/album/6912905
```



Discussion:
> I assume line 126 in ximalaya.py needs to be improved

Yeah, with this minor change everything seems to work fine:
```diff
diff --git a/yt_dlp/extractor/ximalaya.py b/yt_dlp/extractor/ximalaya.py
index b25be772e..5224b7607 100644
--- a/yt_dlp/extractor/ximalaya.py
+++ b/yt_dlp/extractor/ximalaya.py
@@ -123,7 +123,7 @@ def _real_extract(self, url):
 class XimalayaAlbumIE(XimalayaBaseIE):
     IE_NAME = 'ximalaya:album'
     IE_DESC = '喜马拉雅FM 专辑'
-    _VALID_URL = r'https?://(?:www\.|m\.)?ximalaya\.com/\d+/album/(?P<id>[0-9]+)'
+    _VALID_URL = r'https?://(?:www\.|m\.)?ximalaya\.com/(?:\d+/)?album/(?P<id>[0-9]+)'
     _TESTS = [{
         'url': 'http://www.ximalaya.com/61425525/album/5534601/',
         'info_dict': {
```

Resolving patch:
diff --git a/yt_dlp/extractor/ximalaya.py b/yt_dlp/extractor/ximalaya.py
--- a/yt_dlp/extractor/ximalaya.py
+++ b/yt_dlp/extractor/ximalaya.py
@@ -36,7 +36,7 @@ class XimalayaIE(XimalayaBaseIE):
                         'height': 180
                     }
                 ],
-                'categories': ['人文'],
+                'categories': ['其他'],
                 'duration': 93,
                 'view_count': int,
                 'like_count': int,
@@ -123,7 +123,7 @@ def _real_extract(self, url):
 class XimalayaAlbumIE(XimalayaBaseIE):
     IE_NAME = 'ximalaya:album'
     IE_DESC = '喜马拉雅FM 专辑'
-    _VALID_URL = r'https?://(?:www\.|m\.)?ximalaya\.com/\d+/album/(?P<id>[0-9]+)'
+    _VALID_URL = r'https?://(?:www\.|m\.)?ximalaya\.com/(?:\d+/)?album/(?P<id>[0-9]+)'
     _TESTS = [{
         'url': 'http://www.ximalaya.com/61425525/album/5534601/',
         'info_dict': {
@@ -131,6 +131,13 @@ class XimalayaAlbumIE(XimalayaBaseIE):
             'id': '5534601',
         },
         'playlist_mincount': 323,
+    }, {
+        'url': 'https://www.ximalaya.com/album/6912905',
+        'info_dict': {
+            'title': '埃克哈特《修炼当下的力量》',
+            'id': '6912905',
+        },
+        'playlist_mincount': 41,
     }]
 
     def _real_extract(self, url):


Test patch: