Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use --cookies-from-browser for Flatpak applications #6199

Closed
9 tasks done
rambalachandran opened this issue Feb 10, 2023 · 3 comments
Closed
9 tasks done

Unable to use --cookies-from-browser for Flatpak applications #6199

rambalachandran opened this issue Feb 10, 2023 · 3 comments
Labels
question Question

Comments

@rambalachandran
Copy link

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I remove or skip any mandatory* field

Checklist

  • I'm reporting a bug unrelated to a specific site
  • I've verified that I'm running yt-dlp version 2023.01.06 (update instructions) or later (specify commit)
  • I've checked that all provided URLs are playable in a browser with the same IP and same login details
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I've read the guidelines for opening an issue

Provide a description that is worded well enough to be understood

How to pass the cookies from browser (--cookies-from-browser), if the browser (in this case Chrome) is installed through Flatpak.

I have installed chrome through flatpak that saves the config in ~/.var/app/com.google.Chrome. When I try to run the command

yt-dlp --cookies-from-browser chrome "URL"

it throws the error '/home/<user>/.config/local': No such file or directory

As a shortcut, I have symlinked the config folder and it works, but it might be useful to have a clean implementation, given flatpak is increasingly becoming a favored choice for most GUI applications in Linux.

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['-vU', '--cookies-from-browser', 'chrome', 'https://www.youtube.com/watch?v=jRBksDVs4tg']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.01.06 [6becd25] (zip)
[debug] Python 3.10.6 (CPython x86_64 64bit) - Linux-5.15.0-58-generic-x86_64-with-glibc2.35 (OpenSSL 3.0.2 15 Mar 2022, glibc 2.35)
[debug] exe versions: ffmpeg 4.4.2 (setts), ffprobe 4.4.2
[debug] Optional libraries: certifi-2020.06.20, secretstorage-3.3.1, sqlite3-2.6.0
[Cookies] Extracting cookies from chrome
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/local/bin/yt-dlp/__main__.py", line 17, in <module>
  File "/usr/local/bin/yt-dlp/yt_dlp/__init__.py", line 970, in main
  File "/usr/local/bin/yt-dlp/yt_dlp/__init__.py", line 930, in _real_main
  File "/usr/local/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 649, in __init__
  File "/usr/local/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 3814, in print_debug_header
  File "/usr/local/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 3858, in _setup_opener
  File "/usr/local/bin/yt-dlp/yt_dlp/cookies.py", line 99, in load_cookies
  File "/usr/local/bin/yt-dlp/yt_dlp/cookies.py", line 120, in extract_cookies_from_browser
  File "/usr/local/bin/yt-dlp/yt_dlp/cookies.py", line 281, in _extract_chrome_cookies
FileNotFoundError: could not find chrome cookies database in "/home/ram/.config/google-chrome"
@rambalachandran rambalachandran added bug Bug that is not site-specific triage Untriaged issue labels Feb 10, 2023
@pukkandan
Copy link
Member

Pass the profile path like --cookies-from-browser chrome:~/.var/app/com.google.Chrome/Default

@pukkandan pukkandan added question Question and removed bug Bug that is not site-specific triage Untriaged issue labels Feb 10, 2023
@rambalachandran
Copy link
Author

Thank you. That's very helpful

@rambalachandran
Copy link
Author

I have created a pull request to update the wiki in yt-dlp/yt-dlp-wiki#13 to include this information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question
Projects
None yet
Development

No branches or pull requests

2 participants