
    V|h                     R    S SK r S SKrSSKJr  SSKJrJrJrJrJ	r	   " S S\5      r
g)    N   )PostProcessor   )PostProcessingErrorXAttrMetadataErrorXAttrUnavailableErrorhyphenate_datewrite_xattrc                   6    \ rS rSrSrSSSSSSSS	.rS
rS rSrg)XAttrMetadataPP   a  Set extended attributes on downloaded file (if xattr support is found)

More info about extended attributes for media:
    http://freedesktop.org/wiki/CommonExtendedAttributes/
    http://www.freedesktop.org/wiki/PhreedomDraft/
    http://dublincore.org/documents/usageguide/elements.shtml

TODO:
    * capture youtube keywords and put them in 'user.dublincore.subject' (comma-separated)
    * figure out which xattrs can be used for 'duration', 'thumbnail', 'resolution'
webpage_urltitleupload_dateuploaderformatdescription)zuser.xdg.referrer.urlzuser.dublincore.titlezuser.dublincore.datezuser.dublincore.contributorzuser.dublincore.formatzuser.dublincore.description$com.apple.metadata:kMDItemWhereFromsz<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
	<string>%s</string>
</array>
</plist>c                 ,   [         R                  " US   5      R                  nU R                  S5        U R                  R                  5        Hz  u  p4 UR                  U5      nU(       a\  US:X  a  [        U5      nO+US:X  a%  [        R                  S:w  a  ML  U R                  U-  n[        US   X5R                  5       5        Mz  M|     U R)                  US   X"5        / U4$ ! [         a  n[        [        U5      5      eS nAf[          a  nUR"                  S:X  a  U R%                  SU S35         S nAM  UR"                  S	:X  a  U R%                  S
U S35         S nAGM  [         R&                  S:X  a  SOSn[        SU 35      eS nAff = f)Nfilepathz!Writing metadata to file's xattrsr   r   darwinNO_SPACEzhThere's no disk space left, disk quota exceeded or filesystem xattr limit exceeded. Extended attribute "z" was not written.VALUE_TOO_LONGz$Unable to write extended attribute "z" due to too long values.ntzYou need to use NTFSz0You may have to enable them in your "/etc/fstab"z5This filesystem doesn't support extended attributes. )osstatst_mtime	to_screenXATTR_MAPPINGitemsgetr	   sysplatformAPPLE_PLIST_TEMPLATEr
   encoder   r   strr   reasonreport_warningname	try_utime)selfinfomtime	xattrnameinfonamevalueetips           V/home/james-whalen/.local/lib/python3.13/site-packages/yt_dlp/postprocessor/xattrpp.pyrunXAttrMetadataPP.run0   s   Z()22;<#'#5#5#;#;#=In*=0 .u 5"&LL<<83$ $ 9 9E AZ 0)\\^L  $>6 	tJ'64x ) 2)#a&11% 
n88z)''//8k9KMN N XX!11''*NykYr(stt57WW_1 R -0fgjfk.lmm
ns7   AC&,C&&
F0DF%F<%F(&FF N)	__name__
__module____qualname____firstlineno____doc__r   r$   r4   __static_attributes__r6       r3   r   r      s4    
 "/!( -'1"* (50=Mr=   r   )r   r"   commonr   utilsr   r   r   r	   r
   r   r6   r=   r3   <module>r@      s&    	 
 ! Am Ar=   