Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/prankcast.py (Python)

Code before:
            'timestamp': 1755453505,
            'uploader': 'DrTomServo',
            'channel_id': '136',
            'duration': 19018.392,
            'cast': ['DrTomServo'],
            'description': '',
            'categories': [],
            'upload_date': '20250817',
        },
    }]

    def _real_extract(self, url):
        video_id, display_id = self._match_valid_url(url).group('id', 'display_id')

        webpage = self._download_webpage(url, video_id)
        post = self._search_nextjs_data(webpage, video_id)['props']['pageProps']['ssr_data_posts']
        content = self._parse_json(post['post_contents_json'], video_id)[0]

        return {
            'id': video_id,
            'display_id': display_id,
            'title': self._og_search_title(webpage),
            **traverse_obj(post, {
                'title': ('post_title', {str}),
                'description': ('post_body', {str}),
                'tags': ('post_tags', {lambda x: x.split(',')}, ..., {str.strip}, filter, all, filter),
                'channel_id': ('user_id', {int}, {str_or_none}),
                'uploader': ('user_name', {str}),
            }),
            **traverse_obj(content, {
                'url': (('secure_url', 'url'), {url_or_none}, any),
                'timestamp': (
                    ((('start_date', 'crdate'), {parse_iso8601(delimiter=' ')}),
                     ('created_at', {parse_iso8601})), {int}, any),
                'duration': ('duration', {float_or_none}),
                'categories': ('category', {str}, all),
                'cast': ((
                    {value(post.get('user_name'))},
                    ('guests_json', {json.loads}, ..., 'name'),
                ), {str}, filter, all),
            }),
        }


Review comment (suggestion):
```suggestion
                'tags': ('post_tags', {lambda x: x.split(',')}, ..., {str.strip}, filter),
```

Code after:
            'channel_id': '136',
            'duration': 19018.392,
            'cast': ['DrTomServo'],
            'description': '',
            'upload_date': '20250817',
        },
    }]

    def _real_extract(self, url):
        video_id, display_id = self._match_valid_url(url).group('id', 'display_id')

        webpage = self._download_webpage(url, video_id)
        post = self._search_nextjs_data(webpage, video_id)['props']['pageProps']['ssr_data_posts']
        content = self._parse_json(post['post_contents_json'], video_id)[0]

        return {
            'id': video_id,
            'display_id': display_id,
            'title': self._og_search_title(webpage),
            **traverse_obj(post, {
                'title': ('post_title', {str}),
                'description': ('post_body', {str}),
                'tags': ('post_tags', {lambda x: x.split(',')}, ..., {str.strip}, filter),
                'channel_id': ('user_id', {int}, {str_or_none}),
                'uploader': ('user_name', {str}),
            }),
            **traverse_obj(content, {
                'url': (('secure_url', 'url'), {url_or_none}, any),
                'timestamp': ((
                    (('start_date', 'crdate'), {parse_iso8601(delimiter=' ')}),
                    ('created_at', {parse_iso8601}),
                ), any),
                'duration': ('duration', {float_or_none}),
                'categories': ('category', {str}, filter, all, filter),
                'cast': ((
                    {value(post.get('user_name'))},
                    ('guests_json', {json.loads}, ..., 'name'),
                ), {str}, filter),
            }),
        }