xenova / chat-downloader

A simple tool used to retrieve chat messages from livestreams, videos, clips and past broadcasts. No authentication needed!
https://chat-downloader.readthedocs.io/
MIT License
936 stars 132 forks source link

[BUG] Youtube live links 404 not found #213

Closed Practicalbutterfly5 closed 1 year ago

Practicalbutterfly5 commented 1 year ago

Basic information

Describe the bug

Youtube live links show 404 error not found. Simple bypass is changing url to format "https://youtu.be/videoid".

Command/Code used

If running from the command line, provide the following:

  1. The command used (including the verbose tag, -v):

chat_downloader "https://www.youtube.com/live/YPm_OqrzMIs?feature=share" -v


2. Output from the above command:

[DEBUG] Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] [DEBUG] Program version: 0.2.7 [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/live/YPm_OqrzMIs?feature=share', '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, 28), match='https://www.youtube.com/live'>". Running "_get_chat_by_user" function in "YouTubeChatDownloader". [DEBUG] Chat information: {'chat': <generator object YouTubeChatDownloader._get_chat_messages_by_user_args at 0x7f239c259b40>, 'title': 'live', 'duration': None, 'status': None, 'video_type': None, 'start_time': None, 'id': 'live', '_output_writer': None, '_output_callback': None, 'format': <function ChatDownloader.get_chat.. at 0x7f239c175bc0>, 'site': <chat_downloader.sites.youtube.YouTubeChatDownloader object at 0x7f239cb4ad90>} [INFO] Retrieving chat for "live". [DEBUG] Starting new HTTPS connection (1): www.youtube.com:443 [DEBUG] https://www.youtube.com:443 "GET /c/live/streams HTTP/1.1" 404 None [ERROR] 404 Not Found [DEBUG] Session closed.

xenova commented 1 year ago

You can use the "https://www.youtube.com/watch?v=YPm_OqrzMIs" url instead. In fact, the live URL you linked redirects to the /watch endpoint.

If someone wants to make a PR for this, that would be appreciated.