Skip to content
Back to top
View this page
Edit this page

# 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(title: str = '', content: str = '', img_src: str = '', iframe_src: str = '', audio_src: str = '', thumbnail: str = '', publishedDate: datetime | None = None, pubdate: str = '', length: timedelta | None = None, views: str = '', metadata: str = '', priority: Literal['', 'high', 'low']='', engines: set [ str ] = <factory>, open_group: bool = False, close_group: bool = False, positions: list [ int ] = <factory>, score: float = 0, category: str = '', *, template: str = 'file.html', author: str = '', url: str | None = None, engine: str | None = '', parsed_url: ParseResult | None = None, filename: str = '', size: str = '', time: str = '', mimetype: str = '', abstract: str = '', embedded: str = '', mtype: str = '', subtype: str = '')

  Bases: `MainResult`

  Class for results of type file

  filename: str

    Name of the file.

  size: str

    Size of bytes in human readable notation (`MB` for 1024 * 1024 Bytes file size.)

  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` and `video`, a URL can be passed in the `File.embedded` field to embed the referenced media in the result. If no value is specified, the MIME type is determined from `self.filename` or, alternatively, from `self.embedded` (if either of the two values is set).

  abstract: str

    Abstract of the file.

  embedded: str

    URL of an embedded media type (audio or video) / is collapsible.

  mtype: str

    Used for displaying `File.embedded`. Its value is automatically populated from the base type of `File.mimetype`, and can be explicitly set to enforce e.g. `audio` or `video` 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 of `File.mimetype`, and can be explicitly set to enforce a subtype for the `File.embedded` element.