# Path: pytube/extract.py
# def publish_date(watch_html: str):
# def recording_available(watch_html):
# def is_private(watch_html):
# def is_age_restricted(watch_html: str) -> bool:
# def playability_status(watch_html: str) -> (str, str):
# def video_id(url: str) -> str:
# def playlist_id(url: str) -> str:
# def channel_name(url: str) -> str:
# def video_info_url(video_id: str, watch_url: str) -> str:
# def video_info_url_age_restricted(video_id: str, embed_html: str) -> str:
# def _video_info_url(params: OrderedDict) -> str:
# def js_url(html: str) -> str:
# def mime_type_codec(mime_type_codec: str) -> Tuple[str, List[str]]:
# def get_ytplayer_js(html: str) -> Any:
# def get_ytplayer_config(html: str) -> Any:
# def get_ytcfg(html: str) -> str:
# def apply_signature(stream_manifest: Dict, vid_info: Dict, js: str) -> None:
# def apply_descrambler(stream_data: Dict) -> None:
# def initial_data(watch_html: str) -> str:
# def initial_player_response(watch_html: str) -> str:
# def metadata(initial_data) -> Optional[YouTubeMetadata]:
# 
# Path: pytube/exceptions.py
# class RegexMatchError(ExtractError):
#     """Regex pattern did not return any matches."""
# 
#     def __init__(self, caller: str, pattern: Union[str, Pattern]):
#         """
#         :param str caller:
#             Calling function
#         :param str pattern:
#             Pattern that failed to match
#         """
#         super().__init__(f"{caller}: could not find match for {pattern}")
#         self.caller = caller
#         self.pattern = pattern


from datetime import datetime
from pytube import extract
from pytube.exceptions import RegexMatchError
import pytest
import re
    assert extract.is_private(private['watch_html'])


def test_not_is_private(cipher_signature):
    assert not extract.is_private(cipher_signature.watch_html)


def test_recording_available(cipher_signature):
    assert extract.recording_available(cipher_signature.watch_html)


def test_publish_date(cipher_signature):
    expected = datetime(2019, 12, 5)
    assert cipher_signature.publish_date == expected
    assert extract.publish_date('') is None


def test_not_recording_available(missing_recording):
    assert not extract.recording_available(missing_recording['watch_html'])


def test_mime_type_codec():
    mime_type, mime_subtype = extract.mime_type_codec(
        'audio/webm; codecs="opus"'
    )
    assert mime_type == "audio/webm"
    assert mime_subtype == ["opus"]


def test_mime_type_codec_with_no_match_should_error():

# Path: pytube/extract.py
# def publish_date(watch_html: str):
# def recording_available(watch_html):
# def is_private(watch_html):
# def is_age_restricted(watch_html: str) -> bool:
# def playability_status(watch_html: str) -> (str, str):
# def video_id(url: str) -> str:
# def playlist_id(url: str) -> str:
# def channel_name(url: str) -> str:
# def video_info_url(video_id: str, watch_url: str) -> str:
# def video_info_url_age_restricted(video_id: str, embed_html: str) -> str:
# def _video_info_url(params: OrderedDict) -> str:
# def js_url(html: str) -> str:
# def mime_type_codec(mime_type_codec: str) -> Tuple[str, List[str]]:
# def get_ytplayer_js(html: str) -> Any:
# def get_ytplayer_config(html: str) -> Any:
# def get_ytcfg(html: str) -> str:
# def apply_signature(stream_manifest: Dict, vid_info: Dict, js: str) -> None:
# def apply_descrambler(stream_data: Dict) -> None:
# def initial_data(watch_html: str) -> str:
# def initial_player_response(watch_html: str) -> str:
# def metadata(initial_data) -> Optional[YouTubeMetadata]:
# 
# Path: pytube/exceptions.py
# class RegexMatchError(ExtractError):
#     """Regex pattern did not return any matches."""
# 
#     def __init__(self, caller: str, pattern: Union[str, Pattern]):
#         """
#         :param str caller:
#             Calling function
#         :param str pattern:
#             Pattern that failed to match
#         """
#         super().__init__(f"{caller}: could not find match for {pattern}")
#         self.caller = caller
#         self.pattern = pattern


# Path: tests/test_extract.py
from datetime import datetime
from pytube import extract
from pytube.exceptions import RegexMatchError
import pytest
import re

    assert extract.is_private(private['watch_html'])


def test_not_is_private(cipher_signature):
    assert not extract.is_private(cipher_signature.watch_html)


def test_recording_available(cipher_signature):
    assert extract.recording_available(cipher_signature.watch_html)


def test_publish_date(cipher_signature):
    expected = datetime(2019, 12, 5)
    assert cipher_signature.publish_date == expected
    assert extract.publish_date('') is None


def test_not_recording_available(missing_recording):
    assert not extract.recording_available(missing_recording['watch_html'])


def test_mime_type_codec():
    mime_type, mime_subtype = extract.mime_type_codec(
        'audio/webm; codecs="opus"'
    )
    assert mime_type == "audio/webm"
    assert mime_subtype == ["opus"]


def test_mime_type_codec_with_no_match_should_error():

    with pytest.raises(RegexMatchError):