
    i=                     R    d Z ddlZddlmZmZ dddddd	d
dZdgZdZdZdZ	d Z
d Zy)zMediathekViewWeb (API)    N)loadsdumpszhttps://mediathekviewweb.de/	Q27877380z?https://gist.github.com/bagbag/a2888478d27de0e989cf777f81fb33deTFJSONde)websitewikidata_idofficial_api_documentationuse_official_apirequire_api_keyresultslanguagevideosc           	      r    d|d<   d|d<   d|d   d<   t        dd	g| d
gddd|d   dz
  dz  dd      |d<   |S )Nz%https://mediathekviewweb.de/api/queryurlPOSTmethodz
text/plainheaderszContent-typetitletopic)fieldsquery	timestampdescTpageno   
   )queriessortBy	sortOrderfutureoffsetsizedata)r   )r   paramss     //root/searxng/searx/engines/mediathekviewweb.pyrequestr'      sz    ;F5MF8(4F9n%
   # "h'!+r1	
F6N$ M    c                 .   t        | j                        } | d   }|d   }g }|D ]n  }t        t        j                  |d               |d<   |j                  |d   j                  dd      d	|z  |d   d
|z  |d   j                  dd      dd       p |S )Nresultr   duration)secondshmsurl_video_hdzhttp://zhttps://z %(channel)s: %(title)s (%(hms)s)z%(description)szvideos.html)r   r   lengthcontent
iframe_srctemplate)r   textstrdatetime	timedeltaappendreplace)resp
mwv_resultmwv_result_listr   items        r&   responser=   1   s    DhJ +OG 
(,,T*5EFGUN+33IzJ;dBu+,t3">2::9jQ)		
	
 Nr(   )__doc__r5   jsonr   r   about
categoriespagingtime_range_support
safesearchr'   r=    r(   r&   <module>rF      sO       ."c	 Z
	 
4r(   