diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-03-12 00:31:06 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-03-12 00:31:06 +0100 |
commit | b7a68af26f2d377ef28c7ff521da1e62ccd97ebd (patch) | |
tree | 5291469b558eb90da36c792150e9b19fd7c58121 | |
parent | 041696ab8513e1aecc3e1c95598644dac150fc88 (diff) |
Use /tmp path for temporary cookies file, and properly delete it...
-rw-r--r-- | src/plugins/Youtube.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
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<CommandArg> get_cookies() { std::lock_guard<std::mutex> 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); } |