From b7a68af26f2d377ef28c7ff521da1e62ccd97ebd Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 12 Mar 2021 00:31:06 +0100 Subject: Use /tmp path for temporary cookies file, and properly delete it... --- src/plugins/Youtube.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index c31a0c3..76f98e2 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -329,16 +329,13 @@ namespace QuickMedia { static std::vector get_cookies() { std::lock_guard lock(cookies_mutex); if(cookies_filepath.empty()) { - char filename[] = "quickmedia.youtube.cookie.XXXXXX"; + char filename[] = "/tmp/quickmedia.youtube.cookie.XXXXXX"; int fd = mkstemp(filename); if(fd == -1) return {}; close(fd); - cookies_filepath = "/tmp/"; - cookies_filepath += filename; - cookies_filepath += ".txt"; - + cookies_filepath = filename; atexit(remove_cookies_file_at_exit); } -- cgit v1.2.3