Skip to main content

ThemeMasterChat

ThemeMasterChat is a python library for fetching youtube live chat.

Forked from pytchat-ng (revertical), itself forked from pytchat (taizan-hokuto). Import name stays pytchat. Uninstall pytchat / pytchat-ng first: pip uninstall pytchat pytchat-ng




Description

pytchat is a python library for fetching youtube live chat without using Selenium or BeautifulSoup.

Other features:

  • Customizable chat data processors including youtube api compatible one.
  • Available on asyncio context.
  • Quick fetching of initial chat data by generating continuation params instead of web scraping.

For more detailed information, see wiki.

Install

pip install thememasterchat

Examples

Fetch chat data (see wiki)

import pytchat
chat = pytchat.create(video_id="uIx8l2xlYVY")
while chat.is_alive():
    for c in chat.get().sync_items():
        print(f"{c.datetime} [{c.author.name}]- {c.message}")

Output JSON format string (feature of DefaultProcessor)

import pytchat
import time

chat = pytchat.create(video_id="uIx8l2xlYVY")
while chat.is_alive():
    print(chat.get().json())
    time.sleep(5)
    '''
    # Each chat item can also be output in JSON format.
    for c in chat.get().items:
        print(c.json())
    '''     

other

Structure of Default Processor

Each item can be got with sync_items() function.

name type remarks
type str "superChat","textMessage","superSticker","newSponsor"
id str
message str emojis are represented by ":(shortcut text):"
messageEx str list of message texts and emoji dicts(id, txt, url).
timestamp int unixtime milliseconds
datetime str e.g. "2019-10-10 12:34:56"
elapsedTime str elapsed time. (e.g. "1:02:27") *Replay Only.
amountValue float e.g. 1,234.0
amountString str e.g. "$ 1,234"
currency str ISO 4217 currency codes (e.g. "USD")
bgColor int RGB Int
author object see below

Structure of author object.

name type remarks
name str
channelId str *chatter's channel ID.
channelUrl str
imageUrl str
badgeUrl str
isVerified bool
isChatOwner bool
isChatSponsor bool
isChatModerator bool

Licence

MIT License

Metadata

Release files for thememasterchat 0.1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thememasterchat 0.1.0.1
File Size Uploaded Provenance Actions
thememasterchat-0.1.0.1.tar.gz 36.8 kB Without provenance Details for thememasterchat-0.1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for thememasterchat 0.1.0.1
File Interpreter ABI Platform Actions
thememasterchat-0.1.0.1-py3-none-any.whl Python 3 none any Details for thememasterchat-0.1.0.1-py3-none-any.whl

Total release size: 85.8 kB

Release files / thememasterchat-0.1.0.1.tar.gz

Download URL thememasterchat-0.1.0.1.tar.gz
Size 36.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7eef6ed2b294a7966188e3b191802e8a240e90d64452eed219b53bb82d9321e6
BLAKE2b-256 checksum
How to use checksums
0585e589e3bf367cb708c2ecfce5772d06ceb3ce1d2723e9e4e441b72738a2ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / thememasterchat-0.1.0.1-py3-none-any.whl

Download URL thememasterchat-0.1.0.1-py3-none-any.whl
Size 49.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
982c9292241f48e4de90c90b126964ccd2eca548d4f5e2c8d00bdbb80adfd07d
BLAKE2b-256 checksum
How to use checksums
0090a4ab10576c23e2bafc6ddb7553032b22d770857c1dc4d22edad4a3c5cbfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for thememasterchat 0.1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page