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

Code before:
from .common import InfoExtractor
from ..compat import (
    compat_str,
    compat_urlparse,
)
from ..utils import (
    find_xpath_attr,
    xpath_attr,
    xpath_with_ns,
    xpath_text,
    orderedSet,
    update_url_query,
    int_or_none,
    float_or_none,
    parse_iso8601,
    determine_ext,
    traverse_obj
)


class LivestreamIE(InfoExtractor):
    IE_NAME = 'livestream'
    _VALID_URL = r'https?://(?:new\.)?livestream.com/' \
        '(?:(?:accounts/(?P<account_id>\d+))|(?P<account_name>[^/]+))' \
        '(?:(?:/events/(?P<event_id>\d+))|(?:/(?P<event_name>[^/]+)))?' \
        '(?:/videos/(?P<id>\d+))?'
    _EMBED_REGEX = [r'<iframe[^>]+src="(?P<url>https?://(?:new\.)?livestream\.com/[^"]+/player[^"]+)"']

    _TESTS = [{
        'url': 'http://new.livestream.com/CoheedandCambria/WebsterHall/videos/4719370',
        'md5': '7876c5f5dc3e711b6b73acce4aac1527',
        'info_dict': {
            'id': '4719370',
            'ext': 'mp4',
            'title': 'Live from Webster Hall NYC',
            'timestamp': 1350008072,
            'upload_date': '20121012',
            'duration': 5968.0,
            'like_count': int,
            'view_count': int,
            'comment_count': int,
            'thumbnail': r're:^http://.*\.jpg$'
        }
    }, {
        'url': 'https://livestream.com/coheedandcambria/websterhall',
        'info_dict': {
            'id': '1585861',
            'title': 'Live From Webster Hall'
        },
        'playlist_mincount': 1,
    }, {

Review comment (suggestion):
```suggestion
    _VALID_URL = r'''(?x)
        https?://(?:new\.)?livestream.com/
        (?:accounts/(?P<account_id>\d+)|(?P<account_name>[^/]+))
        (?:/events/(?P<event_id>\d+)|/(?P<event_name>[^/]+))?
        (?:/videos/(?P<id>\d+))?
    '''
```

Code after:
from .common import InfoExtractor
from ..compat import compat_str, compat_urlparse
from ..utils import (
    determine_ext,
    find_xpath_attr,
    float_or_none,
    int_or_none,
    orderedSet,
    parse_iso8601,
    traverse_obj,
    update_url_query,
    xpath_attr,
    xpath_text,
    xpath_with_ns,
)


class LivestreamIE(InfoExtractor):
    IE_NAME = 'livestream'
    _VALID_URL = r'''(?x)
        https?://(?:new\.)?livestream\.com/
        (?:accounts/(?P<account_id>\d+)|(?P<account_name>[^/]+))
        (?:/events/(?P<event_id>\d+)|/(?P<event_name>[^/]+))?
        (?:/videos/(?P<id>\d+))?
    '''
    _EMBED_REGEX = [r'<iframe[^>]+src="(?P<url>https?://(?:new\.)?livestream\.com/[^"]+/player[^"]+)"']

    _TESTS = [{
        'url': 'http://new.livestream.com/CoheedandCambria/WebsterHall/videos/4719370',
        'md5': '7876c5f5dc3e711b6b73acce4aac1527',
        'info_dict': {
            'id': '4719370',
            'ext': 'mp4',
            'title': 'Live from Webster Hall NYC',
            'timestamp': 1350008072,
            'upload_date': '20121012',
            'duration': 5968.0,
            'like_count': int,
            'view_count': int,
            'comment_count': int,
            'thumbnail': r're:^http://.*\.jpg$'
        }
    }, {
        'url': 'https://livestream.com/coheedandcambria/websterhall',
        'info_dict': {
            'id': '1585861',
            'title': 'Live From Webster Hall'
        },
        'playlist_mincount': 1,
    }, {
        'url': 'https://livestream.com/dayananda/events/7954027',