def custom_response_text_rewriter(raw_text, content_mime, remote_url):
    raw_text = regex_youtube_video_videoplayback_resolve.sub(((('http\\g<percent>3A\\g<percent>2F\\g<percent>2F' if (my_host_scheme == 'http://') else '') + video_cdn_domain) + '\\g<percent>2Fvideoplayback\\g<percent>3Fewmytbserver\\g<percent>3D\\g<prefix>\\g<percent>26'), raw_text)
    raw_text = regex_youtube_video_url_resolve.sub((('http:\\g<escape_slash>/\\g<escape_slash>/' if (my_host_scheme == 'http://') else '') + video_cdn_domain), raw_text)
    raw_text = regex_youtube_video_c_videoplayback_resolve.sub(((('http://' if (my_host_scheme == 'http://') else '') + video_cdn_domain) + '/videoplayback?ewmytbserver=\\g<prefix>&'), raw_text)
    if ('javascript' in content_mime):
        raw_text = raw_text.replace('\\\\.googlevideo\\\\.com$', (('.*?\\\\.' + videocdn_video_root_domain.replace('.', '\\\\.')) + '$'))
        _buff = ((re.escape(videocdn_video_root_domain) + '|') + re.escape(my_host_name_root))
        raw_text = raw_text.replace('-nocookie)?\\.com\\/|(m\\.)?[a-z0-9\\-]', (('-nocookie)?\\.com\\/|' + _buff) + '|(m\\.)?[a-z0-9\\-]'))
        raw_text = raw_text.replace('googlevideo\\.com|play\\.google\\.com|', (('googlevideo\\.com|' + _buff) + '|play\\.google\\.com|'))
        raw_text = raw_text.replace('prod\\.google\\.com|sandbox\\.google\\.com', (('prod\\.google\\.com|' + _buff) + '|sandbox\\.google\\.com'))
        raw_text = raw_text.replace('corp\\.google\\.com|borg\\.google\\.com', (('corp\\.google\\.com|' + _buff) + '|borg\\.google\\.com'))
    return raw_text
def custom_response_text_rewriter(raw_text, content_mime, remote_url):
    raw_text = regex_youtube_video_videoplayback_resolve.sub(((('http\\g<percent>3A\\g<percent>2F\\g<percent>2F' if (my_host_scheme == 'http://') else ) + video_cdn_domain) + '\\g<percent>2Fvideoplayback\\g<percent>3Fewmytbserver\\g<percent>3D\\g<prefix>\\g<percent>26'), raw_text)
    raw_text = regex_youtube_video_url_resolve.sub((('http:\\g<escape_slash>/\\g<escape_slash>/' if (my_host_scheme == 'http://') else ) + video_cdn_domain), raw_text)
    raw_text = regex_youtube_video_c_videoplayback_resolve.sub(((('http://' if (my_host_scheme == 'http://') else ) + video_cdn_domain) + '/videoplayback?ewmytbserver=\\g<prefix>&'), raw_text)
    if ('javascript' in content_mime):
        raw_text = raw_text.replace('\\\\.googlevideo\\\\.com$', (('.*?\\\\.' + videocdn_video_root_domain.replace('.', '\\\\.')) + '$'))
        _buff = ((re.escape(videocdn_video_root_domain) + '|') + re.escape(my_host_name_root))
        raw_text = raw_text.replace('-nocookie)?\\.com\\/|(m\\.)?[a-z0-9\\-]', (('-nocookie)?\\.com\\/|' + _buff) + '|(m\\.)?[a-z0-9\\-]'))
        raw_text = raw_text.replace('googlevideo\\.com|play\\.google\\.com|', (('googlevideo\\.com|' + _buff) + '|play\\.google\\.com|'))
        raw_text = raw_text.replace('prod\\.google\\.com|sandbox\\.google\\.com', (('prod\\.google\\.com|' + _buff) + '|sandbox\\.google\\.com'))
        raw_text = raw_text.replace('corp\\.google\\.com|borg\\.google\\.com', (('corp\\.google\\.com|' + _buff) + '|borg\\.google\\.com'))
    return raw_text