Skip to content

plugin fails if media filename contains newline #8

@calestyo

Description

@calestyo

Hey.

At least for the case that the media file name contains a newline (\n), but possibly also for other such unusual characters (perhaps \r), the plugin fails, e.g.:

$ mpv --msg-level=chapters=debug 'a'$'\n''b.mp4'
[chapters] Loading lua script /home/user/.config/mpv/scripts/chapters.lua...
[chapters] loading mp.defaults
[chapters] loading file /home/user/.config/mpv/scripts/chapters.lua
[chapters] reading options for chapters 
[chapters] Opened config file script-opts/chapters.conf. 
[chapters] options: {"placeholder_title" = "Chapter ", "hash" = false, "ask_for_title" = true, "autosave" = false, "global_chapters" = true, "pause_on_input" = false, , "autoload" = true, "chapters_dir" = "/home/user/.config/mpv/chapters"} 
[chapters] looking for: ./a
[chapters] b.mp4.ffmetadata 
[chapters] looking in the global directory 
[chapters] full_path, mpv: a
[chapters] b.mp4 
[chapters] looking for command: realpath 
[chapters] command found: /usr/bin/realpath 
[chapters] command: {"/usr/bin/realpath", "--"} 
[chapters] command2: {"/usr/bin/realpath", "--", "a
[chapters] b.mp4"} 
[chapters] unix, full path: /home/user/ggg/ab.mp4 
…

Cheers,
Chris.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions