1 from .common
import InfoExtractor
2 from ..utils
import traverse_obj
5 class QingTingIE(InfoExtractor
):
6 _VALID_URL
= r
'https?://(?:www\.|m\.)?(?:qingting\.fm|qtfm\.cn)/v?channels/(?P<channel>\d+)/programs/(?P<id>\d+)'
8 'url': 'https://www.qingting.fm/channels/378005/programs/22257411/',
9 'md5': '47e6a94f4e621ed832c316fd1888fb3c',
12 'title': '用了十年才修改,谁在乎教科书?',
13 'channel_id': '378005',
19 'url': 'https://m.qtfm.cn/vchannels/378005/programs/23023573/',
20 'md5': '2703120b6abe63b5fa90b975a58f4c0e',
23 'title': '【睡前消息488】重庆山火之后,有图≠真相',
24 'channel_id': '378005',
31 def _real_extract(self
, url
):
32 channel_id
, pid
= self
._match
_valid
_url
(url
).group('channel', 'id')
33 webpage
= self
._download
_webpage
(
34 f
'https://m.qtfm.cn/vchannels/{channel_id}/programs/{pid}/', pid
)
35 info
= self
._search
_json
(r
'window\.__initStores\s*=', webpage
, 'program info', pid
)
38 'title': traverse_obj(info
, ('ProgramStore', 'programInfo', 'title')),
39 'channel_id': channel_id
,
40 'channel': traverse_obj(info
, ('ProgramStore', 'channelInfo', 'title')),
41 'uploader': traverse_obj(info
, ('ProgramStore', 'podcasterInfo', 'podcaster', 'nickname')),
42 'url': traverse_obj(info
, ('ProgramStore', 'programInfo', 'audioUrl')),