trizen / pipe-viewer

A lightweight YouTube client for Linux, without requiring an API key.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Pressing `s` gives `Error writing screenshot` if long filename.

zenny opened this issue · comments

commented

Hi,

Context:

  1. mpv has been assigned as a backend to pipe-viewer in `~/.config/pipe-viewer/pipe-viewer.conf
video_player_selected         => "mpv",
  video_players                 => {
                                     mpv => {
                                              arg => "--really-quiet --force-media-title=*TITLE* --no-ytdl --vo=gpu --hwdec=cuda",
                                              audio => "--audio-file=*AUDIO*",
                                              cmd => "/usr/bin/mpv",
                                              fs => "--fullscreen",
                                              novideo => "--no-video",
                                              srt => "--sub-file=*SUB*",
                                            },
  1. When mpv is configured to grasp screenshot to the $PWD plays well with pipe-viewer

  2. When mpv is asked to save the screenshot to a specific location in ~/.config/mpv/mpv.conf

screenshot-template="~/Pictures/screenshots/mpv/%F/%p__%tm-%tY"


local utils = require("mp.utils")
local basedir = mp.get_property("options/screenshot-directory")
mp.register_event("file-loaded", function()
    local filedir = mp.get_property("filename/no-ext")
    local dir = utils.join_path(basedir, filedir)
    mp.set_property("options/screenshot-directory", dir)
end)

mpv standalone (outside `pipe-viewer) captures the screenshot as desired in the relevant folder specified above.**

But pipe-viewer fails to screenshot with Error writing screenshot! when pressed s!

Any idea? Thanks!

commented

The pipe-viewer version is latest from master.

$ ./pipe-viewer --version
CLI Pipe Viewer 0.4.7

This issue appears to be with pipe-viewer unable to pipe the long filenames, but NOT with the mpv (unlike smplayer-dev/smplayer#569 (comment)).

The reason is:

screenshot-template="%F - [%P]v%#01n"

reports Error writing screenshot! with pipe-viewer, but goes well with mpv standalone whereas

screenshot-template="screenshot_%n_%p_%02n"

produces the screenshot without any error when pressed s in pipe viewer.

Any clue appreciated! Thanks.

Hi @trizen

Taking screenshot with long filenames in pipe-viewer have become a hurdle despite the fact that it goes well with standalone mpv. Wish someone look into this outstanding bug that remained unsolved for a long time.

Thanks again, and Cheers