@staticmethod
def _extract_url(webpage):
    mobj = (re.search('(?xs)\n                    kWidget\\.(?:thumb)?[Ee]mbed\\(\n                    \\{.*?\n                        (?P<q1>[\'"])wid(?P=q1)\\s*:\\s*\n                        (?P<q2>[\'"])_?(?P<partner_id>(?:(?!(?P=q2)).)+)(?P=q2),.*?\n                        (?P<q3>[\'"])entry_?[Ii]d(?P=q3)\\s*:\\s*\n                        (?P<q4>[\'"])(?P<id>(?:(?!(?P=q4)).)+)(?P=q4)(?:,|\\s*\\})\n                ', webpage) or re.search('(?xs)\n                    (?P<q1>["\'])\n                        (?:https?:)?//cdnapi(?:sec)?\\.kaltura\\.com(?::\\d+)?/(?:(?!(?P=q1)).)*\\b(?:p|partner_id)/(?P<partner_id>\\d+)(?:(?!(?P=q1)).)*\n                    (?P=q1).*?\n                    (?:\n                        (?:\n                            entry_?[Ii]d|\n                            (?P<q2>["\'])entry_?[Ii]d(?P=q2)\n                        )\\s*:\\s*|\n                        \\[\\s*(?P<q2_1>["\'])entry_?[Ii]d(?P=q2_1)\\s*\\]\\s*=\\s*\n                    )\n                    (?P<q3>["\'])(?P<id>(?:(?!(?P=q3)).)+)(?P=q3)\n                ', webpage) or re.search('(?xs)\n                    <(?:iframe[^>]+src|meta[^>]+\\bcontent)=(?P<q1>["\'])\n                      (?:https?:)?//(?:(?:www|cdnapi(?:sec)?)\\.)?kaltura\\.com/(?:(?!(?P=q1)).)*\\b(?:p|partner_id)/(?P<partner_id>\\d+)\n                      (?:(?!(?P=q1)).)*\n                      [?&;]entry_id=(?P<id>(?:(?!(?P=q1))[^&])+)\n                      (?:(?!(?P=q1)).)*\n                    (?P=q1)\n                ', webpage))
    if mobj:
        embed_info = mobj.groupdict()
        for (k, v) in embed_info.items():
            embed_info[k] = v.strip()
        url = ('kaltura:%(partner_id)s:%(id)s' % embed_info)
        escaped_pid = re.escape(embed_info['partner_id'])
        service_url = re.search(('<script[^>]+src=["\\\']((?:https?:)?//.+?)/p/%s/sp/%s00/embedIframeJs' % (escaped_pid, escaped_pid)), webpage)
        if service_url:
            url = smuggle_url(url, {'service_url': service_url.group(1)})
        return url
@staticmethod
def _extract_url(webpage):
    mobj = (re.search('(?xs)\n                    kWidget\\.(?:thumb)?[Ee]mbed\\(\n                    \\{.*?\n                        (?P<q1>[\'"])wid(?P=q1)\\s*:\\s*\n                        (?P<q2>[\'"])_?(?P<partner_id>(?:(?!(?P=q2)).)+)(?P=q2),.*?\n                        (?P<q3>[\'"])entry_?[Ii]d(?P=q3)\\s*:\\s*\n                        (?P<q4>[\'"])(?P<id>(?:(?!(?P=q4)).)+)(?P=q4)(?:,|\\s*\\})\n                ', webpage) or re.search('(?xs)\n                    (?P<q1>["\'])\n                        (?:https?:)?//cdnapi(?:sec)?\\.kaltura\\.com(?::\\d+)?/(?:(?!(?P=q1)).)*\\b(?:p|partner_id)/(?P<partner_id>\\d+)(?:(?!(?P=q1)).)*\n                    (?P=q1).*?\n                    (?:\n                        (?:\n                            entry_?[Ii]d|\n                            (?P<q2>["\'])entry_?[Ii]d(?P=q2)\n                        )\\s*:\\s*|\n                        \\[\\s*(?P<q2_1>["\'])entry_?[Ii]d(?P=q2_1)\\s*\\]\\s*=\\s*\n                    )\n                    (?P<q3>["\'])(?P<id>(?:(?!(?P=q3)).)+)(?P=q3)\n                ', webpage) or re.search('(?xs)\n                    <(?:iframe[^>]+src|meta[^>]+\\bcontent)=(?P<q1>["\'])\n                      (?:https?:)?//(?:(?:www|cdnapi(?:sec)?)\\.)?kaltura\\.com/(?:(?!(?P=q1)).)*\\b(?:p|partner_id)/(?P<partner_id>\\d+)\n                      (?:(?!(?P=q1)).)*\n                      [?&;]entry_id=(?P<id>(?:(?!(?P=q1))[^&])+)\n                      (?:(?!(?P=q1)).)*\n                    (?P=q1)\n                ', webpage))
    if mobj:
        embed_info = mobj.groupdict()
        for (k, v) in embed_info.items():
            embed_info[k] = v.strip()
        url = ('kaltura:%(partner_id)s:%(id)s' % embed_info)
        escaped_pid = re.escape(embed_info['partner_id'])
        service_url = re.search(('<script[^>]+src=["\\\']((?:https?:)?//.+?)/p/%s/sp/%s00/embedIframeJs' % (escaped_pid, escaped_pid)), webpage)
        if service_url:
            url = smuggle_url(url, {'service_url': service_url.group(1)})
        return url