Ë
    ÛÍ:j  ã                   ó¬   — d dl Z d dlZd dlZd dlZd dlmZ d dlmZ  ej                  e	«      Z
ddedee   fd„Zdededefd	„Zdedefd
„Zdedefd„Zy)é    N)ÚIterator)ÚurlopenÚcheck_writableÚreturnc              #   óø  K  — 	 t         j                  d   –— t         j                  dk(  r2t         j                  j                  t        j                  dd«      –— y g d¢}t        t        d«      r |j                  dt        j                  «       |D ]’  }t         j                  j                  |dd«      }| rit         j                  j                  |«      r%t        j                  |t         j                  «      s&Œjt        j                  |t         j                  «      sŒ�|–— Œ” t         j                  j                  t         j                  j                  d«      d	d«      –— y # t        $ r Y �Œ]w xY w­w)
NÚPYAV_TESTDATA_DIRÚntÚpyavÚdatasets)z/usr/local/sharez/usr/local/libz
/usr/sharez/usr/libÚreal_prefixr   ú~z.pyav)ÚosÚenvironÚKeyErrorÚnameÚpathÚjoinÚsysÚprefixÚhasattrÚinsertÚexistsÚaccessÚW_OKÚ
expanduser)r   ÚbasesÚbaseÚdir_s       ú`/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/av/datasets.pyÚiter_data_dirsr       s  è ø€ ðÜ�j‰jÐ,Ñ-Ò-ô 
‡w�w�$‚Ü�g‰g�l‰lœ3Ÿ:™: v¨zÓ:Ò:Øò€Eô Œs�MÔ"Ø�‰�QœŸ
™
Ô#àò 	ˆÜ�w‰w�|‰|˜D &¨*Ó5ˆÙÜ�w‰w�~‰~˜dÔ#Ü—y‘y ¤r§w¡wÔ/Øä—y‘y ¤r§w¡wÔ/ØØ‹
ð	ô �'‰'�,‰,”r—w‘w×)Ñ)¨#Ó.°¸Ó
DÓDøô; ò Úðüs(   ‚E:„E* ™EE:Å*	E7Å3E:Å6E7Å7E:Úurlr   c                 ó¼  — t         j                  j                  |«      }||k7  rt        |› d�«      ‚t	        «       D ]E  }t         j                  j                  ||«      }t         j                  j                  |«      sŒC|c S  t        t	        d«      «      }t         j                  j                  ||«      }t        j                  d| › d|› �«       t        | «      }|j                  «       dk7  rt        d|j                  «       › �«      ‚t         j                  j                  |«      }	 t        j                  |«       |dz   }t#        |d	«      5 }	 |j%                  d
«      }	|	r|j'                  |	«       nnŒ'	 ddd«       t        j(                  ||«       |S # t        $ r(}|j                  t        j                   k7  r‚ Y d}~Œ‡d}~ww xY w# 1 sw Y   ŒUxY w)ag  Download the data at a URL, and cache it under the given name.

    The file is stored under `pyav/test` with the given name in the directory
    :envvar:`PYAV_TESTDATA_DIR`, or the first that is writeable of:

    - the current virtualenv
    - ``/usr/local/share``
    - ``/usr/local/lib``
    - ``/usr/share``
    - ``/usr/lib``
    - the user's home

    z is not normalized.TzDownloading z to éÈ   zHTTP Nz.tmpÚwbi   )r   r   ÚnormpathÚ
ValueErrorr    r   r   ÚnextÚlogÚinfor   ÚgetcodeÚdirnameÚmakedirsÚOSErrorÚerrnoÚEEXISTÚopenÚreadÚwriteÚrename)
r!   r   Ú
clean_namer   r   ÚresponseÚeÚtmp_pathÚfhÚchunks
             r   Úcached_downloadr:   .   sœ  € ô —‘×!Ñ! $Ó'€JØ�TÒÜ˜D˜6Ð!4Ð5Ó6Ð6äÓ ò ˆÜ�w‰w�|‰|˜D $Ó'ˆÜ�7‰7�>‰>˜$ÕØŠKðô
 ”˜tÓ$Ó%€DÜ�7‰7�<‰<˜˜dÓ#€Dä‡H�Hˆ|˜C˜5  T FÐ+Ô,ä�s‹|€HØ×ÑÓ˜SÒ Ü˜5 ×!1Ñ!1Ó!3Ð 4Ð5Ó6Ð6ä�7‰7�?‰?˜4Ó €DðÜ
�‰�DÔð
 �f‰}€HÜ	ˆh˜Ó	ð  ØØ—M‘M $Ó'ˆEÙØ—‘˜•àð ð
 ÷ô ‡I�Iˆh˜Ôà€Køô ò Ø�7‰7”e—l‘lÒ"Øô #ûðú÷
ð ús$   Ä.F Å)GÆ	GÆ'G
Ç
GÇGc           
      ó¬   — t        d| z   t        j                  j                  d| j	                  dt        j                  j
                  «      «      «      S )zÎDownload and return a path to a sample from the FFmpeg test suite.

    Data is handled by :func:`cached_download`.

    See the `FFmpeg Automated Test Environment <https://www.ffmpeg.org/fate.html>`_

    z"http://fate.ffmpeg.org/fate-suite/z
fate-suiteú/©r:   r   r   r   ÚreplaceÚsep©r   s    r   ÚfaterA   d   s>   € ô Ø,¨tÑ3Ü
�‰�‰�\ 4§<¡<°´R·W±W·[±[Ó#AÓBóð ó    c           
      ó¬   — t        d| z   t        j                  j                  d| j	                  dt        j                  j
                  «      «      «      S )z…Download and return a path to a sample that is curated by the PyAV developers.

    Data is handled by :func:`cached_download`.

    zhttps://pyav.org/datasets/zpyav-curatedr<   r=   r@   s    r   ÚcuratedrD   r   s>   € ô Ø$ tÑ+Ü
�‰�‰�^ T§\¡\°#´r·w±w·{±{Ó%CÓDóð rB   )F)r.   Úloggingr   r   Útypingr   Úurllib.requestr   Ú	getLoggerÚ__name__r(   ÚboolÚstrr    r:   rA   rD   © rB   r   ú<module>rM      s…   ðÛ Û Û 	Û 
Ý Ý "à€g×Ñ˜Ó!€ñ E 4ð  E°H¸S±Mó  EðF3˜ð 3 Cð 3¨Có 3ðlˆsð �só ð	�#ð 	˜#ô 	rB   