U
    y^	                     @   sX   d dl mZ d dlZddlmZ ddlmZmZmZm	Z	m
Z
 dd ZG d	d
 d
eZdS )    )unicode_literalsN   )InfoExtractor   )ExtractorErrorsanitized_Requesturlencode_postdata
xpath_textxpath_with_nsc                 C   s   t | ddiS )Nxspfzhttp://xspf.org/ns/0/)r
   )p r   PC:\Users\TaGoRe\Desktop\beinconnect-dl\binaries\youtube_dl\extractor\nosvideo.py<lambda>       r   c                   @   s6   e Zd ZdZdZdZdddddd	d
dZdd ZdS )
NosVideoIEzIhttps?://(?:www\.)?nosvideo\.com/(?:embed/|\?v=)(?P<id>[A-Za-z0-9]{12})/?z&http://nosvideo.com/xml/{xml_id:s}.xmlz<b>File Not Found</b>z#http://nosvideo.com/?v=mu8fle7g7rpqZ 6124ed47130d8be3eacae635b071e6b6Zmu8fle7g7rpqmp4z(big_buck_bunny_480p_surround-fix.avi.mp4zre:^https?://.*\.jpg$)idexttitle	thumbnail)urlmd5	info_dictc                 C   s  |  |}|ddd}t|t|}|dd | ||d}t| j|d k	r`td| dd	| 	d
|d}| j
j|d}| ||}|td}	|	d krtddd	t|	tdd}
t|	tdddd}t|	tdd}|
d k	r|
 }
d|dg}||
||dS )N	download1zContinue to Video)r   opZmethod_freezContent-typez!application/x-www-form-urlencodedzDownloading download pagezVideo %s does not existT)expectedzphp\|([^\|]+)\|zXML ID)xml_idz.//xspf:trackz+XML playlist is missing the 'track' elementz./xspf:titler   z./xspf:fileURL)fatalz./xspf:imager   sd)	format_idr   )r   r   r   formats)	_match_idr   r   
add_header_download_webpageresearch_FILE_DELETED_REGEXr   _search_regex_PLAYLIST_URLformat_download_xmlfind_xr	   strip)selfr   video_idfieldsreqwebpager   playlist_urlplaylisttrackr   r   r"   r   r   r   _real_extract"   sH    
zNosVideoIE._real_extractN)__name__
__module____qualname__
_VALID_URLr*   r(   _TESTr8   r   r   r   r   r      s   r   )
__future__r   r&   commonr   utilsr   r   r   r	   r
   r.   r   r   r   r   r   <module>   s
   