3
b`/+                 @   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G d	d
 d
eZG dd deZ	G dd de	Z
G dd deZdS )    )unicode_literalsN   )MTVServicesInfoExtractor   )update_url_queryc            
   @   s   e Zd ZdZdZdZdgZddddd	d
dddddd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d Z	dS ) NickIEznick.comzqhttps?://(?P<domain>(?:(?:www|beta)\.)?nick(?:jr)?\.com)/(?:[^/]+/)?(?:videos/clip|[^/]+/videos)/(?P<id>[^/?#.]+)z2http://udat.mtvnservices.com/service1/dispatch.htmUSzOhttp://www.nick.com/videos/clip/alvinnn-and-the-chipmunks-112-full-episode.htmlZ 6e5adc1e28253bbb1b28ab05403dd4d4z$be6a17b0-412d-11e5-8ff7-0026b9414f30mp4z@ALVINNN!!! and The Chipmunks: "Mojo Missing/Who's The Animal" S1u   Alvin is convinced his mojo was in a cap he gave to a fan, and must find a way to get his hat back before the Chipmunks’ big concert.
During a costume visit to the zoo, Alvin finds himself mistaken for the real Tasmanian devil.)idexttitledescription)md5	info_dictZ d7be441fc53a1d4882fa9508a1e5b3cez$be6b8f96-412d-11e5-8ff7-0026b9414f30z@ALVINNN!!! and The Chipmunks: "Mojo Missing/Who's The Animal" S2Z efffe1728a234b2b0d2f2b343dd1946fz$be6cf7e6-412d-11e5-8ff7-0026b9414f30z@ALVINNN!!! and The Chipmunks: "Mojo Missing/Who's The Animal" S3Z 1ec6690733ab9f41709e274a1d5c7556z$be6e3354-412d-11e5-8ff7-0026b9414f30z@ALVINNN!!! and The Chipmunks: "Mojo Missing/Who's The Animal" S4)urlplaylistzShttp://www.nickjr.com/paw-patrol/videos/pups-save-a-goldrush-s3-ep302-full-episode/T)r   only_matchingz_http://beta.nick.com/nicky-ricky-dicky-and-dawn/videos/nicky-ricky-dicky-dawn-301-full-episode/c             C   s
   d|dS )NZnick_arc_player_prime)feedmgid )selfurir   r   EC:\Users\Broad\Desktop\All-Down\binaries\youtube_dl\extractor\nick.py_get_feed_queryB   s    zNickIE._get_feed_queryc             C   sD   t j| j|j \}}| jd| |d|id}| j|d |d  S )Nz"http://%s/data/video.endLevel.jsonZurlKey)queryplayerr
   )rematch
_VALID_URLgroups_download_json_get_videos_info)r   r   domain
display_id
video_datar   r   r   _real_extractH   s    zNickIE._real_extractN)
__name__
__module____qualname__IE_NAMEr   	_FEED_URL_GEO_COUNTRIES_TESTSr   r%   r   r   r   r   r   
   s>   



r   c               @   sH   e Zd ZdZdZddddddddddddd	ddgZd
d ZdS )NickBrIEznickelodeon:bra  (?x)
                    https?://
                        (?:
                            (?P<domain>(?:www\.)?nickjr|mundonick\.uol)\.com\.br|
                            (?:www\.)?nickjr\.[a-z]{2}|
                            (?:www\.)?nickelodeonjunior\.fr
                        )
                        /(?:programas/)?[^/]+/videos/(?:episodios/)?(?P<id>[^/?\#.]+)
                    zHhttp://www.nickjr.com.br/patrulha-canina/videos/210-labirinto-de-pipoca/T)r   r   zOhttp://mundonick.uol.com.br/programas/the-loud-house/videos/muitas-irmas/7ljo9jzGhttp://www.nickjr.nl/paw-patrol/videos/311-ge-wol-dig-om-terug-te-zijn/zahttp://www.nickjr.de/blaze-und-die-monster-maschinen/videos/f6caaf8f-e4e8-4cc1-b489-9380d6dcd059/zbhttp://www.nickelodeonjunior.fr/paw-patrol-la-pat-patrouille/videos/episode-401-entier-paw-patrol/c             C   s   t j| j|j \}}| j||}| jd|d}| j|}| jd||ddd|id}| j|d }|d	kr|j	d
r|dd  }ddd| }	||	|	d}
|dkrd|
d< t
d|
}| j||S )Nz!data-(?:contenturi|mgid)="([^"]+)r   z6http://media.mtvnservices.com/pmt/e1/access/index.htmledge)r   Z
configtypeReferer)r   headersfeedWithQueryParamsNonezwww.   zmundonick.com.brzbr.nickelodeonjunior.tv)zmundonick.uolZnickjr)r   ZimageEparcEpznickjr.com.brZc4b16088epz;http://feeds.mtvnservices.com/od/feed/intl-mrss-player-feed)r   r   r   r   _download_webpage_search_regex_id_from_urir    _remove_template_parameter
startswithr   _get_videos_info_from_url)r   r   r"   r#   webpager   video_idconfiginfo_urlZcontent_domainr   r   r   r   r%   n   s4    


zNickBrIE._real_extractN)r&   r'   r(   r)   r   r,   r%   r   r   r   r   r-   R   s   	
r-   c               @   sx   e Zd ZdZdZddddddddddddd	ddd
ddddddddddddddg
Zdd Zdd ZdS )NickDeIEznick.dezyhttps?://(?:www\.)?(?P<host>nick\.(?:de|com\.pl|ch)|nickelodeon\.(?:nl|be|at|dk|no|se))/[^/]+/(?:[^/]+/)*(?P<id>[^/?#&]+)zihttp://www.nick.de/playlist/3773-top-videos/videos/episode/17306-zu-wasser-und-zu-land-rauchende-erdnusseT)r   r   z#http://www.nick.de/shows/342-icarlyzjhttp://www.nickelodeon.nl/shows/474-spongebob/videos/17403-een-kijkje-in-de-keuken-met-sandy-van-binnenuitzZhttp://www.nickelodeon.at/playlist/3773-top-videos/videos/episode/77993-das-letzte-gefechtzfhttp://www.nick.com.pl/seriale/474-spongebob-kanciastoporty/wideo/17412-teatr-to-jest-to-rodeo-oszolomzahttp://www.nickelodeon.no/program/2626-bulderhuset/videoer/90947-femteklasse-veronica-vs-vanzillazEhttp://www.nickelodeon.dk/serier/2626-hojs-hus/videoer/761-tissepausez@http://www.nickelodeon.se/serier/2626-lugn-i-stormen/videos/998-zLhttp://www.nick.ch/shows/2304-adventure-time-abenteuerzeit-mit-finn-und-jakeznhttp://www.nickelodeon.be/afspeellijst/4530-top-videos/videos/episode/73917-inval-broodschapper-lariekoek-ariec             C   s   t | jd|dddd|iS )Nz#data-mrss=(["\'])(?P<url>http.+?)\1zmrss urlr   )groupZsiteKey)r   r7   )r   r<   hostr   r   r   _extract_mrss_url   s    zNickDeIE._extract_mrss_urlc             C   sF   t j| j|}|jd}|jd}| j||}| j||}| j||S )Nr
   rB   )r   r   r   rA   r6   rC   r;   )r   r   mobjr=   rB   r<   mrss_urlr   r   r   r%      s    

zNickDeIE._real_extractN)r&   r'   r(   r)   r   r,   rC   r%   r   r   r   r   r@      s0   
r@   c               @   s8   e Zd ZdZdZdddddddddgZdd	 Zd
S )NickNightIEZ	nicknightzbhttps?://(?:www\.)(?P<host>nicknight\.(?:de|at|tv))/(?:playlist|shows)/(?:[^/]+/)*(?P<id>[^/?#&]+)zKhttp://www.nicknight.at/shows/977-awkward/videos/85987-nimmer-beste-freundeT)r   r   z)http://www.nicknight.at/shows/977-awkwardz,http://www.nicknight.at/shows/1900-faking-itc             G   s   | j d|dddS )Nz$mrss\s*:\s*(["\'])(?P<url>http.+?)\1zmrss urlr   )rA   )r7   )r   r<   argsr   r   r   rC      s    zNickNightIE._extract_mrss_urlN)r&   r'   r(   r)   r   r,   rC   r   r   r   r   rF      s   
rF   c            
   @   s`   e Zd ZdZdZdddddd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 )NickRuIEZnickelodeonruz^https?://(?:www\.)nickelodeon\.(?:ru|fr|es|pt|ro|hu|com\.tr)/[^/]+/(?:[^/]+/)*(?P<id>[^/?#&]+)zxhttp://www.nickelodeon.ru/shows/henrydanger/videos/episodes/3-sezon-15-seriya-licenziya-na-polyot/pmomfb#playlist/7airc6T)r   r   zEhttp://www.nickelodeon.ru/videos/smotri-na-nickelodeon-v-iyule/g9hvh7zphttp://www.nickelodeon.fr/programmes/bob-l-eponge/videos/le-marathon-de-booh-kini-bottom-mardi-31-octobre/nfn7z0zEhttp://www.nickelodeon.es/videos/nickelodeon-consejos-tortitas/f7w7xyz]http://www.nickelodeon.pt/series/spongebob-squarepants/videos/a-bolha-de-tinta-gigante/xutq1bzShttp://www.nickelodeon.ro/emisiuni/shimmer-si-shine/video/nahal-din-bomboane/uw5u2kzhttp://www.nickelodeon.hu/musorok/spongyabob-kockanadrag/videok/episodes/buborekfujas-az-elszakadt-nadrag/q57iob#playlist/k6te4yzOhttp://www.nickelodeon.com.tr/programlar/sunger-bob/videolar/kayip-yatak/mgqbjyc             C   s.   | j |}| j||}| j|}| jd| S )Nz&http://media.mtvnservices.com/embed/%s)	_match_idr6   _extract_mgid
url_result)r   r   r=   r<   r   r   r   r   r%      s    

zNickRuIE._real_extractN)r&   r'   r(   r)   r   r,   r%   r   r   r   r   rH      s&   
rH   )
__future__r   r   mtvr   utilsr   r   r-   r@   rF   rH   r   r   r   r   <module>   s   H>4