1 from .common
import InfoExtractor
2 from ..utils
import parse_iso8601
, url_or_none
3 from ..utils
.traversal
import traverse_obj
6 class NTSLiveIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://(?:www\.)?nts\.live/shows/[^/?#]+/episodes/(?P<id>[^/?#]+)'
12 'url': 'https://www.nts.live/shows/yu-su/episodes/yu-su-2nd-april-2024',
13 'md5': 'b5444c04888c869d68758982de1a27d8',
17 'uploader_id': '995579326',
18 'title': 'Pender Street Steppers & YU SU',
19 'timestamp': 1712073600,
20 'upload_date': '20240402',
21 'thumbnail': 'https://i1.sndcdn.com/artworks-qKcNO0z0AQGGbv9s-GljJCw-original.jpg',
22 'license': 'all-rights-reserved',
24 'uploader_url': 'https://soundcloud.com/user-643553014',
25 'uploader': 'NTS Latest',
26 'description': 'md5:cd00ac535a63caaad722483ae3ff802a',
27 'duration': 10784.157,
28 'genres': ['Deep House', 'House', 'Leftfield Disco', 'Jazz Fusion', 'Dream Pop'],
29 'modified_timestamp': 1712564687,
30 'modified_date': '20240408',
35 'url': 'https://www.nts.live/shows/absolute-fiction/episodes/absolute-fiction-23rd-july-2022',
37 'id': 'NTSRadio_absolute-fiction-23rd-july-2022',
40 'title': 'Absolute Fiction',
42 'uploader_url': 'https://www.mixcloud.com/NTSRadio/',
43 'description': 'md5:ba49da971ae8d71ee45813c52c5e2a04',
46 'timestamp': 1658588400,
48 'upload_date': '20220723',
49 'uploader_id': 'NTSRadio',
50 'thumbnail': 'https://thumbnailer.mixcloud.com/unsafe/1024x1024/extaudio/5/1/a/d/ae3e-1be9-4fd4-983e-9c3294226eac',
51 'uploader': 'Mixcloud NTS Radio',
52 'genres': ['Minimal Synth', 'Post Punk', 'Industrial '],
53 'modified_timestamp': 1658842165,
54 'modified_date': '20220726',
56 'params': {'skip_download': 'm3u8'},
60 def _real_extract(self
, url
):
61 video_id
= self
._match
_id
(url
)
62 webpage
= self
._download
_webpage
(url
, video_id
)
64 data
= self
._search
_json
(r
'window\._REACT_STATE_\s*=', webpage
, 'react state', video_id
)
67 '_type': 'url_transparent',
68 **traverse_obj(data
, ('episode', {
69 'url': ('audio_sources', ..., 'url', {url_or_none}
, any
),
70 'title': ('name', {str}
),
71 'description': ('description', {str}
),
72 'genres': ('genres', ..., 'value', {str}
),
73 'timestamp': ('broadcast', {parse_iso8601}
),
74 'modified_timestamp': ('updated', {parse_iso8601}
),