U
    Mf	                     @   s0   d dl mZ ddlmZmZ G dd deZdS )   )InfoExtractor   )int_or_none
remove_endc                   @   sH   e Zd ZdZdddddddd	d
dddddddddgZdd ZdS )
GameStarIEzLhttps?://(?:www\.)?game(?P<site>pro|star)\.de/videos/.*,(?P<id>[0-9]+)\.htmlzXhttp://www.gamestar.de/videos/trailer,3/hobbit-3-die-schlacht-der-fuenf-heere,76110.htmlZ ee782f1f8050448c95c5cacd63bc851cZ76110mp4uH   Hobbit 3: Die Schlacht der Fünf Heere - Teaser-Trailer zum dritten Teilu   Der Teaser-Trailer zu Hobbit 3: Die Schlacht der Fünf Heere zeigt einige Szenen aus dem dritten Teil der Saga und kündigt den...zre:^https?://.*\.jpg$i,"SZ20140728   )idexttitledescriptionZ	thumbnail	timestampZupload_dateduration)urlmd5	info_dictzwhttp://www.gamepro.de/videos/top-10-indie-spiele-fuer-nintendo-switch-video-tolle-nindies-games-zum-download,95316.htmlT)r   Zonly_matchingzxhttp://www.gamestar.de/videos/top-10-indie-spiele-fuer-nintendo-switch-video-tolle-nindies-games-zum-download,95316.htmlc           
      C   s   |  |}|d}|d}| ||}| | jd|ddd|}| ||}t|d d|  |d< t|	d	}t| j
d
|ddd}	||d| d||	d |S )Nsiter	   zc(?s)<script[^>]+type=(["\'])application/ld\+json\1[^>]*>(?P<json_ld>[^<]+VideoObject[^<]+)</script>zJSON-LDjson_ld)groupr   z - GameZinteractionCountzJ<span>Kommentare</span>\s*<span[^>]+class=["\']count[^>]+>\s*\(\s*([0-9]+)zcomment countF)fatalzIhttp://gamestar.de/_misc/videos/portal/getVideoUrl.cfm?premium=0&videoId=r   )r	   r   r
   
view_countcomment_count)Z_match_valid_urlr   Z_download_webpageZ_parse_jsonZ_search_regexZ_json_ldr   r   r   getZ_html_search_regexupdate)
selfr   Zmobjr   Zvideo_idZwebpager   r   r   r    r   =/tmp/pip-unpacked-wheel-zk9bgjdq/yt_dlp/extractor/gamestar.py_real_extract   s@    


     zGameStarIE._real_extractN)__name__
__module____qualname__Z
_VALID_URLZ_TESTSr   r   r   r   r   r      s*   r   N)commonr   utilsr   r   r   r   r   r   r   <module>   s   