+
    0j                          R t ^ RIHt ^ RIHt ^ RIHtHt ^ RIH	t	 ^ RI
Ht ]! 4       tR R lt ! R R	]	],          4      tR
# )z$Google search engine implementation.)Mapping)SystemRandom)AnyClassVar)BaseSearchEngine)
TextResultc                $    V ^8  d   QhR\         /# )   return)str)formats   "h/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/ddgs/engines/google.py__annotate__r      s     7 7 7    c                 0   Rp \         P                  V 4      w  rr4\         P                  W44      p\         P                  RR4      p\         P                  RR4      pRV RV RV RV RV R	2pV\        P	                  R
4      P                  4       ,           # )z7Return one random Android Google App User-Agent string.i  i'  i  zMozilla/5.0 (Linux; Android z; z0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/z.0..z Mobile Safari/537.364e53544e5756))z5.0zSM-G900P Build/LRX21T'   <   )z6.0zNexus 5 Build/MRA58Nr   r   )z8.0zPixel 2 Build/OPD3.170816.012r   r   )randomchoicerandintbytesfromhexdecode)	devicesandroid_verdevice
chrome_min
chrome_maxchrome_majorchrome_buildchrome_patchuas	            r   get_uar$      s    G
 39--2H/K>>*9L>>$-L>>$-L
&{m2fX >s<.,?T	V 
 n-44666r   c                      a  ] tR t^!t o RtRtRtRtRtRt	R]
! 4       /tRtRR	R
RRR/tRV 3R lR lltV 3R lR ltV 3R ltRtV tR# )GooglezGoogle search engine.googletextzhttps://www.google.com/searchGETz
User-Agentz//div[@data-hveid][.//h3]titlez.//h3//text()hrefz.//a[.//h3]/@hrefbodyz./div/div[last()]//text()c                h   < V ^8  d   QhRS[ RS[ RS[ RS[ R,          RS[RS[ RS[S[ S[3,          /# )	r	   queryregion
safesearch	timelimitNpagekwargsr
   )r   intdictr   )r   __classdict__s   "r   r   Google.__annotate__3   s]        	
 :   
c3hr   c                   V P                   P                  P                  RRR/4       RRRRRR	/pV^,
          ^
,          pR
VRWsP                  4       ,          R\	        V4      /p	VP                  R4      w  rV RV
P                  4        2V	R&   RV 2V	R&   RV
P                  4        2V	R&   V'       d	   RV 2V	R&   V	# )z.Build a payload for the Google search request.z
google.comCONSENTzYES+on2moderate1off0qfilterstart-hllang_lrcountrycrzqdr:tbs)http_clientclientset_cookieslowerr   splitupper)selfr.   r/   r0   r1   r2   r3   safesearch_baserB   payloadrG   langs   &&&&&&,     r   build_payloadGoogle.build_payload3   s     	++L9f:MNj#ucBRo&6&6&89SZ

 S)&'--/!23v!'--/!23#I;/GENr   c                F   < V ^8  d   QhRS[ S[,          RS[ S[,          /# )r	   resultsr
   )listr   )r   r6   s   "r   r   r7   M   s%      D,< jAQ r   c                h   . pV F  pVP                   P                  R4      '       d>   VP                   P                  R4      ^,          P                  R4      ^ ,          Vn         VP                  '       g   Ku  VP                   P                  R4      '       g   K  VP	                  V4       K  	  V# )zPost-process search results.z/url?q=z?q=&http)r+   
startswithrN   r*   append)rP   rW   post_resultsresults   &&  r   post_extract_resultsGoogle.post_extract_resultsM   s    F{{%%i00$kk//6q9??DQG||| 6 6v > >##F+	 
 r   c                ~   < V ^8  d   Qh/ S[ S[S[S[3,          ,          ;R&   S[ S[S[S[3,          ,          ;R&   # )r	   headers_updateelements_xpath)r   r5   r   r   )r   r6   s   "r   r   r7   !   s<      T#s(^,G  WS#X./  r    N)   )__name__
__module____qualname____firstlineno____doc__namecategoryprovider
search_urlsearch_methodr$   rc   items_xpathrd   rT   r`   __annotate_func____static_attributes____classdictcell__)r6   s   @r   r&   r&   !   sf     DHH0JM0<fh/GN-K#+3N 4 Y  r   r&   N)rk   collections.abcr   r   r   typingr   r   	ddgs.baser   ddgs.resultsr   r$   r&   re   r   r   <module>ry      s5    * #    & #	7(4j) 4r   