File Results¶
Typification of the file results. Results of this type are rendered in the file.html template.
- final class searx.result_types.file.File(template: str = 'default.html', title: str = '', content: str = '', img_src: str = '', iframe_src: str = '', audio_src: str = '', thumbnail: str = '', publishedDate: ~datetime.datetime | None = None, pubdate: str = '', length: ~datetime.timedelta | None = None, views: str = '', author: str = '', metadata: str = '', priority: ~typing.Literal['', 'high', 'low'] = '', engines: set[str] = <factory>, open_group: bool = False, close_group: bool = False, positions: list[int] = <factory>, score: float = 0, category: str = '', *, url: str | None = None, engine: str | None = '', parsed_url: ~urllib.parse.ParseResult | None = None)[source]¶
Bases:
MainResult
Class for results of type file
- template: str = 'file.html'¶
Name of the template used to render the result.
By default result_templates/default.html is used.
- time: str = ''¶
Indication of a time, such as the date of the last modification or the date of creation. This is a simple string, the date of which can be freely chosen according to the context.
- mimetype: str = ''¶
Mimetype/Subtype of the file. For
audio
andvideo
, a URL can be passed in theFile.embedded
field to embed the referenced media in the result. If no value is specified, the MIME type is determined fromself.filename
or, alternatively, fromself.embedded
(if either of the two values is set).
- mtype: str = ''¶
Used for displaying
File.embedded
. Its value is automatically populated from the base type ofFile.mimetype
, and can be explicitly set to enforce e.g.audio
orvideo
when mimetype is something like “application/ogg” but its know the content is for example a video.
- subtype: str = ''¶
Used for displaying
File.embedded
. Its value is automatically populated from the subtype type ofFile.mimetype
, and can be explicitly set to enforce a subtype for theFile.embedded
element.