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

Code before:
        if not files_data:
            self.raise_no_formats('No files data found')

        file_info = files_data.get('file')
        if not file_info:
            self.raise_no_formats('No file information found')

        m3u8_url = file_info.get('url')
        if not m3u8_url:
            self.raise_no_formats('No M3U8 URL found')

        formats = self._extract_m3u8_formats(m3u8_url, video_id, 'mp4', 'm3u8_native')

        # Parse duration from duration string (format: "HH:MM:SS:FF")
        duration_str = file_info.get('duration')
        duration = None
        if duration_str:
            # Convert "HH:MM:SS:FF" to seconds (ignoring frames)
            try:
                time_parts = duration_str.split(':')
                if len(time_parts) >= 3:
                    hours = int(time_parts[0])
                    minutes = int(time_parts[1])
                    seconds = int(time_parts[2])
                    duration = hours * 3600 + minutes * 60 + seconds
            except (ValueError, IndexError):
                pass

        # Parse upload date from recordingFrom
        upload_date = None
        recording_from = video_details.get('recordingFrom')
        if recording_from:
            upload_date = unified_timestamp(recording_from)

        return {
            'id': video_id,
            'title': video_details.get('parlViewTitle') or video_details.get('title'),
            'description': video_details.get('parlViewDescription'),
            'formats': formats,
            'duration': duration,
            'timestamp': upload_date,
            'uploader': 'Australian Parliament House',
            'thumbnail': video_details.get('thumbUrl'),
            'series': f"{video_details.get('eventGroup')} - {video_details.get('eventSubGroup')}" if video_details.get('eventGroup') and video_details.get('eventSubGroup') else None,
        }


Review comment (suggestion):
Use `utils.parse_duration()`:
```suggestion
        # Parse duration from duration string (format: "HH:MM:SS:FF", ignoring FF)
        duration_str = file_info.get('duration')
        duration = parse_duration(':'.join((duration or '').split(':')[:3]))
```
If FF is a frame within the second and there is a known fps < 100, either in the `video_data` or a priori, it could be converted to milliseconds; or if it's actually tenths+hundredths of a second, the conversion can instead prepend `0:` (days) to force matching `:` as the seconds decimal point.

Code after:
import re

from .common import InfoExtractor
from ..utils import parse_duration, parse_iso8601, url_or_none
from ..utils.traversal import traverse_obj


class ParlviewIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?aph\.gov\.au/News_and_Events/Watch_Read_Listen/ParlView/video/(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://www.aph.gov.au/News_and_Events/Watch_Read_Listen/ParlView/video/3406614',
        'info_dict': {
            'id': '3406614',
            'ext': 'mp4',
            'title': 'Senate Chamber',
            'description': 'Official Recording of Senate Proceedings from the Australian Parliament',
            'thumbnail': 'https://aphbroadcasting-prod.z01.azurefd.net/vod-storage/vod-logos/SenateParlview06.jpg',
            'upload_date': '20250325',
            'duration': 17999,
            'timestamp': 1742939400,
        },
        'params': {
            'skip_download': True,
        },
    }, {
        'url': 'https://www.aph.gov.au/News_and_Events/Watch_Read_Listen/ParlView/video/SV1394.dv',
        'info_dict': {
            'id': 'SV1394.dv',
            'ext': 'mp4',
            'title': 'Senate Select Committee on Uranium Mining and Milling [Part 1]',
            'description': 'Official Recording of Senate Committee Proceedings from the Australian Parliament',
            'thumbnail': 'https://aphbroadcasting-prod.z01.azurefd.net/vod-storage/vod-logos/CommitteeThumbnail06.jpg',
            'upload_date': '19960822',
            'duration': 14765,
            'timestamp': 840754200,
        },
        'params': {
            'skip_download': True,
        },
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        video_details = self._download_json(
            f'https://vodapi.aph.gov.au/api/search/parlview/{video_id}', video_id)['videoDetails']

        formats, subtitles = self._extract_m3u8_formats_and_subtitles(
            video_details['files']['file']['url'], video_id, 'mp4')

        DURATION_RE = re.compile(r'(?P<duration>\d+:\d+:\d+):\d+')

        return {
            'id': video_id,
            'formats': formats,
            'subtitles': subtitles,
            **traverse_obj(video_details, {
                'title': (('parlViewTitle', 'title'), {str}, any),
                'description': ('parlViewDescription', {str}),
                'duration': ('files', 'file', 'duration', {DURATION_RE.fullmatch}, 'duration', {parse_duration}),
                'timestamp': ('recordingFrom', {parse_iso8601}),
                'thumbnail': ('thumbUrl', {url_or_none}),
            }),
        }