
    yf                     2    d dl mZ ddlmZ  G d de      Zy)   )InfoExtractor   )compat_urlparsec                   F    e Zd ZdZdZdZdddddd	d
dddd	dgddidZd Zy)MotorsportIEFzmotorsport.comzVhttps?://(?:www\.)?motorsport\.com/[^/?#]+/video/(?:[^/?#]+/)(?P<id>[^/]+)/?(?:$|[?#])zUhttp://www.motorsport.com/f1/video/main-gallery/red-bull-racing-2014-rules-explained/z2-T3WuR-KMMmp4z%Red Bull Racing: 2014 Rules Explained   u   A new clip from Red Bull sees Daniel Ricciardo and Sebastian Vettel explain the 2014 Formula One regulations – which are arguably the most complex the sport has ever seen.	mcomstaffUC334JIYKkVnyFoNCclfZtHQ20140903zre:^https?://.+\.jpg$)	idexttitledurationdescriptionuploaderuploader_idupload_date	thumbnailYoutubeskip_downloadT)url	info_dictadd_ieparamsc                 D   | j                  |      }| j                  ||      }| j                  d|dd       }|$| j                  d|d      }| j                  |      S | j                  t	        j
                  ||      |d      }| j                  d|d      }d	|d
|z  dS )Nz,<iframe id="player_iframe"[^>]+src="([^"]+)"ziframe path)defaultz8<iframe [^>]*\bsrc="(https://motorsport\.tv/embed/[^"]+)zembed iframe pathzDownloading iframezwww.youtube.com/embed/(.{11})z
youtube idurl_transparentzhttps://youtube.com/watch?v=%s)_type
display_idr   )	_match_id_download_webpage_html_search_regex
url_resultr   urljoin_search_regex)selfr   r    webpageiframe_pathiframe
youtube_ids          =/usr/lib/python3/dist-packages/yt_dlp/extractor/motorsport.py_real_extractzMotorsportIE._real_extract   s    ^^C(
((j9--;Wm]a . c 11KWVikK??;//''##C5z " '',flD
 '$3j@
 	
    N)__name__
__module____qualname___WORKINGIE_DESC
_VALID_URL_TESTr-    r.   r,   r   r      sT    HGjJf< K#5%1

 +T
E&
r.   r   N)commonr   compatr   r   r6   r.   r,   <module>r9      s    !
-
= -
r.   