
    V|hG                     X    S SK r SSKJr  SSKJrJrJr   " S S\5      r " S S	\5      rg)
    N   )InfoExtractor   )ExtractorErrorint_or_noneparse_iso8601c                   d    \ 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./rS rSrg)	MySpaceIE   a0  (?x)
                    https?://
                        myspace\.com/[^/]+/
                        (?P<mediatype>
                            video/[^/]+/(?P<video_id>\d+)|
                            music/song/[^/?#&]+-(?P<song_id>\d+)-\d+(?:[/?#&]|$)
                        )
                    zIhttps://myspace.com/fiveminutestothestage/video/little-big-town/109594919 9c1483c106f4a695c47d2911feed50a7	109594919mp4zLittle Big Townu   This country quartet was all smiles while playing a sold out show at the Pacific Amphitheatre in Orange County, California.zFive Minutes to the StagefiveminutestothestageiOIT20141023)idexttitledescriptionuploaderuploader_id	timestampupload_date)urlmd5	info_dictzPhttps://myspace.com/killsorrow/music/song/of-weakened-soul...-93388656-103880681 1d7ee4604a3da226dd69a123f748b26293388656m4azOf weakened soul...
Killsorrow
killsorrow)r   r   r   r   r   zFhttps://myspace.com/starset2/music/song/first-light-95799905-106964426T)r   only_matchingzXhttps://myspace.com/thelargemouthbassband/music/song/02-pure-eyes.mp3-94422330-105113388c                 Z  ^ ^^^ T R                  U5      nUR                  S5      =(       d    UR                  S5      nUR                  S5      R                  S5      mT R                  X5      nT R	                  SUSSS9mS0UU4S	 jjnT(       Ga  T R	                  S
U S3USS SS9mTc  T R                  U S35        g U U4S jnU" U" S5      U" S5      U" S5      5      nU(       dt  U" S5      nU" S5      n	U(       a'  T R                  SU 35        T R                  SU 3SS9$ U	(       a$  T R                  SU	 35        T R                  U	SS9$ [        S5      eUT R                  U5      U" S5      U" S5      T R                  U5      [        U" S5      5      US .$ T R                  T R	                  S!US"5      U5      S#   n
U" U
R                  S$5      U
R                  S%5      U
R                  S&5      [        U
R                  S'5      5      [        U
R                  S(5      5      5      nUU
S)   U
R                  S*5      U
R                  S+5      U
R                  S,5      U
R                  S-5      [        U
R                  S5      5      [        U
R                  S.5      5      US/.	$ )1Nvideo_idsong_id	mediatypez
music/songzvideoSwf":"([^"?]*)z
player URLF)fatalc                 &  > / nT	(       a  SOS nU(       a   UR                  SUST	(       a  SOSUS.5        U (       a6  T
(       a/  U R                  SS5      u  pxUR                  S	UUT
S	S
UUUS.	5        U(       a  UR                  SUUUUS.5        U$ )Nnonehlsm3u8_nativer   r   )	format_idr   protocolr   vcodec;r   rtmpflv)	r+   r   	play_path
player_urlr,   r   widthheightr-   http)r+   r   r3   r4   r-   )appendsplit)
stream_urlhls_stream_urlhttp_stream_urlr3   r4   formatsr-   rtmp_urlr1   is_songr2   s            R/home/james-whalen/.local/lib/python3.13/site-packages/yt_dlp/extractor/myspace.pyformats_from_stream_urls9MySpaceIE._real_extract.<locals>.formats_from_stream_urls=   s    G&VDF!&) -$+5$   j&0&6&6sA&>#!'#!*", & "$$
  
 !'*"$$   N    z<button.*data-song-id=(["\'])z\1.*	song_datar   defaultgroupz#: No downloadable song on this pagec                 2   > TR                  SU  S3TU SSS9$ )Nzdata-z=([\'"])(?P<data>.*?)\1 datarC   )_search_regex)nameselfrB   s    r>   search_data,MySpaceIE._real_extract.<locals>.search_dataj   s1    ))tf$;>tRv * ? ?rA   z
stream-urlzhls-stream-urlzhttp-stream-urlzvevo-idz
youtube-idzVevo video detected: zvevo:VevoiezYoutube video detected: Youtubez,Found song but don't know how to download itzartist-namezartist-usernameduration)r   r   r   r   	thumbnailrR   r;   zcontext = ({.*?});contextvideo	streamUrlhlsStreamUrlmp4StreamUrlr3   r4   r   r   imageUrl
artistNameartistUsername	dateAdded)	r   r   r   rS   r   r   rR   r   r;   )NN)_match_valid_urlrE   
startswith_download_webpagerI   report_warning	to_screen
url_resultr   _og_search_title_og_search_thumbnailr   _parse_jsongetr   )rK   r   mobjr#   webpager?   rL   r;   vevo_id
youtube_idrU   r=   r2   rB   s   `          @@@r>   _real_extractMySpaceIE._real_extract5   s   $$S)::j)BTZZ	-B**[)44\B((7''"G\ ( H
 	  	D **28*DCd! + =I  ##j CDF? /L);7G+H-.0G %i0(6
NN%:7)#DE??U7)+<?HHNN%=j\#JK??:)?DD(GI I ..w7'6*+<=!66w?'J(?@"  $$T%7%7%w	&;!#E /		+&		.(A		.);uyy7I+JEIIh/02G
 w$yy7"YYz2!IIl3$yy)9:'		*(=>*599[+AB"
 
rA    N)__name__
__module____qualname____firstlineno__
_VALID_URL_TESTSrk   __static_attributes__rm   rA   r>   r
   r
      s    J [1& ]32#%	
 b1*$'
	 X j7F@crA   r
   c                   H    \ rS rSrSrSrSSSS.SS	S
.SSSS.SS./rS rSrg)MySpaceAlbumIE   zMySpace:albumzChttps?://myspace\.com/([^/]+)/music/album/(?P<title>.*-)(?P<id>\d+)z?https://myspace.com/starset2/music/album/transmissions-19455773Transmissions19455773)r   r      z.this album is only available in some countries)r   r   playlist_countskipz<https://myspace.com/killsorrow/music/album/the-demo-18596029zThe Demo18596029   )r   r   r{   c                    U R                  U5      nUR                  S5      nUR                  S5      U-   nU R                  X5      n[        R                  " SU5      nU(       d  [        U S3SS9eU Vs/ s H%  nU R                  U[        R                  5       S9PM'     nnSUUU R                  U5      US	.$ s  snf )
Nr   r   z"music:song" content="(.*?)"z!: No songs found, try using proxyT)expectedrO   playlist)_typer   
display_idr   entries)
r]   rE   r_   refindallr   rb   r
   ie_keyrc   )	rK   r   rg   playlist_idr   rh   tracks_pathst_pathr   s	            r>   rk   MySpaceAlbumIE._real_extract   s    $$S)jj&ZZ(;6
((9zz"A7K ,?@ 
 '(& OOFy'7'7'9O:& 	 (  $**73
 	
(s   7,B<rm   N)	rn   ro   rp   rq   IE_NAMErr   rs   rk   rt   rm   rA   r>   rv   rv      sQ    GWJ Q$
 @ N
 F"
rA   rv   )	r   commonr   utilsr   r   r   r
   rv   rm   rA   r>   <module>r      s0    	 ! M M`(
] (
rA   