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] (YouTube) It will download the chat room of the latest live archive if use channel url. #183

Closed
JC-Chung opened this issue Dec 2, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@JC-Chung
Copy link
Contributor

JC-Chung commented Dec 2, 2022

Basic information

  • Program version: 0.2.1
  • Python version: 3.9.6
  • Operating system: Windows 10

Describe the bug

It will download the chat room of the latest live archive every 30 seconds if use channel url.

Command/Code used

If running from the command line, provide the following:

  1. The command used (including the verbose tag, -v):
chat_downloader -v https://www.youtube.com/channel/UCZ5Wn4ss81cVKSk74Duv2BA
  1. Output from the above command:
[DEBUG] Python version: 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)]
[DEBUG] Program version: 0.2.1
[DEBUG] Initialisation parameters: {'headers': None, 'cookies': None, 'proxy': None}
[DEBUG] Created YouTubeChatDownloader session.
[INFO] Site: youtube.com
[DEBUG] Program parameters: {'url': 'https://www.youtube.com/channel/UCZ5Wn4ss81cVKSk74Duv2BA', '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] Match found: "<re.Match object; span=(0, 56), match='https://www.youtube.com/channel/UCZ5Wn4ss81cVKSk7>". Running "_get_chat_by_user" function in "YouTubeChatDownloader".
[DEBUG] Chat information: {'chat': <generator object YouTubeChatDownloader._get_chat_messages_by_user_args at 0x0000023DF4541E40>, 'title': 'UCZ5Wn4ss81cVKSk74Duv2BA', 'duration': None, 'status': None, 'video_type': None, 'start_time': None, 'id': 'UCZ5Wn4ss81cVKSk74Duv2BA', '_output_writer': None, '_output_callback': None, 'format': <function ChatDownloader.get_chat.<locals>.<lambda> at 0x0000023DF459A040>, 'site': <chat_downloader.sites.youtube.YouTubeChatDownloader object at 0x0000023DF458AC70>}
[INFO] Retrieving chat for "UCZ5Wn4ss81cVKSk74Duv2BA".
[DEBUG] Starting new HTTPS connection (1): www.youtube.com:443
[DEBUG] https://www.youtube.com:443 "GET /channel/UCZ5Wn4ss81cVKSk74Duv2BA/streams HTTP/1.1" 200 None
[DEBUG] https://www.youtube.com:443 "GET /watch?v=cZOjRol77xg HTTP/1.1" 200 None
[INFO] Found a livestream: "Title" (cZOjRol77xg).
[DEBUG] Getting Live chat (Live chat replay).
[DEBUG] https://www.youtube.com:443 "GET /live_chat_replay?continuation=op2w0wRmGl5DaWtxSndvWVZVTmFOVmR1TkhOek9ERmpWa3RUYXpjMFJIVjJNa0pCRWd0aldrOXFVbTlzTnpkNFp4b1Q2cWpkdVFFTkNndGpXazlxVW05c056ZDRaeUFCTUFBJTNEQAFyAggB HTTP/1.1" 200 None
[DEBUG] Continuation parameters: {'click_tracking': {'clickTrackingParams': 'IhMIjbKGpdfb+wIVQ0wPAh1V+Qz7'}, 'continuation': 'op2w0wRmGl5DaWtxSndvWVZVTmFOVmR1TkhOek9ERmpWa3RUYXpjMFJIVjJNa0pCRWd0aldrOXFVbTlzTnpkNFp4b1Q2cWpkdVFFTkNndGpXazlxVW05c056ZDRaeUFCTUFBJTNEQAFyAggB'}
[DEBUG] Session headers: User-Agent, Accept-Language, origin, x-youtube-client-name, x-youtube-client-version, x-origin, x-goog-authuser, x-goog-visitor-id, content-type, referer
[DEBUG] Logged-in info: {'key': 'logged_in', 'value': '0'}
...
chat
...
[DEBUG] Total number of messages: 191
[DEBUG] Continuation info: {'timeUntilLastMessageMsec': 5000, 'continuation': 'op2w0wR8Gl5DaWtxSndvWVZVTmFOVmR1TkhOek9ERmpWa3RUYXpjMFJIVjJNa0pCRWd0aldrOXFVbTlzTnpkNFp4b1Q2cWpkdVFFTkNndGpXazlxVW05c056ZDRaeUFCTUFBJTNEKM6auN4NQABIA1IIIACwAQD4AQByBAgBGAF4AA%3D%3D'}
[DEBUG] Continuation info: {'continuation': 'op2w0wR8Gl5DaWtxSndvWVZVTmFOVmR1TkhOek9ERmpWa3RUYXpjMFJIVjJNa0pCRWd0aldrOXFVbTlzTnpkNFp4b1Q2cWpkdVFFTkNndGpXazlxVW05c056ZDRaeUFCTUFBJTNEKM6auN4NQABIBFIIIACwAQD4AQByBAgBGAF4AA%3D%3D'}
[DEBUG] https://www.youtube.com:443 "POST /youtubei/v1/live_chat/get_live_chat_replay?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8 HTTP/1.1" 200 None
[DEBUG] Continuation parameters: {'click_tracking': {'clickTrackingParams': 'CAEQl98BIhMI0JjNpdfb-wIVMkX1BR2dHQN2'}, 'continuation': 'op2w0wR8Gl5DaWtxSndvWVZVTmFOVmR1TkhOek9ERmpWa3RUYXpjMFJIVjJNa0pCRWd0aldrOXFVbTlzTnpkNFp4b1Q2cWpkdVFFTkNndGpXazlxVW05c056ZDRaeUFCTUFBJTNEKM6auN4NQABIA1IIIACwAQD4AQByBAgBGAF4AA%3D%3D'}
[DEBUG] Session headers: User-Agent, Accept-Language, origin, x-youtube-client-name, x-youtube-client-version, x-origin, x-goog-authuser, x-goog-visitor-id, content-type, referer
[DEBUG] Logged-in info: {'key': 'logged_in', 'value': '0'}
[INFO] There are no active or upcoming livestreams with a live chat. Retrying in 30 seconds.

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

Expected behavior

Only [INFO] There are no active or upcoming livestreams with a live chat. Retrying in 30 seconds.
Instead of getting the latest live archives chat rooms.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context/information

Add any other context or information about the problem here.

@JC-Chung JC-Chung added the bug Something isn't working label Dec 2, 2022
@JC-Chung JC-Chung changed the title [BUG] It will download the chat room of the latest live archive every 30 seconds if use channel url. [BUG] (YouTube) It will download the chat room of the latest live archive if use channel url. Dec 2, 2022
@xenova
Copy link
Owner

xenova commented Dec 2, 2022

Right, this is due to a recent change to YouTube where past broadcasts are shown in the "live" section.
image

I'll make it so that only live or upcoming broadcasts (as you mentioned here)

@xenova xenova closed this as completed in 0941576 Dec 2, 2022
@xenova
Copy link
Owner

xenova commented Dec 2, 2022

0941576 should fix this. Let me know if it works! 👍

(You will have to install the git version for now... I will make a full release soon)

@upintheairsheep
Copy link

Sorry for the off-topicness, but I've created that TikTok comments and replies extracter I was asking for myself. Please pull request this, as I am banned due to my issue spamming in the past, but I've just learned to program instead. https://github.com/upintheairsheep/ytdl-sheep/pull/6/files

irystocratanon pushed a commit to irystocratanon/chat-downloader that referenced this issue Aug 13, 2023
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

3 participants