aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/cookies.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/cookies.py')
-rw-r--r--yt_dlp/cookies.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/yt_dlp/cookies.py b/yt_dlp/cookies.py
index b06edfc5d..c6edaebe4 100644
--- a/yt_dlp/cookies.py
+++ b/yt_dlp/cookies.py
@@ -83,9 +83,12 @@ def load_cookies(cookie_file, browser_specification, ydl):
cookie_jars.append(extract_cookies_from_browser(browser_name, profile, YDLLogger(ydl), keyring=keyring))
if cookie_file is not None:
- cookie_file = expand_path(cookie_file)
+ is_filename = YoutubeDLCookieJar.is_path(cookie_file)
+ if is_filename:
+ cookie_file = expand_path(cookie_file)
+
jar = YoutubeDLCookieJar(cookie_file)
- if os.access(cookie_file, os.R_OK):
+ if not is_filename or os.access(cookie_file, os.R_OK):
jar.load(ignore_discard=True, ignore_expires=True)
cookie_jars.append(jar)