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

Code before:
from .common import InfoExtractor
from ..utils import (
    format_field,
    int_or_none,
    mimetype2ext,
    parse_iso8601,
    truncate_string,
    update_url_query,
    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>[^/]+)/post/(?P<id>\w+)',
        r'at://(?P<handle>[^/]+)/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': [],
        },
    }, {
        'url': 'https://bsky.app/profile/bsky.app/post/3l3vgf77uco2g',
        'md5': 'b9e344fdbce9f2852c668a97efefb105',

Review comment (security):
same question here, and escape the dots
```suggestion
        r'at://(?P<handle>[\w.:%-]+)/app\.bsky\.feed\.post/(?P<id>\w+)',
```


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': [],
        },