
    |*&ig
                     t    S SK r S SKrS SKrS SKrS SKJr  S SKrS SKJrJ	r	  S SK
Jr  SrSrS\\\4   4S jrg)	    N)Dict)ensure_cache_directoryis_cache_valid)print_greyed_outzGhttps://github.com/nomi-sec/PoC-in-GitHub/archive/refs/heads/master.zipiQ returnc           	        ^	 U R                  S5      n[        R                  R                  US5      m	0 nSnU	4S jn[	        X5        [        U T	[        5      (       d  U" 5         [        R                  R                  T	5      (       d  [        S5        U$  [        S5        0 n[        R                  " T	S5       nUR                  5        HR  nUR                  S5      (       d  M   [        R                  " UR                  U5      R!                  S	5      5      XW'   MT     S S S 5        Un[        S5        U$ ! [        R"                   a  n[        S
U SU 35         S nAM  S nAff = f! , (       d  f       NP= f! [        R$                   a    [        S5        0 n U$ [&         a  n[        SU 35        0 n S nAU$ S nAff = f)N	cache_dirzPoC-in-GitHub.zipGITHUB_POC_DATA_LOADERc                    >  [        S5        [        R                  " [        SSS9n U R                  S:X  a<  [        TS5       nUR                  U R                  5        S S S 5        [        S5        g [        SU R                   35        g ! , (       d  f       N3= f! [         a  n[        S	U 35         S nAg S nAff = f)
NzG[*] GITHUB_POC_DATA_LOADER: Downloading GitHub PoC repository as zip...<   T)timeoutfollow_redirects   wbzJ[+] GITHUB_POC_DATA_LOADER: GitHub PoC repository downloaded successfully.zH[!] GITHUB_POC_DATA_LOADER: Failed to download repository. Status code: z:[!] GITHUB_POC_DATA_LOADER: Error downloading repository: )	r   httpxgetREPO_URLstatus_codeopenwritecontent	Exception)responseferepo_zip_paths      E/home/kali/cveseeker/services/cache/loaders/github_poc_data_loader.pydownload_repo_as_zip2load_github_poc_data.<locals>.download_repo_as_zip   s    
	_fgyy2MH##s*-.!GGH,,- / !mn #klt  mA  mA  lB  "C  D	 /.
  	_YZ[Y\]^^	_s6   AB B B 4B 
BB 
C (B;;C zW[!] GITHUB_POC_DATA_LOADER: Failed to load PoC repository. Falling back to empty cache.zA[*] GITHUB_POC_DATA_LOADER: Loading PoC repository into memory...rz.jsonzutf-8z8[!] GITHUB_POC_DATA_LOADER: Skipping invalid JSON file 'z': z?[+] GITHUB_POC_DATA_LOADER: GitHub PoC data loaded into memory.z][!] GITHUB_POC_DATA_LOADER: Invalid ZIP file format. Please verify the downloaded repository.zF[!] GITHUB_POC_DATA_LOADER: Error loading PoC repository into memory: )r   ospathjoinr   r   CACHE_DURATIONexistsr   zipfileZipFilenamelistendswithjsonloadsreaddecodeJSONDecodeError
BadZipFiler   )
configr	   datanamer   
temp_cachezip_ref	file_namer   r   s
            @r   load_github_poc_datar6      s   

;'IGGLL,?@MD#D_ 9+&-@@77>>-((rs\]
__]C0G$--/	%%g..w04

7<<	;R;Y;YZa;b0c
- 0 1 Z[ K  // w(+cdmcnnqrsqt)uvvw 10  xy
 K	  abcadefK	s`   $E= ;(E,(6D9E,"E= 9E)E$E,$E))E,,
E:6E= =!G!	G*G  G)r!   timer&   r*   typingr   r   services.cache.loaders.loaderr   r   terminal.clir   r   r$   strr6        r   <module>r>      s;    	      P )T/DdO /r=   