
    V|h                     Z    S SK r S SKrSSKJr  SSKJrJrJrJ	r	  SSK
Jr   " S S\5      rg)	    N   )InfoExtractor   )ExtractorErrorparse_iso8601update_url_queryurl_or_none)traverse_objc                   ~    \ rS rSrSrSSSSSSS	S
SS.SS0S.SSSSSSSSS.SS0S.SSSSSSSSS.SS0S./rS  rS!rg")#BoxIE   zdhttps?://(?:[^.]+\.)?(?P<service>app|ent)\.box\.com/s/(?P<shared_name>[^/?#]+)(?:/file/(?P<id>\d+))?zRhttps://mlssoccer.app.box.com/s/0evd2o3e08l60lr4ygukepvnkord1o1x/file/510727257538 1f81b2fd3960f38a40a3b8823e5fcd43510727257538mp4z7Garber   St. Louis will be 28th MLS team  +scarving.mp4 i&\]20190820	235196876)idexttitleuploader	timestampupload_dateuploader_idskip_downloadzdash fragment too small)urlmd5	info_dictparamsz=https://utexas.app.box.com/s/2x6vanv85fdl8j2eqlcxmv0gp1wvps6e787379022466z%Webinar recording: Take the Leap!.mp4zPatricia MoseleiO`20210315	239068974)r   r   r   z^https://thejacksonlaboratory.ent.box.com/s/2x09dm6vcg6y28o0oox1so4l0t8wzt6l/file/1536173056065153617305606518523128264zLexi Henniganz#iPSC Symposium recording part 1.mp4iKf20240520)r   r   r   r   r   r   r   c           
      ~   U R                  U5      R                  SSS5      u  p#nU R                  X=(       d    U5      nU(       d]  U R                  SUSU5      n[	        US[
        145      =(       d    0 nUR                  S5      S:w  a
  [        S	S
S9e[        US   5      nU R                  SUSU5      S   nU R                  SU S3US[        R                  " SU/05      R                  5       SUSU-   S.S9U   S   n	SU SU 3n
U R                  SU-   USSU	-   SU
-   SS.S S!0S"9nUS#   nU	U
S$.n/ n[	        US%S&S' S(S)[        145       Hw  n[        UR                  S*S+5      U5      nU R!                  UU5      nU H/  n["        R$                  R'                  U5      R(                  US,'   M1     UR+                  U5        My     UR                  S-5      =(       d    0 nUUUUR                  S.5      =(       d    S UR                  S#5      [-        UR                  S/5      5      UR                  S5      S0.$ )1Nshared_namer   servicezBox\.postStreamData\s*=zBox post-stream dataz/app-api/enduserapp/shared-itemitemTypefilez$The requested resource is not a fileT)expecteditemIDzBox\.config\s*=z
Box configrequestTokenzhttps://z+.box.com/app-api/enduserapp/elements/tokenszDownloading token JSON metadatafileIDszapplication/jsonzsharedName=)zContent-TypezX-Request-TokenzX-Box-EndUser-API)dataheadersreadz.box.com/s/zhttps://api.box.com/2.0/files/zDownloading file JSON metadatazBearer zshared_link=z[dash])AuthorizationBoxApizX-Rep-Hintsfieldszvauthenticated_download_url,created_at,created_by,description,extension,is_download_available,name,representations,size)r0   queryname)access_tokenshared_linkrepresentationsentriesc                     US   S:H  $ )Nrepresentationdash )_vs     N/home/james-whalen/.local/lib/python3.13/site-packages/yt_dlp/extractor/box.py<lambda>%BoxIE._real_extract.<locals>.<lambda>c   s    q9I7Jf7T    contenturl_templatez{+asset_path}zmanifest.mpdextra_param_to_segment_url
created_bydescription
created_at)r   r   formatsrI   r   r   r   )_match_valid_urlgroup_download_webpage_search_jsonr
   dictgetr   str_download_jsonjsondumpsencoder	   r   replace_extract_mpd_formatsurllibparseurlparser5   extendr   )selfr   r'   file_idr(   webpagepost_stream_datashared_itemrequest_tokenr7   r8   fr   r5   rK   url_tmplmanifest_urlfmtsfmtcreators                       rA   _real_extractBoxIE._real_extract7   s   (,(=(=c(B(H(HX\^g(h%g((.DE#00*G5K[ Z& #Dtf"MO URT z*f4$%KVZ[[+h/0G))w@@NP**wiJKW-Y	23::< 2#0%2[%@G +     !	[MB,w6,!*\!9(;6'7
   S    &	 )&

 $Qy*T~})
 H ,H,<,<_n,]_deL,,\7CD4:LL4I4I,4W4]4]01 NN4  %%%+ 55/74F+&quu\':;";;t,
 	
rD   r>   N)__name__
__module____qualname____firstlineno__
_VALID_URL_TESTSri   __static_attributes__r>   rD   rA   r   r      s    xJc1 N#%&
 #$=> O <)#%&
 #$=> p!(':#%
 #$=>3%FN?
rD   r   )rT   urllib.parserY   commonr   utilsr   r   r   r	   utils.traversalr
   r   r>   rD   rA   <module>rv      s+      !  +h
M h
rD   