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

Code before:
                })

            playlist.append({
                'id': '%s_part%d' % (video_id, i + 1),
                'title': title,
                'duration': vid_data['data']['clipsDuration'][i],
                'formats': formats,
            })

        if len(playlist) == 1:
            info = playlist[0]
            info['id'] = video_id
        else:
            info = {
                '_type': 'multi_video',
                'entries': playlist,
                'id': video_id,
                'title': title,
                'duration': traverse_obj(vid_data, ('data', 'totalDuration', {float_or_none})),
            }

        if mytv:
            publish_time = unified_timestamp(self._search_regex(
                r"publishTime: '(\d+-\d+-\d+ \d+:\d+)'", webpage, 'publish time', fatal=False))
        else:
            publish_time = unified_timestamp(traverse_obj(vid_data, ('tv_application_time', {str_or_none})))

        return {
            'timestamp': publish_time - 8 * 3600 if publish_time else None,
            **traverse_obj(vid_data, {
                'alt_title': ('data', 'subName', {str_or_none}),
                'uploader': ('wm_data', 'wm_username', {str_or_none}),
                'thumbnail': ('data', 'coverImg', {url_or_none}),
                'tags': ('data', 'tag', {str_or_none}, {lambda i: i.split() if i else None}),
            }),
            **info,
        }


class SohuVIE(InfoExtractor):
    _VALID_URL = r'https?://tv\.sohu\.com/v/(?P<id>[\w=-]+)\.html(?:$|[#?])'

    _TESTS = [{
        'note': 'Multipart video',
        'url': 'https://tv.sohu.com/v/MjAyMzA2MTQvbjYwMTMxNTE5Mi5zaHRtbA==.html',
        'info_dict': {
            'id': '601315192',
            'title': '《淬火丹心》第1集',
            'alt_title': '“点天灯”发生事故',
            'duration': 2701.692,
            'timestamp': 1686758040,

Review comment (suggestion):
Is the `str_or_none` transformation necessary? Does the value need to be stringified before calling `unified_timestamp`?
```suggestion
            publish_time = traverse_obj(vid_data, ('tv_application_time', {str_or_none}, {unified_timestamp}))
```

Code after:
                    'fps': int_or_none(data.get('fps')),
                })

            playlist.append({
                'id': '%s_part%d' % (video_id, i + 1),
                'title': title,
                'duration': vid_data['data']['clipsDuration'][i],
                'formats': formats,
            })

        if len(playlist) == 1:
            info = playlist[0]
            info['id'] = video_id
        else:
            info = {
                '_type': 'multi_video',
                'entries': playlist,
                'id': video_id,
                'title': title,
                'duration': traverse_obj(vid_data, ('data', 'totalDuration', {float_or_none})),
            }

        if mytv:
            publish_time = unified_timestamp(self._search_regex(
                r'publishTime:\s*["\'](\d+-\d+-\d+ \d+:\d+)["\']', webpage, 'publish time', fatal=False))
        else:
            publish_time = traverse_obj(vid_data, ('tv_application_time', {unified_timestamp}))

        return {
            'timestamp': publish_time - 8 * 3600 if publish_time else None,
            **traverse_obj(vid_data, {
                'alt_title': ('data', 'subName', {str}),
                'uploader': ('wm_data', 'wm_username', {str}),
                'thumbnail': ('data', 'coverImg', {url_or_none}),
                'tags': ('data', 'tag', {str.split}),
            }),
            **info,
        }


class SohuVIE(InfoExtractor):
    _VALID_URL = r'https?://tv\.sohu\.com/v/(?P<id>[\w=-]+)\.html(?:$|[#?])'

    _TESTS = [{
        'note': 'Multipart video',
        'url': 'https://tv.sohu.com/v/MjAyMzA2MTQvbjYwMTMxNTE5Mi5zaHRtbA==.html',
        'info_dict': {
            'id': '601315192',
            'title': '《淬火丹心》第1集',
            'alt_title': '“点天灯”发生事故',
            'duration': 2701.692,