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

[weverse] --cookies-from-browser support is broken #7806

Open
9 of 10 tasks
godly-devotion opened this issue Aug 11, 2023 · 3 comments
Open
9 of 10 tasks

[weverse] --cookies-from-browser support is broken #7806

godly-devotion opened this issue Aug 11, 2023 · 3 comments
Labels
site-bug Issue with a specific website

Comments

@godly-devotion
Copy link

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally 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.07.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 known issues and 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

When attempting to use --cookies-from-browser safari it seems the cookie extraction fails and errors out by saying that the video is only available for registered users and requires account credentials.

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['--cookies-from-browser', 'safari', '-vU', 'https://weverse.io/wooah/live/3-126751905']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version [email protected] [b532a3481] (pip)
[debug] Python 3.11.4 (CPython arm64 64bit) - macOS-13.5-arm64-arm-64bit (OpenSSL 3.1.2 1 Aug 2023)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.07.22, mutagen-1.46.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Trying secondary cookie location
[debug] skipping 4 bytes (unknown page header field): b'\x00\x00\x00\x00'
[Cookies] Loading cookie      0/     6[debug] skipping 4 bytes (unknown record field 1): b'\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 2): b'\x00\x00\x00\x00'
[debug] skipping 8 bytes (unknown record field 3): b'\x00\x00\x00\x00\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 1): b'\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 2): b'\x00\x00\x00\x00'
[debug] skipping 8 bytes (unknown record field 3): b'\x00\x00\x00\x00\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 1): b'\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 2): b'\x00\x00\x00\x00'
[debug] skipping 8 bytes (unknown record field 3): b'\x00\x00\x00\x00\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 1): b'\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 2): b'\x00\x00\x00\x00'
[debug] skipping 8 bytes (unknown record field 3): b'\x00\x00\x00\x00\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 1): b'\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 2): b'\x00\x00\x00\x00'
[debug] skipping 8 bytes (unknown record field 3): b'\x00\x00\x00\x00\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 1): b'\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 2): b'\x00\x00\x00\x00'
[debug] skipping 8 bytes (unknown record field 3): b'\x00\x00\x00\x00\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown page header field): b'\x00\x00\x00\x00'
[Cookies] Loading cookie      0/     3[debug] skipping 4 bytes (unknown record field 1): b'\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 2): b'\x00\x00\x00\x00'
[debug] skipping 8 bytes (unknown record field 3): b'\x00\x00\x00\x00\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 1): b'\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 2): b'\x00\x00\x00\x00'
[debug] skipping 8 bytes (unknown record field 3): b'\x00\x00\x00\x00\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 1): b'\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 2): b'\x00\x00\x00\x00'
[debug] skipping 8 bytes (unknown record field 3): b'\x00\x00\x00\x00\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown page header field): b'\x00\x00\x00\x00'
[Cookies] Loading cookie      0/     1[debug] skipping 4 bytes (unknown record field 1): b'\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 2): b'\x00\x00\x00\x00'
[debug] skipping 8 bytes (unknown record field 3): b'\x00\x00\x00\x00\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown page header field): b'\x00\x00\x00\x00'
<TRUNCATED BECAUSE TOO LONG>
[Cookies] Loading cookie      0/     1[debug] skipping 4 bytes (unknown record field 1): b'\x00\x00\x00\x00'
[debug] skipping 4 bytes (unknown record field 2): b'\x00\x00\x00\x00'
[debug] skipping 8 bytes (unknown record field 3): b'\x00\x00\x00\x00\x00\x00\x00\x00'
[debug] skipping 87 bytes (footer): b'\x00\x11L\x17\x07\x17 \x05\x00\x00\x00Kbplist00\xd1\x01\x02_\x10\x18NSHTTPCookieAcceptPolicy\x10\x02\x08\x0b&\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00('
[Cookies] Extracted 359 cookies from safari
[debug] Proxy map: {}
[debug] Loaded 1855 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: [email protected], Current version: [email protected]
yt-dlp is up to date ([email protected])
ERROR: [Weverse] 3-126751905: This video is only available for registered users. Use --cookies, --cookies-from-browser, --username and --password, --netrc-cmd, or --netrc (weverse) to provide account credentials
  File "/opt/homebrew/Cellar/yt-dlp/2023.7.6_1/libexec/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 707, in extract
    self.initialize()
  File "/opt/homebrew/Cellar/yt-dlp/2023.7.6_1/libexec/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 616, in initialize
    self._real_initialize()
  File "/opt/homebrew/Cellar/yt-dlp/2023.7.6_1/libexec/lib/python3.11/site-packages/yt_dlp/extractor/weverse.py", line 74, in _real_initialize
    self.raise_login_required()
  File "/opt/homebrew/Cellar/yt-dlp/2023.7.6_1/libexec/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 1170, in raise_login_required
    raise ExtractorError(msg, expected=True)
@godly-devotion godly-devotion added bug Bug that is not site-specific triage Untriaged issue labels Aug 11, 2023
@pukkandan
Copy link
Member

@mbway

@mbway
Copy link
Contributor

mbway commented Aug 11, 2023

Can you test the same site in another browser first, as the log indicates cookies are being extracted successfully. The 'skipping field' debug messages don't indicate a problem especially if they are all null bytes.

The skipped fields are there because the safari cookie storage format isn't documented anywhere so it had to be reverse engineered. There are parts that I don't know the function of (that have been all zeros in all cases I've seen so far so might just be padding or something?)

@bashonly bashonly added site-bug Issue with a specific website and removed bug Bug that is not site-specific triage Untriaged issue labels Aug 11, 2023
@bashonly bashonly changed the title Cookies do not seem to be getting extracted properly with Safari [weverse] --cookies-from-browser support is broken Aug 11, 2023
@bashonly
Copy link
Member

bashonly commented Aug 11, 2023

It looks like @mbway is correct, this is not a bug with the --cookies-from-browser implementation.

The necessary cookie for Weverse is now stored by the site as a session cookie, so it is not accessible via --cookies-from-browser. Related: #5534

Workaround: export cookies to text file and use --cookies or else login with --username/--password

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-bug Issue with a specific website
Projects
None yet
Development

No branches or pull requests

4 participants