]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/prankcast.py
1 from .common
import InfoExtractor
2 from ..utils
import parse_iso8601
, traverse_obj
, try_call
5 class PrankCastIE(InfoExtractor
):
6 _VALID_URL
= r
'https?://(?:www\.)?prankcast\.com/[^/?#]+/showreel/(?P<id>\d+)-(?P<display_id>[^/?#]+)'
8 'url': 'https://prankcast.com/Devonanustart/showreel/1561-Beverly-is-back-like-a-heart-attack-',
12 'title': 'Beverly is back like a heart attack!',
13 'display_id': 'Beverly-is-back-like-a-heart-attack-',
14 'timestamp': 1661391575,
15 'uploader': 'Devonanustart',
18 'cast': ['Devonanustart', 'Phonelosers'],
20 'categories': ['prank'],
21 'tags': ['prank call', 'prank', 'live show'],
22 'upload_date': '20220825'
25 'url': 'https://prankcast.com/phonelosers/showreel/2048-NOT-COOL',
30 'display_id': 'NOT-COOL',
31 'timestamp': 1665028364,
32 'uploader': 'phonelosers',
35 'cast': ['phonelosers'],
37 'categories': ['prank'],
38 'tags': ['prank call', 'prank', 'live show'],
39 'upload_date': '20221006'
43 def _real_extract(self
, url
):
44 video_id
, display_id
= self
._match
_valid
_url
(url
).group('id', 'display_id')
46 webpage
= self
._download
_webpage
(url
, video_id
)
47 json_info
= self
._search
_nextjs
_data
(webpage
, video_id
)['props']['pageProps']['ssr_data_showreel']
49 uploader
= json_info
.get('user_name')
50 guests_json
= self
._parse
_json
(json_info
.get('guests_json') or '{}', video_id
)
51 start_date
= parse_iso8601(json_info
.get('start_date'))
55 'title': json_info
.get('broadcast_title') or self
._og
_search
_title
(webpage
),
56 'display_id': display_id
,
57 'url': f
'{json_info["broadcast_url"]}{json_info["recording_hash"]}.mp3',
58 'timestamp': start_date
,
60 'channel_id': json_info
.get('user_id'),
61 'duration': try_call(lambda: parse_iso8601(json_info
['end_date']) - start_date
),
62 'cast': list(filter(None, [uploader
] + traverse_obj(guests_json
, (..., 'name')))),
63 'description': json_info
.get('broadcast_description'),
64 'categories': [json_info
.get('broadcast_category')],
65 'tags': try_call(lambda: json_info
['broadcast_tags'].split(','))