
    V|h'                         S SK r SSKJr  SSKJr  SSKJrJrJrJ	r	J
r
JrJrJrJrJrJr   " S S\5      r " S	 S
\5      rg)    N   )InfoExtractor)
VHXEmbedIE   )ExtractorErrorOnDemandPagedList
clean_htmlextract_attributesget_element_by_classget_element_by_idget_elements_html_by_classint_or_nonetraverse_objunified_strdateurlencode_postdatac                      \ rS rSrSrSrSrSSS0 SS	_S
S_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS _S!S"_S#S$_S%S&_S'S(/S).S*S+S,S-S.SS/S0S1S2S3S4S3S/S5S"S$S&S6.S'S(/S).S7S8S9S:S;SS<S=S>S?S@S"S$S&SA.S'S(/S)./rSB rSC r	SD r
SErgF)G	DropoutIE   zhttps://watch.dropout.tv/logindropoutzPhttps?://(?:watch\.)?dropout\.tv/(?:[^/?#]+/)*videos/(?P<id>[^/?#]+)/?(?:[?#]|$)z?https://watch.dropout.tv/game-changer/season:2/videos/yes-or-nozEpisode in a series 4b76963f904f8bc4ba22dcf0e66ada06id738153
display_idz	yes-or-noextmp4titlez	Yes or NodescriptionzRAlly, Brennan, and Zac are asked a simple question, but is there a correct answer?release_date20200508	thumbnailzYhttps://vhx.imgix.net/chuncensoredstaging/assets/351e3f24-c4a3-459a-8b79-dc80f1e5b7fd.jpgserieszGame Changerseason_numberr   seasonzSeason 2episode_number   episodedurationi  uploader_iduser80538407uploader_urlzhttps://vimeo.com/user80538407uploaderz
OTT Videosz2Ignoring subtitle tracks found in the HLS manifestz$Failed to parse XML: not well-formed)urlnotemd5	info_dictexpected_warningszghttps://watch.dropout.tv/tablepop-presents-megadungeon-live/season:1/videos/enter-through-the-gift-shopz*Episode in a series (missing release_date) b08fb03050585ea25cd7ee092db9134c624270zenter-through-the-gift-shopzEnter Through the Gift ShopzdA new adventuring party explores a gift shop and runs into a friendly orc -- and some angry goblins.zYhttps://vhx.imgix.net/chuncensoredstaging/assets/a1d876c3-3dee-4cd0-87c6-27a851b1d0ec.jpgz$TablePop Presents: MEGADUNGEON LIVE!r   zSeason 1i  )r   r   r   r   r   r    r!   r"   r#   r$   r&   r'   r(   r*   r+   z=https://watch.dropout.tv/videos/misfits-magic-holiday-specialzEpisode not in a series 1e6428f7756b02c93b573d39ddd789fe1915774zmisfits-magic-holiday-specialzMisfits & Magic Holiday SpecialzQThe magical misfits spend Christmas break at Gowpenny, with an unwelcome visitor.20211215zbhttps://vhx.imgix.net/chuncensoredstaging/assets/d91ea8a6-b250-42ed-907e-b30fb1c65176-8e24b8e5.jpgi-  )r   r   r   r   r   r   r    r'   r(   r*   r+   c                 ^    U R                  U R                  USS9nU R                  SUS5      $ )NzGetting authenticity token)r-   z7name=["\']authenticity_token["\'] value=["\'](.+?)["\']authenticity_token)_download_webpage
_LOGIN_URL_html_search_regex)selfr   signin_pages      R/home/james-whalen/.local/lib/python3.13/site-packages/yt_dlp/extractor/dropout.py_get_authenticity_token!DropoutIE._get_authenticity_token^   s@    ,,OOZ.J - L&&F-/ 	/    c                 $   U R                  5       u  p#U(       d  gU R                  U R                  USS[        UUU R	                  U5      SS.5      S9nU R                  SUSSS	9nUR                  5       S
:X  a  g UR                  5       S:X  a  gg)NTz
Logging inF)emailpasswordr7   utf8)r-   fataldataz(user_has_subscription:\s*["\'](.+?)["\']zsubscription statusnonedefaulttruefalsezAccount is not subscribedzIncorrect username/password)_get_login_infor8   r9   r   r>   _search_regexlower)r;   r   usernamerC   responseuser_has_subscriptions         r=   _loginDropoutIE._logine   s    !113))OOZl%#!$&*&B&B:&N	%  *  !% 2 27CXbh !3 !j &&(F2"((*g5.0r@   c                    U R                  U5      nS nU R                  S5      R                  S5      (       a  U R                  X5      nU(       a  SU;   aM  U R	                  U5      nU R                  X5      nU(       a$  SU;   a  USL a  U R                  SS9  [        USS9eU R                  SUS	5      nU R                  U5      n[        S
U5      =(       d    Sn[        [        SU5      5      n[        S[        SU5      5      n	[        U R                  SU	=(       d    SSS S95      n
S[        R                  " 5       [        R                   " US5      U R                  SUS5      UUU R#                  SUSS9U(       a  UR%                  S5      S   OS [        [        SU5      5      U
U
(       a  UOS [        U R                  SU	=(       d    SSS S95      ['        U R                  SUSS S95      S.$ ) Nzhttps://watch.dropout.tv_sessionz<div id="watch-unauthorized"Tany)method)expectedzembed_url:\s*["\'](.+?)["\']z	embed urlz
watch-info zvideo-titlezsite-font-secondary-colortextzEpisode (\d+)r&   rH   url_transparentzembed\.vhx\.tv/videos/(.+?)\?r   r   F)rE   ?r   zseries-titlezSeason (\d+),r#   zRdata-meta-field-name=["\']release_dates["\'] data-meta-field-value=["\'](.+?)["\']zrelease date)_typeie_keyr,   r   r   r   r   r    r!   r$   r&   r"   r   )	_match_id_get_cookiesgetr8   rR   raise_login_requiredr   r:   _og_search_thumbnailr   r	   r   r   rM   r   r^   _smuggle_referrer_html_search_metasplitr   )r;   r,   r   webpage	login_err	embed_urlr    
watch_infor   season_episoder$   s              r=   _real_extractDropoutIE._real_extract|   s   ^^C(
78<<ZHH,,S=G8GCJ/I,,S=G;wF$--U-;$Y>>++,KWVab	--g6	&|W=C
/zJK-')=fj)QS$T%7%7n2It &8 &M N ' '')//	;UV$$%EyRVW$11-PU1V4=-a04 !5nj!QR, .uD();); ."6B$ *< *P Q+D,>,>eND -? -: ;
 	
r@    N)__name__
__module____qualname____firstlineno__r9   _NETRC_MACHINE
_VALID_URL_TESTSr>   rR   rl   __static_attributes__rn   r@   r=   r   r      s   1JNdJ U)5hk u 	
 s 
 x .   * !! ; D ~  @  L!$ #WX~!-	
2 }@5;6  Fx@!"$"#8 - @(" #WX~!+	
0 S-5=:r * B!- @( #WX~!#	
aCFJ/1.)
r@   r   c            	       t    \ rS rSrSrSrSSSSSS.S	.S
SSSSS.S	.SSSSSS.S	.SSSSSS.S	./rS rS rSr	g)DropoutSeasonIE      zXhttps?://(?:watch\.)?dropout\.tv/(?P<id>[^\/$&?#]+)(?:/?$|/season:(?P<season>[0-9]+)/?$)z;https://watch.dropout.tv/dimension-20-fantasy-high/season:1z.Multi-season series with the season in the urlz"dimension-20-fantasy-high-season-1z$Dimension 20 Fantasy High - Season 1)r   r   )r,   r-   playlist_countr/   z2https://watch.dropout.tv/dimension-20-fantasy-highz2Multi-season series with the season not in the urlz1https://watch.dropout.tv/dimension-20-shriek-weekzSingle-season series   z!dimension-20-shriek-week-season-1z#Dimension 20 Shriek Week - Season 1zAhttps://watch.dropout.tv/breaking-news-no-laugh-newsroom/season:3zCMulti-season series with season in the url that requires pagination   z(breaking-news-no-laugh-newsroom-season-3z*Breaking News No Laugh Newsroom - Season 3c              #      #    US-  nU R                  U SU 3USU 3S1S9n[        [        SU5      S[        1S45       Vs/ s H  oPR	                  U[
        5      PM     sn S h  vN   g s  snf  N
7f)	Nr   z?page=zDownloading page i  )r-   expected_statuszbrowse-item-link.href)r8   r   r   r
   
url_resultr   )r;   r,   	season_idpagerg   item_urls         r=   _fetch_pageDropoutSeasonIE._fetch_page   s     	((e6$ )4EdV2L_b^c ) eIU&'97CcL^K_agEhJj k JjXOOHi8 Jj k 	k 	k k 	ks   AA5A."A5(A3)A5c           	      V   U R                  U5      nU R                  U5      R                  S5      =(       d    SnUR                  SS5      R	                  5       nU R                  [        [        R                  " U R                  X5      U R                  5      U SU 3U SU 35      $ )Nr#   r   - z-season-z
 - Season )r_   _match_valid_urlgroupreplacer   playlist_resultr   	functoolspartialr   
_PAGE_SIZE)r;   r,   r   
season_numseason_titles        r=   rl   DropoutSeasonIE._real_extract   s    NN3'	**3/55h?D1
 ((c288:##i//0@0@#QSWSbSbck*.<.
:,0WY 	Yr@   rn   N)
ro   rp   rq   rr   r   rt   ru   r   rl   rv   rn   r@   r=   rx   rx      s    JlJ QD :?		
 HH :?		
 G*9>		
 WY @E		
9%FNkYr@   rx   )r   commonr   vimeor   utilsr   r   r	   r
   r   r   r   r   r   r   r   r   rx   rn   r@   r=   <module>r      s?     !    Q
 Q
h8Ym 8Yr@   