U
    g[
                     @   s,   d dl mZ ddlmZ G dd deZdS )   )InfoExtractor   )smuggle_urlc                	   @   sZ   e Zd ZdZdddddddd	d
ddddddddgdddddddgZdd ZdS )KickStarterIEz=https?://(?:www\.)?kickstarter\.com/projects/(?P<id>[^/]*)/.*z`https://www.kickstarter.com/projects/1404461844/intersection-the-story-of-josh-grant/descriptionZ c81addca81327ffa66c642b5d8b08cabZ
1404461844Zmp4z5Intersection: The Story of Josh Grant by Kyle CowlingzpA unique motocross documentary that examines the life and mind of one of sports most elite athletes: Josh Grant.)idexttitledescription)urlmd5	info_dictz?Embedded video (not using the native kickstarter video service)zghttps://www.kickstarter.com/projects/597507018/pebble-e-paper-watch-for-iphone-and-android/posts/659178Z78704821ZpebblezPebble TechnologyzPebble iOS Notifications)r   r   Zuploader_idZuploaderr   ZVimeo)Znoter
   r   Zadd_iezRhttps://www.kickstarter.com/projects/1420158244/power-drive-2000/widget/video.htmlZ
1420158244zPower Drive 2000)r   r   r   )r
   r   c                 C   s   |  |}| ||}| d|d}| jd|dd d}|d krVddt|dd	i|d
S | j|d d}|d kr~| jd|ddd}|||| j|d d|dS )Nz7<title>\s*(.*?)(?:\s*&mdash;\s*Kickstarter)?\s*</title>r   zdata-video-url="(.*?)"z	video URL)defaultZurl_transparentGenericZ
to_genericT)_typeZie_keyr
   r   z9<img[^>]+class="[^"]+\s*poster\s*[^"]+"[^>]+src="([^"]+)"zthumbnail imageF)fatal)r   r
   r   r	   	thumbnail)Z	_match_idZ_download_webpageZ_html_search_regexZ_search_regexr   Z_og_search_thumbnailZ_og_search_description)selfr
   Zvideo_idZwebpager   Z	video_urlr    r   @/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/kickstarter.py_real_extract'   sB    
     zKickStarterIE._real_extractN)__name__
__module____qualname__Z
_VALID_URLZ_TESTSr   r   r   r   r   r      s6    r   N)commonr   utilsr   r   r   r   r   r   <module>   s   