U
    $PfZ                     @   s@   d dl mZ d dlZddlmZ ddlmZ G dd deZdS )    )unicode_literalsN   )InfoExtractor)OoyalaIEc                   @   sd   e Zd ZdZdddddddd	id
gddddddddddddddd	id
gdgZdd ZdS )
NintendoIEzRhttps?://(?:www\.)?nintendo\.com/(?:games/detail|nintendo-direct)/(?P<id>[^/?#&]+)z6https://www.nintendo.com/games/detail/duck-hunt-wii-u/Z MzMmticjp0VPzO3CCj4rmFOuohEuEWoWZflvz Duck Hunt Wii U VC NES - Trailerg}?5^)N@)idexttitledurationZskip_downloadTZOoyala)url	info_dictparamsZadd_iezChttp://www.nintendo.com/games/detail/tokyo-mirage-sessions-fe-wii-uztokyo-mirage-sessions-fe-wii-uu   Tokyo Mirage Sessions ♯FE)r   r	      )r   r   Zplaylist_countz4https://www.nintendo.com/nintendo-direct/09-04-2019/Z J2bXdmaTE6fe3dWJTPcc7m23FNbc_A1VZmp4zSwitch_ROS_ND0904-H264.movgt)@c                 C   sL   |  |}| ||}dd td|D }| jd|ddd}| |||S )Nc                 S   s   g | ]}t |d qS )code)r   Z_build_url_resultgroup).0m r   A/tmp/pip-unpacked-wheel-7zdooeg3/youtube_dl/extractor/nintendo.py
<listcomp>2   s   z,NintendoIE._real_extract.<locals>.<listcomp>z?data-(?:video-id|directVideoId)=(["\'])(?P<code>(?:(?!\1).)+)\1zF(?s)<(?:span|div)[^>]+class="(?:title|wrapper)"[^>]*>.*?<h1>(.+?)</h1>r	   F)fatal)Z	_match_idZ_download_webpagerefinditerZ_html_search_regexZplaylist_result)selfr   Zpage_idZwebpageentriesr	   r   r   r   _real_extract-   s&    
     zNintendoIE._real_extractN)__name__
__module____qualname__Z
_VALID_URLZ_TESTSr   r   r   r   r   r   
   s>     !r   )
__future__r   r   commonr   Zooyalar   r   r   r   r   r   <module>   s   