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

Code before:
import re

from .common import InfoExtractor
from .archiveorg import ArchiveOrgIE
from ..utils import (
    int_or_none,
    orderedSet,
    urljoin,
    InAdvancePagedList,
)


class AltCensoredIE(InfoExtractor):
    IE_NAME = 'altcensored'
    _VALID_URL = r'https?://(?:www\.)?altcensored\.com/(?:watch\?v=|embed/)(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://www.altcensored.com/watch?v=k0srjLSkga8',
        'info_dict': {
            "id": "youtube-k0srjLSkga8",
            "ext": "webm",
            "title": "QUELLES SONT LES CONSÉQUENCES DE L'HYPERSEXUALISATION DE LA SOCIÉTÉ ?",
            'display_id': 'k0srjLSkga8.webm',
            'release_date': '20180403',
            'creator': 'Virginie Vota',
            'release_year': 2018,
            'upload_date': '20230318',
            'uploader': 'admin@altcensored.com',
            'description': 'md5:0b38a8fc04103579d5c1db10a247dc30',
            'timestamp': 1679161343,
            'track': 'k0srjLSkga8',
            'duration': 926.09,
            'thumbnail': 'https://archive.org/download/youtube-k0srjLSkga8/youtube-k0srjLSkga8.thumbs/k0srjLSkga8_000925.jpg',
            'yt_views': 30402,
            'category': 'News & Politics',
        }
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        # Use most data from archive.org (extractor indirection)
        # But try first to gather a couple of useful information from altcensored
        webpage = self._download_webpage(url, video_id)
        yt_views = int_or_none(self._html_search_regex(
            r'YouTube Views:.*?([0-9,.]+)', webpage, 'view count', default='0').replace(',', ''))
        category = self._html_search_regex(r'<a href="/category/.*?\n\s+([^<]+)', webpage, 'category')
        # Hardcoded (very unlikely to need a change in a foreseeable future)

Review comment (suggestion):
Use single quotes here
```suggestion
            'id': 'youtube-k0srjLSkga8',
            'ext': 'webm',
            'title': "QUELLES SONT LES CONSÉQUENCES DE L'HYPERSEXUALISATION DE LA SOCIÉTÉ ?",
```

Code after:
import re

from .archiveorg import ArchiveOrgIE
from .common import InfoExtractor
from ..utils import (
    InAdvancePagedList,
    int_or_none,
    orderedSet,
    str_to_int,
    urljoin,
)


class AltCensoredIE(InfoExtractor):
    IE_NAME = 'altcensored'
    _VALID_URL = r'https?://(?:www\.)?altcensored\.com/(?:watch\?v=|embed/)(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://www.altcensored.com/watch?v=k0srjLSkga8',
        'info_dict': {
            'id': 'youtube-k0srjLSkga8',
            'ext': 'webm',
            'title': "QUELLES SONT LES CONSÉQUENCES DE L'HYPERSEXUALISATION DE LA SOCIÉTÉ ?",
            'display_id': 'k0srjLSkga8.webm',
            'release_date': '20180403',
            'creator': 'Virginie Vota',
            'release_year': 2018,
            'upload_date': '20230318',
            'uploader': 'admin@altcensored.com',
            'description': 'md5:0b38a8fc04103579d5c1db10a247dc30',
            'timestamp': 1679161343,
            'track': 'k0srjLSkga8',
            'duration': 926.09,
            'thumbnail': 'https://archive.org/download/youtube-k0srjLSkga8/youtube-k0srjLSkga8.thumbs/k0srjLSkga8_000925.jpg',
            'view_count': int,
            'categories': ['News & Politics'],
        }
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)

        return {
            '_type': 'url_transparent',
            'url': f'https://archive.org/details/youtube-{video_id}',
            'ie_key': ArchiveOrgIE.ie_key(),