degville / snap-yt-dlp

snapcraft build files for yt-dlp
5 stars 4 forks source link

Access to cookies from other snap #6

Open Svin-kun opened 11 months ago

Svin-kun commented 11 months ago

yt-dlp from snap can't access cookies from chromium (also from snap).

pumbez@lenochka:~$ /snap/bin/yt-dlp --cookies-from-browser chromium:/home/pumbez/snap/chromium/common/chromium -F https://www.youtube.com/watch?v=T9hXNV-3kGY Extracting cookies from chromium Traceback (most recent call last): File "/snap/yt-dlp/365/bin/yt-dlp", line 8, in sys.exit(main()) File "/snap/yt-dlp/365/lib/python3.10/site-packages/yt_dlp/init.py", line 1009, in main _exit(*variadic(_real_main(argv))) File "/snap/yt-dlp/365/lib/python3.10/site-packages/yt_dlp/init.py", line 963, in _real_main with YoutubeDL(ydl_opts) as ydl: File "/snap/yt-dlp/365/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 681, in init self._request_director = self.build_request_director(_REQUEST_HANDLERS.values(), _RH_PREFERENCES) File "/snap/yt-dlp/365/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 4115, in build_request_director cookiejar=self.cookiejar, File "/usr/lib/python3.10/functools.py", line 981, in get val = self.func(instance) File "/snap/yt-dlp/365/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 4036, in cookiejar return load_cookies( File "/snap/yt-dlp/365/lib/python3.10/site-packages/yt_dlp/cookies.py", line 91, in load_cookies extract_cookies_from_browser(browser_name, profile, YDLLogger(ydl), keyring=keyring, container=container)) File "/snap/yt-dlp/365/lib/python3.10/site-packages/yt_dlp/cookies.py", line 112, in extract_cookies_from_browser return _extract_chrome_cookies(browser_name, profile, keyring, logger) File "/snap/yt-dlp/365/lib/python3.10/site-packages/yt_dlp/cookies.py", line 273, in _extract_chrome_cookies raise FileNotFoundError(f'could not find {browser_name} cookies database in "{search_root}"') FileNotFoundError: could not find chromium cookies database in "/home/pumbez/snap/chromium/common/chromium"

soumyaDghosh commented 3 months ago

yt-dlp is a snap here, and it doesn't have access to any random path. And nothing can't be done about it right now.