
    i=                     t    d Z ddlmZ ddlmZ ddlmZ ddlmZmZmZ dddd	d
ddZ	dgZ
d	ZdZd	Zd	Zd Zd Zy)zSepiaSearch uses the same languages as :py:obj:`Peertube
<searx.engines.peertube>` and the response is identical to the response from the
peertube engines.

    )	urlencode)datetime)fetch_traits)video_responsesafesearch_tabletime_range_tablezhttps://sepiasearch.orgNzWhttps://docs.joinpeertube.org/api-rest-reference.html#tag/Search/operation/searchVideosTFJSON)websitewikidata_idofficial_api_documentationuse_official_apirequire_api_keyresultsvideosc           
         | syt         j                  |d   d      }t        j                  d      dz   t	        | |d   dz
  dz  dd	t
        |d
      d      z   |d<   | |dxx   d|z   z  cc<   |dxx   d|z   z  cc<   |d   t        v rMt        j                         j                         t        |d      z   }|dxx   d|j                         z   z  cc<   |S )z(Assemble request for the SepiaSearch APIFsearxng_localeN/z/api/v1/search/videos?pageno   
   z-match
safesearch)searchstartcountsortnsfwurlz&languageOneOf[]=z&boostLanguages[]=
time_rangez&startDate=)traitsget_languagebase_urlrstripr   r   r   r   nowdate	isoformat)queryparamseng_langtimes       */root/searxng/searx/engines/sepiasearch.pyrequestr+   '   s      ""6*:#;TBH 	
"	#
 *Q."4 ()=>	
	
 5M u,x77u-88l//||~""$'7|8L'MMu)999M    c                     t        |       S )N)r   )resps    r*   responser/   J   s    $r,   )__doc__urllib.parser   r   searx.engines.peertuber   r   r   r   about
categoriespagingr!   time_range_supportr   r+   r/    r,   r*   <module>r8      sc    #  /  )"{	 Z
	$ 
 F r,   