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

Code before:
            'timestamp': 1684263600,
            'series': 'AITAA: Am I the Agony Aunt?',
            'thumbnail': 'md5:5980a831360d0744c3764551be3d09c1',
            'categories': ['Entertainment'],
        }
    }]

    def _real_extract(self, url):
        episode_id = self._match_id(url)
        page = self._download_webpage(url, episode_id)
        audios = self._parse_html5_media_entries('https://audio.camfm.co.uk', page, episode_id)
        formats = []
        for i in audios:
            formats.extend(i['formats'])

        series = self._html_search_regex(r'<div[^>]+class="caption">\n\s*(.+)', page, 'title', fatal=False)
        date = self._html_search_regex('>Aired at ([^<]+)<', page, 'air date', fatal=False)
        title = join_nonempty(series, date, delim=' - ')

        return {
            'id': episode_id,
            'title': title,
            'formats': formats,
            'timestamp': unified_timestamp(date),  # this will be off by an hour when DST is in effect
            # https://www.gov.uk/when-do-the-clocks-change - too annoying to calculate, will just treat as UTC
            # it'll be right half the time at least
            'series': series,
            'description': self._html_search_regex(r'>Aired at [^<]+<.*\n\s*(.*)', page, 'description', fatal=False),
            'thumbnail': self._absolute_url(self._search_regex(r'<div[^>]+class="cover-art"[^>]+style="[^"]+url\(\'([^\']+)\'\)[^>]+>',
                                            page, 'thumbnail', fatal=False)),
            'categories': [self._html_search_regex(r'<span[^>]+class="label"[^>]+>([^<]+)<', page, 'category', fatal=False)],
            'was_live': True,
        }


Review comment (suggestion):
```suggestion
            'timestamp': unified_timestamp(date),  # XXX: Does not account for UK's daylight savings
```

is clear enough

Code after:
            'timestamp': 1684263600,
            'series': 'AITAA: Am I the Agony Aunt?',
            'thumbnail': 'md5:5980a831360d0744c3764551be3d09c1',
            'categories': ['Entertainment'],
        }
    }]

    def _real_extract(self, url):
        episode_id = self._match_id(url)
        page = self._download_webpage(url, episode_id)
        audios = self._parse_html5_media_entries('https://audio.camfm.co.uk', page, episode_id)

        caption = get_element_by_class('caption', page)
        series = clean_html(re.sub(r'<span[^<]+<[^<]+>', '', caption))

        card_section = get_element_by_class('card-section', page)
        date = self._html_search_regex('>Aired at ([^<]+)<', card_section, 'air date', fatal=False)

        return {
            'id': episode_id,
            'title': join_nonempty(series, date, delim=' - '),
            'formats': traverse_obj(audios, (..., 'formats', ...)),
            'timestamp': unified_timestamp(date),  # XXX: Does not account for UK's daylight savings
            'series': series,
            'description': clean_html(re.sub(r'<b>[^<]+</b><br[^>]+/>', '', card_section)),
            'thumbnail': urljoin('https://camfm.co.uk', self._search_regex(
                r'<div[^>]+class="cover-art"[^>]+style="[^"]+url\(\'([^\']+)',
                page, 'thumbnail', fatal=False)),
            'categories': get_elements_by_class('label', caption),
            'was_live': True,
        }