
    ui                     &    S SK r S SKrS SKJr  S rg)    N)current_appc                    U(       d  g[         R                  R                  [        R                  SS5      n[         R                  R                  US5      n[         R                  R                  U5      (       d  [         R                  " U5        U  SU S3n[         R                  R                  X45      nSU 3n[         R                  R                  U5      (       a  U$ SU  S	U S3n [        R                  " US
S9nUR                  S:X  a2  [        US5       n	U	R                  UR                  5        SSS5        U$  g! , (       d  f       U$ = f! [         a  n
[        SU
 35         Sn
A
gSn
A
ff = f)zO
Downloads avatar from Discord and saves locally.
Returns web-accessible path.
z/static/avatars/default.pngz..staticavatars_z.pngz/static/avatars/z#https://cdn.discordapp.com/avatars//   )timeout   wbNzAvatar download failed: z.https://cdn.discordapp.com/embed/avatars/0.png)ospathjoinr   	root_pathexistsmakedirsrequestsgetstatus_codeopenwritecontent	Exceptionprint)user_idavatar_hashstatic_folder
avatar_dirfilename
local_pathweb_pathurlresfes              0D:\user\Documents\code\html\app\utils\avatars.pycache_avatarr'      s=   
 , GGLL!6!6hGMmY7J77>>*%%
J!K=-Hj3J!(,H 
ww~~j!!/y+d
KCll3*??c!j$'1$ (O " < ('O (,-;	s6   .1E E;	E 
EE E 
E;#E66E;)r   r   flaskr   r'        r&   <module>r+      s    	  !<r*   