Skip to content

retriever.js file type detection #9

@dexter21767-dev

Description

@dexter21767-dev

retriever.js uses path.match("zip$") and path.match("gz$") to find the file type.
if none of these are true then it assumes it's an SRT file, which is problematic since websites like opensubtitles uses links with extensions for example https://dl.opensubtitles.org/en/download/sub/9532844, which will be detected as an SRT while it's a ZIP file.
I suggest if non of the conditions are met then check the filetype from the response headers to determine the filetype.
another option that I am looking into is using the file-type npm module to detect the file type by checking the magic number of the read stream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions