diff --git a/misc/userscripts/view_in_mpv b/misc/userscripts/view_in_mpv index e815d4ab8..0a4516c72 100755 --- a/misc/userscripts/view_in_mpv +++ b/misc/userscripts/view_in_mpv @@ -195,7 +195,7 @@ if [[ $USE_YTDLP_FOR_DOWNLOAD == "yes" ]]; then MPV_FLAGS="$MPV_FLAGS --audio-file=$tmpdir/ytdlp_audio" IFS=" " read -r -a video_command <<< "$MPV_COMMAND $MPV_FLAGS" - "${yt_dlp_video_command[@]}" -o - "$URL" | "${video_command[@]}" --title="$(yt-dlp --cookies-from-browser chromium:~/.local/share/qutebrowser --get-title "$URL") - mpv" "$@" - + ( cd "$tmpdir" && "${yt_dlp_video_command[@]}" -o - "$URL" | "${video_command[@]}" --title="$(yt-dlp --cookies-from-browser chromium:~/.local/share/qutebrowser --get-title "$URL") - mpv" "$@" - ) ps $audio_ytdlp_pid >/dev/null && kill $audio_ytdlp_pid rm -rf "$tmpdir"