Comments (2)
Hi there! The new version now uses generators to manage chat objects :) This makes it a lot easier to define better/more complex callback options. As an example:
from chat_replay_downloader import ChatDownloader
video_id = 'J2umj9SgdFU'
chat = ChatDownloader().get_chat(video_id) # creates a generator
for message in chat: # you can now iterate over it!
print(message) # callback goes here
would continue outputting:
{'action_type': 'add_chat_item', 'message': 'finally Vishy with new camera angle', 'message_id': 'CkUKGkNQX2cyLS1QeHU0Q0ZmSU1mUW9kVTMwTDRBEidDSi1ScWRLUHh1NENGZXFEckFJZF9pUUhZUTE2MTIwOTQ0NjQ0ODY%3D', 'timestamp': 1612094465568923, 'author': {'name': 'Samir Ghimire', 'images': [{'url': 'https://yt3.ggpht.com/ytc/AAUvwni2C4pmWWWjaxY2ZUnFjYqiyCpD3Y-mXhozkw=s32-c-k-c0xffffffff-no-rj-mo', 'width': 32, 'height': 32, 'id': '32x32'}, {'url': 'https://yt3.ggpht.com/ytc/AAUvwni2C4pmWWWjaxY2ZUnFjYqiyCpD3Y-mXhozkw=s64-c-k-c0xffffffff-no-rj-mo', 'width': 64, 'height': 64, 'id': '64x64'}], 'id': 'UCD-RwEzxUzl1MsSpc-AwMtw'}, 'message_type': 'text_message'}
{'action_type': 'add_chat_item', 'message': 'ohh thank you', 'message_id': 'CkUKGkNPWHotLS1QeHU0Q0ZYMGVyUVlkVmxzR1BnEidDTUhEOXE2UHh1NENGZUhyT0FZZGNUd0NDZzE2MTIwOTQ0NjU1NDI%3D', 'timestamp': 1612094466095675, 'author': {'name': 'Bilal Dwianugrah', 'images': [{'url': 'https://yt3.ggpht.com/ytc/AAUvwngONPUrnE6jnDHU48XbXmcj5XAjz1K86KMjFA=s32-c-k-c0xffffffff-no-rj-mo', 'width': 32, 'height': 32, 'id': '32x32'}, {'url': 'https://yt3.ggpht.com/ytc/AAUvwngONPUrnE6jnDHU48XbXmcj5XAjz1K86KMjFA=s64-c-k-c0xffffffff-no-rj-mo', 'width': 64, 'height': 64, 'id': '64x64'}], 'id': 'UCFb-yF95C1QOrFNWYCAc3Zw'}, 'message_type': 'text_message'}
I will be adding a lot of documentation soon! I just had to release this relatively unpolished version because of YouTube API endpoint changes.
from chat-downloader.
Ohhhh it's now a generator, that's really great!
Thank you!
from chat-downloader.
Related Issues (20)
- [BUG] On my pc it works but on my friend's it doesn't HOT 5
- how can stop sesion chat?
- [QUESTION] How do I get chat log from start of live youtube broadcast? HOT 3
- REMOVE THIS, THANKS
- Incomplete Parsing of Fundraising Donation Messages in Live Chat HOT 2
- [QUESTION] Title goes here
- ModuleNotFoundError: No module named 'chardet'
- [QUESTION] How can I stop chat downloader if the livestreaming is offline
- [FEATURE] [Twitch] Add `{datetime}` in ouput operation
- [FEATURE] [Youtube] Add filter for stream announce
- [FEATURE] create_clip function
- [BUG] Filename string after --output cannot begin with dash(-) due to mis-interpretated as option HOT 5
- [BUG] socs.value missing from cookies
- CHAT STOPED AFTER ANY TIME HOT 2
- [QUESTION] How to replace shorthand emotes, like :confounded_face:, with UTF, like 😖 ?
- [BUG] YouTube URL parsing error
- [FEATURE] errorlevel 0
- inactivity_timeout HOT 1
- [FEATURE] Kick support
- [QUESTION] Module Hook?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chat-downloader.