+
    Ñ6‡j©   ã                   ó.  € R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H	t	H
t
 ^ RIHt ^ RIHt ^ RIHt R R	 ltR
 R ltR R ltR R ltR t]! 4       tRRRRRRRR/R R lltR%R R lltR&R R lltR R ltR R  ltR! R" ltR'R# R$ lltR# )(ai  
Author:     Sai Vignesh Golla
LinkedIn:   https://www.linkedin.com/in/saivigneshgolla/

Copyright (c) 2024-2026 Sai Vignesh Golla

License:    MIT License
            https://opensource.org/license/mit
            
GitHub:     https://github.com/GodsScion/Auto_job_applier_linkedIn

Support me: https://github.com/sponsors/GodsScion

version:    26.01.20.5.08
N)Úsleep)Úrandint)ÚdatetimeÚ	timedelta©Úalert)Úpprint)Úlogs_folder_pathc                ó>   € V ^8„  d   QhR\         \        ,          RR/# )é   ÚpathsÚreturnN)ÚlistÚstr)Úformats   "ÚiC:\Users\sakin\Downloads\Auto_job_applier_linkedIn-main\Auto_job_applier_linkedIn-main\modules\helpers.pyÚ__annotate__r   &   s"   € ÷ Dñ DœD¤�Ið D¨$ñ Dó    c                ó”  € V  F˜  p\         P                  P                  V4      P                  RR4      pR\         P                  P	                  V4      9   d    \         P                  P                  V4      pV'       g   K   \         P                  ! VRR7       Kš  	  R#   \         d   p\        RT R2T4        Rp?K¿  Rp?ii ; i)	zoCreate any of the given directories that don't yet exist (a path pointing at a file creates its parent folder).ú//Ú/Ú.T)Úexist_okz Could not create the directory "z":N)	ÚosÚpathÚ
expanduserÚreplaceÚbasenameÚdirnameÚmakedirsÚ	ExceptionÚprint)r   Úraw_pathÚtargetÚes   &   r   Úmake_directoriesr%   &   s›   € ãˆÜ—‘×#Ñ# HÓ-×5Ñ5°d¸CÓ@ˆà”"—'‘'×"Ñ" 6Ó*Ô*Ü—W‘W—_‘_ VÓ,ˆFßÙð	DÜ�KŠK˜¨×.ó øô ô 	DÜÐ4°V°H¸BÐ?À×CÒCûð	Dús   ÂB!Â!CÂ,CÃCc                ó$   € V ^8„  d   QhR\         /# ©r   r   ©r   )r   s   "r   r   r   5   s   € ÷ jñ j¤#ñ jr   c                  óV  € \         P                  P                  4       p \        P                  P                  R 4      '       d   R# \        P                  P                  R4      '       d   \        V R,          4      # \        V R,          R,          R,          R,          R,          4      # )	Úwinz.--user-data-dir=C:\temp\auto-job-apply-profileÚlinuxz.auto-job-apply-profileÚLibraryzApplication SupportÚGoogleÚChromezauto-job-apply-profile)ÚpathlibÚPathÚhomeÚsysÚplatformÚ
startswithr   )r1   s    r   Úget_default_temp_profiler5   5   sx   € ä�<‰<×ÑÓ€DÜ
‡|�|×Ñ˜u×%Ò%ÙAÜ	�‰×	 Ñ	  ×	)Ò	)Ü�4Ð3Õ3Ó4Ð4Üˆt�iÕÐ"7Õ7¸(ÕBÀXÕMÐPhÕhÓiÐir   c                ó2   € V ^8„  d   QhR\         R,          /# )r   r   Nr(   )r   s   "r   r   r   ?   s   € ÷ $ñ $¬¨d­
ñ $r   c                 ó–  € \         P                  P                  4       p \        P                  P                  R4      '       d^   \        P                  P                  R4      \        P                  P                  R4      \        P                  P                  R4      .pMv\        P                  P                  R4      '       dP   \        V R,          R,          4      \        V R,          R	,          R
,          R,          R,          R,          4      .pMR# V F,  p\        P                  P                  V4      '       g   K*  Vu # 	  R# )zÎ
Dynamically finds the default Google Chrome 'User Data' directory path
across Windows, macOS, and Linux, regardless of OS version.

Returns the absolute path as a string, or None if the path is not found.
r*   z&%LOCALAPPDATA%\Google\Chrome\User Dataz3%USERPROFILE%\AppData\Local\Google\Chrome\User DatazE%USERPROFILE%\Local Settings\Application Data\Google\Chrome\User Datar+   z.configzgoogle-chromez.varÚappzcom.google.ChromeÚdataN)r/   r0   r1   r2   r3   r4   r   r   Ú
expandvarsr   Úexists)r1   r   Úpath_strs      r   Úfind_default_profile_directoryr=   ?   sò   € ô �<‰<×ÑÓ€Dô ‡|�|×Ñ˜u×%Ò%ä�G‰G×ÑÐHÓIÜ�G‰G×ÑÐUÓVÜ�G‰G×ÑÐgÓhð
‰ô 
�‰×	 Ñ	  ×	)Ò	)ä��yÕ  ?Õ2Ó3Ü��v• Õ%Ð(;Õ;¸fÕDÀyÕPÐSbÕbÓcð
‰ñ ó ˆÜ�7‰7�>‰>˜(×#Ô#ØŠOñ ñ r   c                ó4   € V ^8„  d   QhR\         R\        RR/# )r   Úpossible_reasonÚstack_tracer   N)r   r    )r   s   "r   r   r   h   s&   € ÷ Oñ O¬ð O¼)ð OÈñ Or   c                óH   € \        W\        P                  ! 4       RR7       R# )zE
Function to log and print critical errors along with datetime stamp
T)Úfrom_criticalN)Úprint_lgr   Únow)r?   r@   s   &&r   Úcritical_error_logrE   h   s   € ô ˆ_¬8¯<ª<«>È×Nr   c                 óŒ   €  \         R,           p V P                  RR4      #   \         d   p\        RT4        Rp?R# Rp?ii ; i)z1
Function to replace '//' with '/' for logs path
z/log.txtr   r   zIFailed getting log path! So assigning default logs path: './logs/log.txt'Nzlogs/log.txt)r	   r   r    rE   )r   r$   s     r   Úget_log_pathrG   o   sA   € ðÜ 
Õ*ˆØ�|‰|˜D Ó%Ð%øÜô ÜÐfÐhiÔjÝûðús   ‚! ¡A¬>¾AÚendÚ
ÚprettyFÚflushrB   c                ón   € V ^8„  d   QhR\         \        ,          R\         R\        R\        R\        RR/# )r   ÚmsgsrH   rJ   rK   rB   r   N)r   ÚdictÚbool)r   s   "r   r   r   ~   sH   € ÷ Xñ X”Cœ$•Jð X¤Sð X¼ð XÌdð XÔkoð Xð  }Añ Xr   c                ó¼  €  V Fg  pV'       d   \        V4      M\        WPVR7       \        \        RRR7      ;_uu_ 4       pVP	                  \        V4      V ,           4       RRR4       Ki  	  R#   + '       g   i     K~  ; i  \         dL   pT'       d   RX R2MRp\        R	\         R
T 2R4       T'       g   \        RT4        Rp?R#  Rp?R# Rp?ii ; i)zg
Function to log and print. **Note that, `end` and `flush` parameters are ignored if `pretty = True`**
)rH   rK   za+zutf-8)ÚencodingNzSkipped saving this message: "z" to log.txt!z!We'll try one more time to log...zlog.txt in z= is open or is occupied by another program! Please close it! zFailed Loggingz2Log.txt is open or is occupied by another program!)
r   r!   ÚopenÚ__logs_file_pathÚwriter   r    r   r	   rE   )	rH   rJ   rK   rB   rM   ÚmessageÚfiler$   Útrails	   $$$$*    r   rC   rC   ~   sÃ   € ð	XÛˆGß%ŒF�7ŒO¬5°ÈÔ+OøÜÔ&¨°w×?Õ?À4Ø—
‘
œ3˜w›<¨#Õ-Ô.÷ @Ñ?ó ç?×?Ð?ûäô XßKXÐ0°°	¸ÑGð  _BˆÜ�Ô,Ð-Ð-jÐkpÐjqÐrð  uEô  	FßÜÐSÐUV×WÒWõ ûðXús/   ‚?B Á"A1Á#B Á1BÁ<	B ÂCÂ:CÃCc                ó(   € V ^8„  d   QhR\         RR/# )r   Úspeedr   N)Úint)r   s   "r   r   r   �   s   € ÷ 6ñ 6”#ð 6˜Dñ 6r   c                ó  € V ^ 8:  d   R# V ^8:  d$   V ^8  d   \        \        ^^
4      R,          4      # V ^8:  d$   V ^8  d   \        \        ^
^4      R,          4      # \        \        ^\        V 4      ^
,          4      R,          4      # )a  
Function to wait within a period of selected random range.
* Will not wait if input `speed <= 0`
* Will wait within a random range of 
  - `0.6 to 1.0 secs` if `1 <= speed < 2`
  - `1.0 to 1.8 secs` if `2 <= speed < 3`
  - `1.8 to speed secs` if `3 <= speed`
Ngš™™™™™¹?)r   r   Úround)rY   s   &r   Úbufferr]   �   ss   € ð ˆa„xÙØ	�!Œ˜ œ	Ü”W˜Q˜r“] 3Õ&Ó'Ð'Ø	�!Œ˜ œ	Ü”W˜R “^ CÕ'Ó(Ð(ä”W˜R¤ e£¨R¥Ó0°Õ4Ó5Ð5r   c                ó4   € V ^8„  d   QhR\         R\        RR/# )r   Úis_logged_inÚlimitr   N)ÚcallablerZ   )r   s   "r   r   r   ¢   s&   € ÷ Nñ N¤Xð N´cð NÀ$ñ Nr   c                óè   € ^ pV ! 4       '       gc   ^ RI Hp \        R4       RpRP                  V4      pW!8”  d   RpRP                  V4      pV^,          pV! VRV4      '       g   Ke  W!8”  g   Km  R# R# )	z+
Function to ask and validate manual login
r   z Seems like you're not logged in!zConfirm Loginz>After you successfully Log In, please click "{}" button below.zSkip ConfirmationznIf you're seeing this message even after you logged in, Click "{}". Seems like auto login confirmation failed!zLogin RequiredN)Ú	pyautoguir   rC   r   )r_   r`   Úcountr   ÚbuttonrU   s   &&    r   Úmanual_login_retryrf   ¢   s�   € ð €EÙ�nŠnÝ#ÜÐ3Ô4Ø ˆØR×YÑYÐZ`ÓaˆØŒ=Ø(ˆFð H÷  Oñ  Oð  PVó  WˆGØ��
ˆÙ�Ð*¨F×3Ô3¸¾Ávñ r   c                ó>   € V ^8„  d   QhR\         R\        R,          /# )r   Útime_stringr   N)r   r   )r   s   "r   r   r   ´   s   € ÷ 5ñ 5¤sð 5¬x¸$­ñ 5r   c                ó  € ^ RI pVP                  RV P                  4       VP                  4      pV'       g   R# \	        VP                  ^4      4      pVP                  ^4      P                  4       pR\        VR7      R\        VR7      R\        VR7      R	\        VR
7      R\        VR7      R\        V^,          R
7      R\        VR,          R
7      /pVP                  V4      pV'       d   \        P                  ! 4       V,
          # R# )zÆ
Turn a LinkedIn "posted" phrase like "3 days ago" into an approximate datetime.
Returns None when the phrase can't be understood. Months and years are
approximated as 30 and 365 days respectively.
Nz8(\d+)\s+(second|minute|hour|day|week|month|year)s?\s+agoÚsecond)ÚsecondsÚminute)ÚminutesÚhour)ÚhoursÚday)ÚdaysÚweek)ÚweeksÚmonthÚyearim  )ÚreÚsearchÚstripÚ
IGNORECASErZ   ÚgroupÚlowerr   Úgetr   rD   )rh   rv   ÚmatchÚamountÚunitÚspansÚdeltas   &      r   Úcalculate_date_postedr‚   ´   sÔ   € ó Ø�I‰IÐQØ!×'Ñ'Ó)¨2¯=©=ó:€EçÙÜ�—‘˜Q“Ó €FØ�;‰;�q‹>×ÑÓ!€Dà”) FÔ+Ø”) FÔ+Ø”	 Ô'ØŒy˜fÔ%Ø”	 Ô'Ø” ¨¥Ô,Ø”	˜v¨�|Ô,ð€Eð �I‰I�d‹O€Eß%*Œ8�<Š<‹>˜EÕ!Ð4°Ð4r   c                ó0   € V ^8„  d   QhR\         R\         /# )r   Úvaluer   r(   )r   s   "r   r   r   Î   s   € ÷ ñ œCð ¤Cñ r   c                óú   € V P                  4       p \        V 4      pV^ 8”  dY   V^8”  d-   V RV^,
           R,           W^,
          V^,
           ,           p V # RR^V,
          ,          ,           V R,          ,           p V # )zÍ
Converts str value to lakhs, no validations are done except for length and stripping.
Examples:
* "100000" -> "1.00"
* "101,000" -> "10.1," Notice ',' is not removed 
* "50" -> "0.00"
* "5000" -> "0.05" 
Nr   z0.Ú0:Nr   N)rx   Úlen)r„   Úls   & r   Úconvert_to_lakhsr‰   Î   st   € ð �K‰K‹M€EÜˆE‹
€AØˆ1„uØˆqŒ5Ø˜$˜1˜Q�3�K #Õ%¨°­c°!°Aµ#¨Õ6ˆEð €Lð ˜3  !¥�9Õ$ u¨R¥yÕ0ˆEØ€Lr   c                ó$   € V ^8„  d   QhR\         /# r'   )rN   )r   s   "r   r   r   á   s   € ÷ Oñ OœTñ Or   c                óv   €  \         P                  ! V 4      pV#   \         P                   d
    RRRT /u # i ; i)z~
Function to convert data to JSON, if unsuccessful, returns `{"error": "Unable to parse the response as JSON", "data": data}`
Úerrorz$Unable to parse the response as JSONr9   )ÚjsonÚloadsÚJSONDecodeError)r9   Úresult_jsons   & r   Úconvert_to_jsonr‘   á   sC   € ðOÜ—j’j Ó&ˆØÐøÜ×Ñô OØÐ?ÀÈÐNÒNðOús   ‚ š8·8c                ó<   € V ^8„  d   QhR\         R\        R\        /# )r   Ú
max_lengthÚsuffixr   )rZ   r   )r   s   "r   r   r   ì   s"   € ÷ 3ñ 3¤sð 3¼Sð 3ÔX[ñ 3r   c                ó¾   €  V f   RM
\        V 4      p\        V4      V8:  d   V# VRV\        V4      ,
           V,           #   \         d   pRT R2u Rp?# Rp?ii ; i)z–
Coerce any value to a string that's safe to write into a CSV cell, shortening it
(with a marker suffix) if it would exceed max_length. Never raises.
NÚ z[could not stringify value: Ú])r   r‡   r    )r9   r“   r”   Útextr$   s   &&&  r   Útruncate_for_csvr™   ì   sb   € ð
3Ø’\‰r¤s¨4£yˆÜˆt‹9˜
Ô"ØˆKØÐ-�Z¤# f£+Õ-Ð.°Õ7Ð7øÜô 3Ø-¨a¨S°Ð2Õ2ûð3ús"   ‚"A ¥A ÁAÁAÁAÁA)é    )r   )i¸ÿ z...[TRUNCATED])Ú__doc__r   r2   r�   r/   Útimer   Úrandomr   r   r   rc   r   r   Úconfig.settingsr	   r%   r5   r=   rE   rG   rS   rC   r]   rf   r‚   r‰   r‘   r™   © r   r   Ú<module>r       sž   ðñó& 
Û 
Û Û å Ý ß (Ý Ý å ,õDõjõ$õROò	ñ  “>Ð ðX¨4ð XÀð XÐUZð XÐrw÷ X÷"6÷&Nõ$5õ4õ&O÷3ñ 3r   