Package: chat-downloader
Chat Downloaderis a simple tool used to retrieve chat messages from livestreams,
videos, clips and past broadcasts. No authentication needed!InstallationThis tool is distributed onPyPIand can be installed withpip:$pipinstallchat-downloaderTo update to the latest version, add the--upgradeflag to the above command.Alternatively, the tool can be installed withgit:$gitclonehttps://github.com/xenova/chat-downloader.git$cdchat-downloader$pythonsetup.pyinstallUsageCommand lineusage: chat_downloader [-h] [--version] [--start_time START_TIME]
                       [--end_time END_TIME]
                       [--message_types MESSAGE_TYPES | --message_groups MESSAGE_GROUPS]
                       [--max_attempts MAX_ATTEMPTS]
                       [--retry_timeout RETRY_TIMEOUT]
                       [--interruptible_retry [INTERRUPTIBLE_RETRY]]
                       [--max_messages MAX_MESSAGES]
                       [--inactivity_timeout INACTIVITY_TIMEOUT]
                       [--timeout TIMEOUT] [--format FORMAT]
                       [--format_file FORMAT_FILE] [--chat_type {live,top}]
                       [--ignore IGNORE]
                       [--message_receive_timeout MESSAGE_RECEIVE_TIMEOUT]
                       [--buffer_size BUFFER_SIZE] [--output OUTPUT]
                       [--overwrite [OVERWRITE]] [--sort_keys [SORT_KEYS]]
                       [--indent INDENT] [--pause_on_debug | --exit_on_debug]
                       [--logging {none,debug,info,warning,error,critical} | --testing | --verbose | --quiet]
                       [--cookies COOKIES] [--proxy PROXY]
                       urlFor example, to save messages from a livestream to a JSON file, you can use:$chat_downloaderhttps://www.youtube.com/watch?v=jfKfPfyJRdk--outputchat.jsonFor a description of these options, as well as advanced command line use-cases and examples, consult theCommand Line Usagepage.Pythonfromchat_downloaderimportChatDownloaderurl='https://www.youtube.com/watch?v=jfKfPfyJRdk'chat=ChatDownloader().get_chat(url)# create a generatorformessageinchat:# iterate over messageschat.print_formatted(message)# print the formatted messageFor advanced python use-cases and examples, consult thePython Documentation.Chat ItemsChat items/messages are parsed into JSON objects (a.k.a. dictionaries) and should follow a format similar to this:{
    ...
    "message_id": "xxxxxxxxxx",
    "message": "actual message goes here",
    "message_type": "text_message",
    "timestamp": 1613761152565924,
    "time_in_seconds": 1234.56,
    "time_text": "20:34",
    "author": {
        "id": "UCxxxxxxxxxxxxxxxxxxxxxxx",
        "name": "username_of_sender",
        "images": [
            ...
        ],
        "badges": [
            ...
        ]
    },
    ...
}For an extensive, documented list of included fields, consult theChat Item Fieldspage.Frequently Asked QuestionsComing soonIssuesFound a bug or have a suggestion? File an issuehere. To assist the
developers in fixing the issue, please follow the issue template as
closely as possible.ContributingIf you would like to help improve the tool, you’ll find more
information on contributing in ourContributing Guide.Supported sites:YouTube.com - Livestreams, past broadcasts and premieres.Twitch.tv - Livestreams, past broadcasts and clips.Zoom.us - Past broadcastsFacebook.com (currently in development) - Livestreams and past
broadcasts.