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

[BUG] "Unable to find initial video contents" when trying to get chat on Youtube with cookies. #218

Open
hiro-091 opened this issue Jul 14, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@hiro-091
Copy link

Basic information

  • Program version: 0.2.7
  • Python version: 3.11.4
  • Operating system: MacOS 13.2.1 and Windows 10 Home 20H2

Describe the bug

"[ERROR] Unable to find initial video contents" when trying to get chat on Youtube with cookies.
This error occurs on all channels contents and archive, on live, upcoming. Especially a big problem when getting member-only content.
The cookies used are in the Netscape format that can be load by http.cookiejar.MozillaCookieJar and were extracted from Mozilla, chrome, opera on Mac and Windows.

Command/Code used

If running from the command line, provide the following:

  1. The command used (including the verbose tag, -v):
python3 -m chat_downloader -v --cookies ./cookies.txt "https://www.youtube.com/watch?v=zX7F6IyxTiw"
  1. Stderr output from the above command:
[DEBUG] Python version: 3.11.4 (main, Jun 20 2023, 16:59:59) [Clang 14.0.3 (clang-1403.0.22.14.1)]
[DEBUG] Program version: 0.2.7
[DEBUG] Initialisation parameters: {'headers': None, 'cookies': './cookies.txt', 'proxy': None}
[DEBUG] Created YouTubeChatDownloader session.
[INFO] Site: youtube.com
[DEBUG] Program parameters: {'url': 'https://www.youtube.com/watch?v=zX7F6IyxTiw', 'start_time': None, 'end_time': None, 'max_attempts': 15, 'retry_timeout': None, 'interruptible_retry': True, 'timeout': None, 'inactivity_timeout': None, 'max_messages': None, 'message_groups': ['messages'], 'message_types': None, 'output': None, 'overwrite': True, 'sort_keys': True, 'indent': 4, 'format': 'youtube', 'format_file': None, 'chat_type': 'live', 'ignore': None, 'message_receive_timeout': 0.1, 'buffer_size': 4096}
[DEBUG] Starting new HTTPS connection (1): www.youtube.com:443
[DEBUG] https://www.youtube.com:443 "GET /watch?v=zX7F6IyxTiw HTTP/1.1" 200 None
[DEBUG] Initial YouTube data: {'responseContext': {'webResponseContextExtensionData': {'ytConfigData': {'visitorData': 'CgtpRGJwaHY1dU9vQSjzosKlBg%3D%3D', 'sessionIndex': 0, 'rootVisualElementType': 3832}}}}
[ERROR] Unable to find initial video contents.
[DEBUG] Session closed.

If the output is too long, you can attach a text file or remove output which does not constitute to the problem.

@hiro-091 hiro-091 added the bug Something isn't working label Jul 14, 2023
@TheTechRobo
Copy link

Check your cookies.txt file. Does it have lines that start with #HttpOnly ? If so, remove the #HttpOnly from the line.

@hiro-091
Copy link
Author

Tanks for your reply.
There is no line stating #HttpOnly.
I can do request.get() with this cookies to web pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants