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

Code before:
from .common import InfoExtractor
from ..utils import int_or_none, mimetype2ext, parse_iso8601, traverse_obj, url_or_none


class BlueskyIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?bsky\.app/profile/(?P<handle>[^/]+)/post/(?P<id>[0-9a-zA-Z]+)'
    _TESTS = [{
        'url': 'https://bsky.app/profile/blu3blue.bsky.social/post/3l4omssdl632g',
        'md5': '375539c1930ab05d15585ed772ab54fd',
        'info_dict': {
            'id': '3l4omssdl632g',
            'ext': 'mp4',
            'title': str,
            'upload_date': '20240921',
            'description': 'OMG WE HAVE VIDEOS NOW',
            'thumbnail': r're:https://video.bsky.app/watch/.*\.jpg$',
            'alt_title': None,
            'uploader': str,
            'channel': 'blu3blue.bsky.social',
            'uploader_id': 'did:plc:pzdr5ylumf7vmvwasrpr5bf2',
            'channel_id': 'did:plc:pzdr5ylumf7vmvwasrpr5bf2',
            'uploader_url': 'https://bsky.app/profile/blu3blue.bsky.social',
            'channel_url': 'https://bsky.app/profile/did:plc:pzdr5ylumf7vmvwasrpr5bf2',
            'timestamp': 1726940605,
            'like_count': int,
            'repost_count': int,
            'comment_count': int,
            'webpage_url': 'https://bsky.app/profile/blu3blue.bsky.social/post/3l4omssdl632g',
            'tags': 'count:1',
            'subtitles': dict,
            'comments': None,  # 'count:29' if getcomments
        },
    }, {
        'url': 'https://bsky.app/profile/bsky.app/post/3l3vgf77uco2g',
        'md5': 'b9e344fdbce9f2852c668a97efefb105',
        'info_dict': {
            'id': '3l3vgf77uco2g',
            'ext': 'mp4',
            'title': r're:Bluesky: "Bluesky now has video!',
            'upload_date': '20240911',
            'description': r're:Bluesky now has video!',
            'thumbnail': r're:https://video.bsky.app/watch/.*\.jpg$',

Review comment (suggestion):
You don't need to test for `None` values
```suggestion
```

Code after:
from .common import InfoExtractor
from ..utils import (
    ExtractorError,
    format_field,
    int_or_none,
    mimetype2ext,
    orderedSet,
    parse_iso8601,
    truncate_string,
    update_url_query,
    url_basename,
    url_or_none,
    variadic,
)
from ..utils.traversal import traverse_obj


class BlueskyIE(InfoExtractor):
    _VALID_URL = [
        r'https?://(?:www\.)?(?:bsky\.app|main\.bsky\.dev)/profile/(?P<handle>[\w.:%-]+)/post/(?P<id>\w+)',
        r'at://(?P<handle>[\w.:%-]+)/app\.bsky\.feed\.post/(?P<id>\w+)',
    ]
    _TESTS = [{
        'url': 'https://bsky.app/profile/blu3blue.bsky.social/post/3l4omssdl632g',
        'md5': '375539c1930ab05d15585ed772ab54fd',
        'info_dict': {
            'id': '3l4omssdl632g',
            'ext': 'mp4',
            'uploader': 'Blu3Blu3Lilith',
            'uploader_id': 'blu3blue.bsky.social',
            'uploader_url': 'https://bsky.app/profile/blu3blue.bsky.social',
            'channel_id': 'did:plc:pzdr5ylumf7vmvwasrpr5bf2',
            'channel_url': 'https://bsky.app/profile/did:plc:pzdr5ylumf7vmvwasrpr5bf2',
            'thumbnail': r're:https://video.bsky.app/watch/.*\.jpg$',
            'title': 'OMG WE HAVE VIDEOS NOW',
            'description': 'OMG WE HAVE VIDEOS NOW',
            'upload_date': '20240921',
            'timestamp': 1726940605,
            'like_count': int,
            'repost_count': int,
            'comment_count': int,
            'tags': [],