1 from .common
import InfoExtractor
9 from ..utils
.traversal
import traverse_obj
12 class GodResourceIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://new\.godresource\.com/video/(?P<id>\w+)'
16 'url': 'https://new.godresource.com/video/A01mTKjyf6w',
21 'timestamp': 1710978666,
23 'thumbnail': 'https://cdn-02.godresource.com/e42968ac-9e8b-4231-ab86-f4f9d775841f/thumbnail.jpg',
24 'channel': 'Stedfast Baptist Church',
25 'upload_date': '20240320',
26 'title': 'GodResource video #A01mTKjyf6w',
30 'url': 'https://new.godresource.com/video/01DXmBbQv_X',
31 'md5': '0e8f72aa89a106b9d5c011ba6f8717b7',
37 'timestamp': 1687996800,
38 'thumbnail': 'https://cdn-02.godresource.com/sodomitedeception/thumbnail.jpg',
39 'channel': 'Documentaries',
40 'title': 'The Sodomite Deception',
41 'upload_date': '20230629',
45 def _real_extract(self
, url
):
46 display_id
= self
._match
_id
(url
)
48 api_data
= self
._download
_json
(
49 f
'https://api.godresource.com/api/Streams/{display_id}', display_id
)
51 video_url
= api_data
['streamUrl']
52 is_live
= api_data
.get('isLive') or False
53 if (ext
:= determine_ext(video_url
)) == 'm3u8':
54 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(
55 video_url
, display_id
, live
=is_live
)
57 formats
, subtitles
= [{
62 raise ExtractorError(f
'Unexpected video format {ext}')
67 'subtitles': subtitles
,
70 **traverse_obj(api_data
, {
71 'title': ('title', {str}
),
72 'thumbnail': ('thumbnail', {url_or_none}
),
73 'view_count': ('views', {int}
),
74 'channel': ('channelName', {str}
),
75 'channel_id': ('channelId', {str_or_none}
),
76 'timestamp': ('streamDateCreated', {unified_timestamp}
),
77 'modified_timestamp': ('streamDataModified', {unified_timestamp}
),