
    VGh*                     >    d dl mZ ddlmZmZmZmZ  G d de      Zy)   )InfoExtractor   )int_or_nonestr_or_nonetry_geturl_or_nonec                   r    e Zd ZdZdZddddddd	d
dg dg dd
dddddddd	ddddgg dd
ddddgZd Zy)XinpianchangIEz/https?://(www\.)?xinpianchang\.com/(?P<id>a\d+)u	   新片场z&https://www.xinpianchang.com/a11766551	a11766551mp4u;   北京2022冬奥会闭幕式再见短片-冰墩墩下班了z$md5:4a730c10639a82190fabe921c0fa4b87   z,re:^https?://oss-xpc0\.xpccdn\.com.+/assets/u   正时文创10357277)u	   宣传片u   国家城市u   广告u   其他)u   北京冬奥会u	   冰墩墩u   再见u   告别u   冰墩墩哭了u   感动u	   闭幕式u   熄火)
idexttitledescriptionduration	thumbnailuploaderuploader_id
categoriestags)url	info_dictz&https://www.xinpianchang.com/a11762904	a11762904u3   冬奥会决胜时刻《法国派出三只鸡？》z$md5:55cb139ef8f48f0c877932d1f196df8b   u   精品动画10858927u   动画u   三维CG)u   France Télévisionsu
   法国3台u   蠢萌u	   冬奥会zghttps://www.xinpianchang.com/a11779743?from=IndexPick&part=%E7%BC%96%E8%BE%91%E7%B2%BE%E9%80%89&index=2T)r   only_matchingc                 J   | j                  |      }| j                  ||d|i      }| j                  ||      d   d   d   d   }| j                  d|d    |d	|d	   i
      d   }g i }}|j	                  d      j                         D ]  \  }}	|dv ro|	j	                  d      }
|
s|dk(  r| j                  |
|      \  }}n|dk(  r| j                  |
|      \  }}|j                         | j                  |      }z|dk(  s|j                  |	D cg c]g  }|j	                  d      sg rRt        |j	                  d            t        |j	                  d            t        |j	                  d            dddidi c}        ||j	                  d      |j	                  d      t        |j	                  d            |j	                  d      |j	                  d      |j	                  d      t        |d       t        t        |d              ||d!S c c}w )"NReferer)video_idheadersprops	pagePropsdetailvideoz2https://mod-api.xinpianchang.com/mod/api/v2/media/vidappKey)querydataresource)dashhlsr   r,   )r!   r-   progressivewidthheightr   Rangezbytes=0-)r   r/   r0   r   http_headersr   r   r   r   keywordscoverc                     | d   d   S )Nownerusername xs    f/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/yt_dlp/extractor/xinpianchang.py<lambda>z.XinpianchangIE._real_extract.<locals>.<lambda>V   s    '
:0F     c                     | d   d   S )Nr6   r   r8   r9   s    r;   r<   z.XinpianchangIE._real_extract.<locals>.<lambda>W   s    qz$?O r=   )r   r   r   r   r   r   r   r   r   formats	subtitles)	_match_id_download_webpage_search_nextjs_data_download_jsongetitems"_extract_mpd_formats_and_subtitles#_extract_m3u8_formats_and_subtitlesextend_merge_subtitlesr   r   r   r   )selfr   r!   webpage
video_datar*   r?   r@   kvv_urlfmtssubsprogs                 r;   _real_extractzXinpianchangIE._real_extract.   s<   >>#&((x)UXIY(Z--gx@I+VW_`ahi
""@EAR@STV^Z12 # 44:<  HHZ(..0 	;DAqO#e;!%!H!HYa!H!bJD$%Z!%!I!I%Zb!I!cJD$t$ 11)TB	m#  	 : 488E?b 'txx7('):;)$((8*<=   %	! 	 : 	;	;0 XXg&88M2#DHHZ$89((<0HHZ('*&FG&wt5O'PQ"
 	
	 :s   A,H 
N)__name__
__module____qualname__
_VALID_URLIE_DESC_TESTSrT   r8   r=   r;   r
   r
   
   s    CJG7RAH&%K|
 8JAH&%#Z0Q
 y9FB,
r=   r
   N)commonr   utilsr   r   r   r   r
   r8   r=   r;   <module>r]      s     ! P
] P
r=   