1 from .common
import InfoExtractor
2 from .youtube
import YoutubeIE
3 from ..utils
import traverse_obj
6 class DiscogsReleasePlaylistIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://(?:www\.)?discogs\.com/(?P<type>release|master)/(?P<id>\d+)'
9 'url': 'https://www.discogs.com/release/1-The-Persuader-Stockholm',
14 'playlist_mincount': 7,
16 'url': 'https://www.discogs.com/master/113-Vince-Watson-Moments-In-Time',
19 'title': 'Moments In Time',
21 'playlist_mincount': 53,
24 def _real_extract(self
, url
):
25 playlist_id
, playlist_type
= self
._match
_valid
_url
(url
).group('id', 'type')
27 display_id
= f
'{playlist_type}{playlist_id}'
28 response
= self
._download
_json
(
29 f
'https://api.discogs.com/{playlist_type}s/{playlist_id}', display_id
)
32 self
.url_result(video
['uri'], YoutubeIE
, video_title
=video
.get('title'))
33 for video
in traverse_obj(response
, ('videos', lambda _
, v
: YoutubeIE
.suitable(v
['uri'])))]
35 return self
.playlist_result(entries
, display_id
, response
.get('title'))