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