init
This commit is contained in:
2
twitchchatirc/.gitignore
vendored
Normal file
2
twitchchatirc/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.env
|
||||
__pycache__
|
||||
21
twitchchatirc/LICENSE
Normal file
21
twitchchatirc/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Joshua Lochner
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
189
twitchchatirc/README.md
Normal file
189
twitchchatirc/README.md
Normal file
@@ -0,0 +1,189 @@
|
||||
# Twitch Chat IRC
|
||||
A simple tool used to send and receive Twitch chat messages over IRC with python web sockets. Receiving does not require authentication, while sending does.
|
||||
|
||||
|
||||
|
||||
|
||||
## Setup
|
||||
### Requirements:
|
||||
* This tool was created in a Python 3 environment.
|
||||
* Run `pip install -r requirements.txt` to ensure you have the necessary dependencies.
|
||||
|
||||
### Authentication
|
||||
If you intend to send messages, you will require authentication.
|
||||
1. Go to https://twitchapps.com/tmi/
|
||||
2. Click "Connect".
|
||||
3. Log in with Twitch.
|
||||
4. Copy the generated oath token. Now, there are 2 ways to proceed:
|
||||
- (Recommended) Create a file called `.env` and save your credentials here as:
|
||||
> NICK=x <br> PASS=y
|
||||
|
||||
replacing `x` and `y` with your username and oauth token respectively.<br> See `example.env` for an example.
|
||||
|
||||
- Pass your credentials as function/command line arguments. See below for examples.
|
||||
|
||||
|
||||
## Command line:
|
||||
### Usage
|
||||
```
|
||||
usage: twitch_chat_irc.py [-h] [-timeout TIMEOUT]
|
||||
[-message_timeout MESSAGE_TIMEOUT]
|
||||
[-buffer_size BUFFER_SIZE]
|
||||
[-message_limit MESSAGE_LIMIT] [-username USERNAME]
|
||||
[-oauth OAUTH] [--send] [-output OUTPUT]
|
||||
channel_name
|
||||
|
||||
Send and receive Twitch chat messages over IRC with python web sockets. For
|
||||
more info, go to https://dev.twitch.tv/docs/irc/guide
|
||||
|
||||
positional arguments:
|
||||
channel_name Twitch channel name (username)
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-timeout TIMEOUT, -t TIMEOUT
|
||||
time in seconds needed to close connection after not
|
||||
receiving any new data (default: None = no timeout)
|
||||
-message_timeout MESSAGE_TIMEOUT, -mt MESSAGE_TIMEOUT
|
||||
time in seconds between checks for new data (default:
|
||||
1 second)
|
||||
-buffer_size BUFFER_SIZE, -b BUFFER_SIZE
|
||||
buffer size (default: 4096 bytes = 4 KB)
|
||||
-message_limit MESSAGE_LIMIT, -l MESSAGE_LIMIT
|
||||
maximum amount of messages to get (default: None =
|
||||
unlimited)
|
||||
-username USERNAME, -u USERNAME
|
||||
username (default: None)
|
||||
-oauth OAUTH, -password OAUTH, -p OAUTH
|
||||
oath token (default: None). Get custom one from
|
||||
https://twitchapps.com/tmi/
|
||||
--send send mode (default: False)
|
||||
-output OUTPUT, -o OUTPUT
|
||||
output file (default: None = print to standard output)
|
||||
```
|
||||
|
||||
### Examples
|
||||
#### Receiving messages
|
||||
##### 1. Output messages from a livestream to standard output
|
||||
```
|
||||
python twitch_chat_irc.py <channel_name>
|
||||
```
|
||||
|
||||
##### 2. Output messages from a livestream to a file
|
||||
```
|
||||
python twitch_chat_irc.py <channel_name> -output <file_name>
|
||||
```
|
||||
|
||||
If the file name ends in `.json`, the array will be written to the file in JSON format. Similarly, if the file name ends in `.csv`, the data will be written in CSV format. <br> Otherwise, the chat messages will be outputted to the file in the following format:<br>
|
||||
`[<time>] <author>: <message>`
|
||||
|
||||
##### 3. Set a timeout (close connection if no message has been sent in a certain time)
|
||||
```
|
||||
python twitch_chat_irc.py <channel_name> -timeout <time_in_seconds> -output <file_name>
|
||||
```
|
||||
|
||||
There are other options, such as `message_timeout` and `buffer_size`, but these normally do not need to be changed. See above for a description of all options.
|
||||
|
||||
##### 4. Set a maximum number of messages to read (close connection once limit has been reached)
|
||||
```
|
||||
python twitch_chat_irc.py <channel_name> -message_limit <number_of_messages> -output <file_name>
|
||||
```
|
||||
|
||||
|
||||
#### Example outputs
|
||||
[JSON Example](examples/example.json):
|
||||
```
|
||||
python twitch_chat_irc.py <channel_name> -output example.json
|
||||
```
|
||||
|
||||
[CSV Example](examples/example.csv):
|
||||
```
|
||||
python twitch_chat_irc.py <channel_name> -output example.csv
|
||||
```
|
||||
|
||||
[Text Example](examples/example.txt):
|
||||
```
|
||||
python twitch_chat_irc.py <channel_name> -output example.txt
|
||||
```
|
||||
|
||||
|
||||
#### Sending messages
|
||||
This will open an interactive session which allows you to send messages to the specified channel.
|
||||
##### 1. Send messages to a channel (authentication via .env)
|
||||
```
|
||||
python twitch_chat_irc.py --send <channel_name>
|
||||
```
|
||||
|
||||
##### 2. Send messages to a channel (authentication via arguments)
|
||||
```
|
||||
python twitch_chat_irc.py --send <channel_name> -username <username> -oauth <oauth_token>
|
||||
```
|
||||
|
||||
## Python module
|
||||
|
||||
### Importing the module
|
||||
|
||||
```python
|
||||
import twitch_chat_irc
|
||||
```
|
||||
|
||||
### Examples
|
||||
#### Starting a connection
|
||||
This allows for both receiving and sending of messages
|
||||
##### 1. Start a connection with Twitch chat using credentials in `.env` (if any)
|
||||
|
||||
```python
|
||||
connection = twitch_chat_irc.TwitchChatIRC()
|
||||
```
|
||||
##### 2. Start a connection with Twitch chat using credentials
|
||||
|
||||
```python
|
||||
connection = twitch_chat_irc.TwitchChatIRC('username','oauth:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
|
||||
```
|
||||
#### Receiving messages
|
||||
The `listen` method returns a list when a `KeyboardInterrupt` is fired, or when a timeout/limit has been reached. The arguments shown below can be used together to form more complex method calls.
|
||||
|
||||
##### 1. Get a list of messages from a channel
|
||||
```python
|
||||
messages = connection.listen('channel_name')
|
||||
```
|
||||
|
||||
##### 2. Get a list of messages from a channel, stopping after not getting a message for 30 seconds
|
||||
```python
|
||||
messages = connection.listen('channel_name', timeout=30)
|
||||
```
|
||||
|
||||
##### 3. Get a list of messages from a channel, stopping after getting 100 messages
|
||||
```python
|
||||
messages = connection.listen('channel_name', message_limit=100)
|
||||
```
|
||||
|
||||
##### 4. Write messages from a channel to a file
|
||||
```python
|
||||
connection.listen('channel_name', output='file.txt')
|
||||
```
|
||||
|
||||
##### 5. Set a callback function to be fired each time a message is received
|
||||
```python
|
||||
def do_something(message):
|
||||
print(message)
|
||||
|
||||
connection.listen('channel_name', on_message=do_something)
|
||||
```
|
||||
|
||||
#### Sending messages
|
||||
The `send` method allows for messages to be sent to different channels. This method requires valid authentication to be provided, otherwise an exception will be called.
|
||||
|
||||
##### 1. Send a message
|
||||
```python
|
||||
message = 'Hello world!'
|
||||
connection.send('channel_name', message)
|
||||
```
|
||||
|
||||
#### Close connection
|
||||
The `close_connection` method closes the connection with Twitch chat. No futher messages can be received or sent now.
|
||||
|
||||
##### 1. Close a connection
|
||||
```python
|
||||
connection.close()
|
||||
```
|
||||
4
twitchchatirc/example.env
Normal file
4
twitchchatirc/example.env
Normal file
@@ -0,0 +1,4 @@
|
||||
# Once credentials are set up, rename this file to .env
|
||||
# Go to https://twitchapps.com/tmi/ to get your oauth token
|
||||
NICK=username
|
||||
PASS=oauth:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
128
twitchchatirc/examples/example.csv
Normal file
128
twitchchatirc/examples/example.csv
Normal file
@@ -0,0 +1,128 @@
|
||||
badge-info,emote-only,badges,emotes,room-id,client-nonce,user-type,tmi-sent-ts,mod,user-id,flags,turbo,display-name,subscriber,id,message,color
|
||||
subscriber/1,1,subscriber/0,25:0-4,127550308,09b8128f063b62f7942334efb9a66909,,1595816099308,0,430645544,,0,sophiexbc,1,79f7b57f-e341-4f7a-baed-2f4af2842d87,Kappa,#1E90FF
|
||||
,,premium/1,25:4-8,127550308,4f32226107d3c55d19776502289d4dc2,,1595816099422,0,72104509,,0,dougie___jones,0,cf73e3c1-ce4e-4b46-9f2f-c61a0992ef2a,lag Kappa,#00FF7F
|
||||
,,bits-charity/1,,127550308,185dee001c30ccb0fadc56f02d13e8b0,,1595816099572,0,148564215,,0,coffeeindex,0,63c97135-ac87-466e-8683-00168f2a629e,L OMEGALUL G,#4C3D30
|
||||
,1,,25:0-4,127550308,a270a675bf2b23165cd938e47c0caf5b,,1595816099785,0,68412986,,0,AmazonESP,0,3dd26b43-94ef-4f52-b02b-0c37d912db57,Kappa,#1E90FF
|
||||
subscriber/1,,subscriber/0,25:0-4,127550308,a7c8803dc1952befc7af87e3fbf998e4,,1595816100038,0,36029783,,0,Deflecti0n,1,29a116c0-c9a2-4db5-985b-c1f6420575ed,Kappa lag,#FF0000
|
||||
subscriber/1,,subscriber/0,,127550308,7fd5330dbaebcb8c5ea041cfe28f5ebf,,1595816100393,0,187748286,,0,Dortok,1,35ee1917-0e1f-4b9f-b93a-c030d740bd66,YEP lag,#8A2BE2
|
||||
subscriber/2,,"subscriber/0,premium/1",,127550308,d016325ea59d18b1b3c47ebd9a45e82d,,1595816100907,0,58745385,,0,danification9,1,98ea9d04-e3c0-4fb9-8de6-f053ea13f8a7,Sadge,
|
||||
subscriber/2,,subscriber/0,,127550308,fb41538db686b39f413eda0af42cec1c,,1595816101643,0,43658581,,0,pab1994,1,35ed9d06-f3cd-41c4-9fcd-3d25dc94fd5a,yup,
|
||||
,,,,127550308,8163a20dc852d1e8cc783411b38b22b4,,1595816101637,0,164828199,,0,aa175,0,83da06ce-193a-4b9c-b7da-35b65a1b5ff2,g3 rooooooooooook @BotezLive,
|
||||
subscriber/1,,subscriber/0,,127550308,c83235028c79087d0146bb8735412f87,,1595816102163,0,25101760,,0,vespereq_,1,b1673d7c-a049-46c9-bae0-f56bfaa7ac2e,It's t h e wine,
|
||||
subscriber/2,,subscriber/0,,127550308,28eb83194e637818b539d2a411bce483,,1595816102288,0,541613570,0-4:A.3,0,botezslavic,1,6f371af1-9680-4743-8402-fa4154fa4327,DRUNK,#8A2BE2
|
||||
subscriber/1,,subscriber/0,,127550308,a6754c4e9795f9d1e344f689b72e4ab1,,1595816102306,0,52430007,,0,rowrow_,1,daa114be-9c2b-409c-be84-0fe03e10790c,no johns,#DAA520
|
||||
subscriber/2,1,"subscriber/0,premium/1",115847:0-6,127550308,c4cc2b7fbab56d770b1b892b7bcfe452,,1595816102360,0,168644445,,0,slightlyHyPhi,1,1ba8cdea-403f-4265-b0ca-29edfd0b9725,KappaHD,
|
||||
,,hype-train/2,,127550308,c779bfdd9b99c56aaafe4c9c122f448a,,1595816102389,0,56448721,,0,ReadingRailroad,0,3c9f340c-b408-48ef-86df-9e6fc64ac13c,Yep,#D2691E
|
||||
,,premium/1,,127550308,59d0902b7dd8e7823c044688a26b246c,,1595816102598,0,466535256,,0,CrenshawViews,0,828c2fbd-b921-4430-b95d-dc8549a14591,yeah it glitched,#1546D1
|
||||
,,premium/1,,127550308,a2c5a2d65b01bdb151944299d42be320,,1595816102879,0,92289099,,0,Heat_Signature,0,be24b7b2-11db-4e0c-8fdf-296561fb56bd,LAG ON CHESS OMEGALUL,#FF0000
|
||||
subscriber/1,,subscriber/0,25:0-4,127550308,45bdd07b402d1bc7b630f3399248954e,,1595816103185,0,25334507,,0,LeetChocolate,1,577286ea-4a0b-47b9-a78e-98bad4bbf9c5,Kappa lag,#FF4500
|
||||
,,,,127550308,f659cba7c6f4ffb5e30753d5840002f7,,1595816103329,0,499095797,,0,swornheart,0,b5d0b644-982a-4171-bf0f-a2dcd0b7ee22,that was brain lag,#0000FF
|
||||
,,,,127550308,cb3d75a24f56025acb5dd10ea71334ef,,1595816103349,0,93958150,,0,JpForrReal,0,59ec74e2-c256-4d5e-810b-91d6d074660d,OMEGALUL,#F4BBFF
|
||||
,1,premium/1,1140308:0-5,127550308,,,1595816103439,0,220980492,,0,AleFalnx,0,4ebf0739-9a1e-4cbf-86af-c395c1f1eec0,atpCap,#89DF9A
|
||||
,1,,25:0-4,127550308,b1a00f55915c59e8e87b3c78c97809f0,,1595816103488,0,178346898,,0,hericium7,0,badf7c28-9ce0-4f22-ad6c-14a4b232298a,Kappa,
|
||||
subscriber/1,,"subscriber/0,glhf-pledge/1",,127550308,679619cd7f623b08fb7cef135b335d6d,,1595816103492,0,246206955,,0,ezeroh13,1,c8951d08-159d-45ef-9d55-94244df817d6,YEP LAG,#B22222
|
||||
,,premium/1,25:4-8,127550308,8db72e3f8b40969d001812f9fd88d04c,,1595816103535,0,195983667,,0,Nativezk,0,f3d2809c-a2e1-414c-99cf-f861afa1e667,lag Kappa,#FF69B4
|
||||
,,premium/1,25:13-17,127550308,516d0459f3764bec68c66474f502c768,,1595816103731,0,72104509,,0,dougie___jones,0,2b6b4971-d03c-48ef-b30e-2625a9594ec8,yeah totally Kappa,#00FF7F
|
||||
,1,,25:0-4,127550308,3566311f7dad1ccec17385d4fd0ecd25,,1595816103979,0,47117924,,0,CoDyPhin,0,8531ead3-783a-4394-8e0d-39555e6cae11,Kappa,#1E90FF
|
||||
subscriber/1,,"subscriber/0,premium/1",,127550308,a1f63fd5d71add06d18519e24ae4d649,,1595816104011,0,57651751,,0,Nico3094,1,99b7e9dc-0b98-4a4f-839b-b049ed293022,lag YEP,#0000FF
|
||||
subscriber/1,,"subscriber/0,premium/1",,127550308,ed024a395f2653252d0f1f0719e082f4,,1595816104086,0,76578093,,0,RoLoSC,1,829e8f65-e498-40cd-b575-b99e6141cd0e,yeah little lage,#FF0000
|
||||
subscriber/1,,"subscriber/0,premium/1",25:0-4,127550308,e4f66802252d122a6a1aec5d6be1911a,,1595816104351,0,46899419,,0,ArcticPolarbear,1,eb399ea9-7198-4abc-a0b9-34c6f7b9f743,Kappa lag,#B22222
|
||||
subscriber/1,,"subscriber/0,bits/1000",,127550308,030d87013b0cf82db86359a62986b341,,1595816104364,0,426507835,,0,kzp99,1,a619a855-265c-44cf-9415-b920b1d88bea,LAG,
|
||||
,,premium/1,,127550308,d7997a5b244bdd712f140c3641ca2bd7,,1595816104463,0,59865720,,0,FrankDaTankGaming,0,5cd8fd7b-0609-4b65-ba19-a53bda8ac7a1,does that for me sometimes too,#CC0000
|
||||
,,premium/1,,127550308,68b246b5bd6667927320467e39f3d6a7,,1595816104600,0,22265843,,0,modestmage,0,d1deb4da-9673-48e1-898c-741b6e0565b9,wasnt that a trade?,#008000
|
||||
,,,,127550308,3afd5d8d06cc3d97b13d56522fa14e80,,1595816104624,0,45557046,,0,yop01,0,faae5af5-d551-42b7-993a-3d99d1f1c840,Yes,#00FF7F
|
||||
subscriber/1,,subscriber/0,25:0-4,127550308,160b2211a3db32b13014711567d491fe,,1595816104597,0,430645544,,0,sophiexbc,1,7a357cf3-5314-4885-b30a-9f7b43b9a9a7,Kappa lag,#1E90FF
|
||||
subscriber/1,,"subscriber/0,premium/1",,127550308,663889801a61a035f00b2d397988822f,,1595816104756,0,169719325,,0,swift_ocelot,1,0e1c06c1-1697-422d-b58d-6ff0b8e713fb,YEP lag,#FF7F50
|
||||
,,,,127550308,,,1595816105421,0,39067863,,0,cinasxd,0,613a93e5-82ce-410c-b040-5f781f2cf2e6,kappa,
|
||||
,,premium/1,,127550308,,,1595816105609,0,208236597,,0,jrude72,0,71baa10e-4edb-43fa-a289-469e1c4d1161,So what r u up to for the next 24 hours?,
|
||||
,,,,127550308,c78950b7be2e6822bda92a6db5f57509,,1595816105662,0,44112166,,0,brettydoes,0,aeecd502-e436-4628-af05-933d28f1dba2,YEP lag,#FF69B4
|
||||
,,,,127550308,86ad8f283188e0a1495b7c842137b75f,,1595816105720,0,553991126,,0,kavifa6176,0,59b15ae1-4061-470a-952b-ee6283c530ef,Brain lag,
|
||||
subscriber/3,,subscriber/3,25:6-10,127550308,88c2064750caacd13b04453b343ab1bc,,1595816106052,0,233736723,,0,drawingdead,1,77fcfbed-dae2-45cd-99a6-b681adeb3211,mhmmm Kappa,
|
||||
,,,,127550308,dca8af8308374e8cda730d766192a417,,1595816106179,0,27479429,,0,Cajun292,0,88fdf5b9-4a98-4bea-ae02-eccade8f2a62,bullet lag,#FE02CC
|
||||
,,premium/1,,127550308,8487307d22ca70080bf127bd1cbc259a,,1595816106261,0,107123504,,0,bittersandwich,0,32122034-f1e1-486c-b980-5241ce9f305f,blaming on lag LULW,#14DBD1
|
||||
,,,,127550308,5000e2f06c600b36b1e99bba6720cbe0,,1595816106687,0,189862796,0-3:A.3,0,loayakram,0,ef39469c-4532-4d63-a0f2-c892b9d98763,fake,
|
||||
subscriber/1,,subscriber/0,,127550308,7bab671f446e42a643744a4cfe29c4e9,,1595816106783,0,233579908,7-11:A.3,0,xivi76,1,40b88458-e54f-4862-9e96-df1ef2429530,you're drunk,
|
||||
subscriber/1,,subscriber/0,,127550308,9964a62a8c7e8fa5253018dddbccff18,,1595816106749,0,25101760,,0,vespereq_,1,1834b9a3-be36-475c-a20f-2519d07ad5a4,WINE LAG,
|
||||
,,,,127550308,901dc1be63bbc1b233d7fc8cd79b5d2c,,1595816106826,0,484766599,0-4:A.3,0,deepbishop,0,c90fad1e-d6c1-47d4-85bf-ec57b1bfc866,drunk,
|
||||
subscriber/1,1,"subscriber/0,premium/1",25:0-4,127550308,6d002d55bd5c748445848baef962a43f,,1595816106963,0,77110683,,0,HaloMonkey3009,1,1568de89-043b-4052-bb5d-4877c4a836f3,Kappa,#00FCFF
|
||||
subscriber/1,1,subscriber/0,25:0-4,127550308,a2a1400a09c0c8d1e0056b5473e0d15e,,1595816107192,0,74878349,,0,kilner111,1,744dde86-9485-446a-9a86-e0ff2f83260b,Kappa,#8A2BE2
|
||||
,,,,127550308,7e861ef2cecfb902c95351920555e2f6,,1595816107269,0,452580538,,0,NotReformeduwu,0,4f4140f6-5dd7-4baa-9c5c-06237f24011f,YEP,
|
||||
,,,,127550308,,,1595816107375,0,254499567,,0,juanhc24v2,0,0778230b-6174-450f-b852-a4f7b2823ebe,YEP LAG,#00FF7F
|
||||
subscriber/2,,"subscriber/0,premium/1",,127550308,74b2411af72bc224a6b125769950b9d5,,1595816107440,0,58745385,,0,danification9,1,91c2e96c-5450-4cf9-bae4-a1ae89f43965,CHESS LAG,
|
||||
subscriber/1,1,subscriber/0,25:0-4,127550308,084dd2f2f4f9d8003edc2e7abe2d9320,,1595816107521,0,120169544,,0,ItsRua,1,15090353-1236-4cae-ac3a-8ed6597cf17a,Kappa,
|
||||
,1,premium/1,25:0-4,127550308,008abf709a01b2cec0e77ae608748fb0,,1595816107628,0,500900526,,0,Pong8770,0,599ebd5a-f07a-4d62-b86a-d1889a1db71f,Kappa,#B22222
|
||||
,1,premium/1,25:0-4,127550308,,,1595816107793,0,39491422,,0,magnumd0nger,0,7ea756ff-736c-4199-890b-913585edb080,Kappa,#850303
|
||||
subscriber/1,,subscriber/0,,127550308,9cd9d5322cb32748c80f9ac636785fa9,,1595816107829,0,52430007,,0,rowrow_,1,cf7fd9ef-c2e8-450e-9968-5aa25b3007e3,no johns boatz,#DAA520
|
||||
subscriber/1,,"subscriber/0,premium/1",,127550308,884ab0300555032462e1f65005166f11,,1595816108173,0,46899419,,0,ArcticPolarbear,1,17d7c1ad-4e6f-49f0-a523-a65e3ec2da7a,brain lag,#B22222
|
||||
,,bits/1000,,127550308,c65720b8372d7b27a8fab30829848eb4,,1595816108223,0,169027853,,0,febog,0,61d074ac-d6e5-4446-a37e-5eae0f224165,YEP lag,#1E90FF
|
||||
subscriber/3,,subscriber/3,,127550308,23c8813ef0fc52c15f90a741371b1770,,1595816108353,0,28276685,,0,1y1e,1,855d978e-dfb9-4c9e-8739-4c37b36eb77e,lag exists between eyes and brain,#2E8B57
|
||||
,,premium/1,25:4-8,127550308,,,1595816108409,0,25286001,,0,Nicktown,0,d763a6fc-634d-42af-9c52-f66a70bce5ce,lag Kappa,#0000FF
|
||||
,,,,127550308,69f54844b1ecdc5a5306bf75b67cbffe,,1595816108414,0,24651046,,0,Gabber__,0,d1e612ea-338e-42e8-84a0-4584ee18008b,monkaHmm,#FFFFFF
|
||||
subscriber/7,,"subscriber/6,bits/100",,127550308,58fc6c30a6445398e467483f4629ab79,,1595816108844,0,217399619,,0,Adenosine_Tri_Phosphate,1,afd25cc8-9510-4550-b5eb-9324b6ca610f,#blamechesscom,#999999
|
||||
,,,,127550308,94f92dad885d49cdf0d4d74d694b94d4,,1595816108963,0,265540494,,0,maek_28,0,973dfe4b-9be9-4d05-85ca-755551f52190,nope,
|
||||
,,,,127550308,ce7721c36b549cd969d1732b0c66f5a7,,1595816109129,0,274725794,,0,einn9,0,75b1f985-8db0-4a91-995e-d3261a51b90e,sadchamp,
|
||||
subscriber/1,,subscriber/0,,127550308,cedca7b9fa8f9889d212559ef4a65bc4,,1595816109165,0,97151792,,0,thekid_54,1,be0445d4-96fd-4a2d-9a98-85b298e2d5c4,24 hours?,#FD00BB
|
||||
,1,,25:0-4,127550308,d21664375fd9a9a340c0d18f8476cf87,,1595816109286,0,132665916,,0,oceanman_takemebytheh4nd,0,218ab304-f255-4e24-82fc-4412db8769fc,Kappa,#551A8B
|
||||
,,,25:4-8,127550308,99d8e8432f44cf0fd5fc0c37c515c046,,1595816109366,0,31050861,,0,skitlzx,0,fc682baf-6159-4e62-8902-fc941ae6b3e4,lag Kappa,#0000FF
|
||||
,,,,127550308,65cc7bea1952413af77c3beb754eee9b,,1595816109437,0,204434546,,0,ImDisManyTwitch,0,9362896b-3856-4ede-bb62-b37dc12345a1,'Wine Lag',
|
||||
,,,,127550308,0da04429d4f57809a0d152ce649b93f1,,1595816109656,0,484766599,,0,deepbishop,0,27c630ae-443e-4527-9dff-2a40698607a2,lag in your brain,
|
||||
,,,,127550308,cc09588431d2060e47a58712164dbdaa,,1595816109830,0,534243080,,0,gretasdisciples,0,b2c20b7b-e3fa-4e8f-a9e7-9a2e1e98f958,"SURE, A lag",
|
||||
,1,,25:0-4,127550308,be44d05ef78860a93763195c268e8d05,,1595816110137,0,254157596,,0,cupofcocoa__,0,edfe34a2-9c4d-4399-a7d3-c05d41fdaa18,Kappa,#0000FF
|
||||
,,,,127550308,f7f49c9e34784250d858b7a763b0d3d2,,1595816110138,0,77980562,,0,BBeatless,0,c7cd9b9f-651a-4b35-a66c-1d16f47c724e,brain LAG,#1E90FF
|
||||
subscriber/1,,subscriber/0,25:0-4,127550308,4276af5f703b600d8f49fee2f41b10cf,,1595816110119,0,430645544,,0,sophiexbc,1,d40b23ce-ada7-486a-8770-ea37e7f60cae,Kappa sure,#1E90FF
|
||||
,,,,127550308,5c4a80567ab0f943af66d0998cbdcee8,,1595816110594,0,189862796,,0,loayakram,0,9e8eed62-e2c3-4011-b31e-547d304b7285,NO,
|
||||
subscriber/5,,subscriber/3,,127550308,65e436840083d37e6cc9daf6a9b38fb5,,1595816110766,0,207843882,,0,Shroffy7,1,1fb7c924-ea3c-4cfc-9cd6-6808a1aacfad,chess.com PepeLaugh,#FF4500
|
||||
,,,,127550308,f26a03c645cc67bf375b6847ef3d6c93,,1595816110976,0,263124733,,0,LudwigVanBeethoven23,0,d35c610a-c7d9-4a5b-affd-9ae7e935d7cb,lag in chess,
|
||||
,,,,127550308,b9eadfa3e9dfe27f6db4083634fa7b56,,1595816111332,0,164828199,,0,aa175,0,7b3c6764-5ed9-4b6a-bdc9-188915db017f,THE FINAL POSITION IS A DRAw,
|
||||
subscriber/2,,"subscriber/0,premium/1",,127550308,04f914d5b9b8405c21597e9b9161a502,,1595816111530,0,58745385,,0,danification9,1,6429e1e0-c6cf-4666-b884-bef0a8e5d8a2,Brain lag,
|
||||
,1,,25:0-4,127550308,,,1595816111656,0,51032758,,0,Whole_Lotta_Lies,0,94d64716-8213-45ce-a6f1-ef60ab9f8440,Kappa,#2E8B57
|
||||
subscriber/1,,subscriber/0,,127550308,1b843e3869ab21c8923dd1d7f4795673,,1595816111645,0,557195178,,0,byebrows2020,1,9ff86b87-f69b-4343-8faa-91c1be1284ff,LAG BLAME,
|
||||
,,,,127550308,9d293af5749552b8629f0897523baf7d,,1595816112076,0,262128196,,0,slinkyshoots,0,d5ca1063-6f94-44aa-a239-00fe530785b1,Kapp,#00FF7F
|
||||
subscriber/2,,subscriber/0,25:0-4,127550308,db149a2243bb3914841fe23d9cb1bbeb,,1595816112201,0,541613570,6-10:A.3,0,botezslavic,1,eb0c8775-b1b5-49ca-9ec4-1832b62947bb,Kappa Drunk already,#8A2BE2
|
||||
,1,premium/1,25:0-4,127550308,74fe1bc5dae66988b60a8c54e68798e0,,1595816112487,0,195983667,,0,Nativezk,0,36b645e1-e01f-404a-af35-1d478c171c72,Kappa,#FF69B4
|
||||
,,,,127550308,bfbb279442719e5920d553a2761538dc,,1595816112658,0,119618817,,0,ElJavieer,0,f05fb74b-dff1-4654-98e4-28d03d6e78f2,Brain lag,#2E8B57
|
||||
,1,,25:0-4,127550308,,,1595816112802,0,413018612,,0,k4rzheka,0,c4561234-f570-4f41-8904-09aa52c33fd8,Kappa,
|
||||
,,,,127550308,9ad449b192d1de4d7aa596bd156a2062,,1595816113542,0,71627954,,0,Toorshul891,0,0a2f91e4-04c0-43c2-a9c4-7be881a83cfe,yes,#FF0000
|
||||
subscriber/1,,subscriber/0,,127550308,,,1595816113595,0,41972554,,0,elsenatto,1,d0a07de4-fd30-4216-8e58-62c9dbf65797,YEP LAG,#FF0000
|
||||
,,premium/1,,127550308,5f16e408c7c90ffbe042ab4375fff7c7,,1595816113605,0,409091205,,0,iamzul95,0,57c2de5e-fa67-4462-ae17-3aed3f9d91ce,there was a lag,
|
||||
subscriber/1,,"subscriber/0,premium/1",,127550308,,,1595816113693,0,87187380,,0,SemiPro19,1,1ab4c9b5-8383-473a-a860-95121028f0f9,wine lag,
|
||||
,,premium/1,,127550308,e64fcb6a9b5a08b259cc04c152d1dfec,,1595816114198,0,101983685,,0,Clench1k,0,2ca56351-ee78-4efd-8c32-72694cfec3d8,YEP lag,#FF0000
|
||||
subscriber/1,,subscriber/0,,127550308,9021f68fc93100962d0e988f6143018f,,1595816114801,0,23289875,,0,Jaaledon,1,6da1d281-2924-40b3-8fa7-bc425c03beba,"Sure, blame it on your ISP",#0000FF
|
||||
,,,25:8-12,127550308,64c03873fd1d7f7ef5fd375842d73de2,,1595816114958,0,504713042,,0,ocelot022,0,3797dcd3-52ff-45f7-b573-5cc52412e549,ok sure Kappa,
|
||||
subscriber/10,,subscriber/6,"302934780:10-18,26-34,42-50,58-66,74-82",127550308,516affced6902164299a700a388cf543,,1595816115272,0,117880554,,0,sepehr91,1,87d8db4c-04e8-4ec9-9bc2-8fb8c61a286b,lag pepeD botez2300 pepeD botez2300 pepeD botez2300 pepeD botez2300 pepeD botez2300 lag,#00FF7F
|
||||
,,,,127550308,d8e9fbbe67345be0e78d4fab5bdfbc23,,1595816115454,0,484766599,,0,deepbishop,0,467592bf-bdf1-46eb-a8b2-a9b5bd2a6bb6,brain lag,
|
||||
,,premium/1,,127550308,,,1595816115903,0,512437416,,0,augusto_vam,0,384f4487-62fd-464b-aa43-132f5d29c97d,BRAIN LAG,
|
||||
,,,,127550308,,,1595816115910,0,550092913,,0,010293101,0,acb3ba00-6e77-4039-b298-9d8c226bceee,Dronk,
|
||||
subscriber/1,,subscriber/0,,127550308,89a17afbfa128e565f95c860f2a3a6ca,,1595816115909,0,58317233,,0,mrchair1982,1,91dd1bf2-2737-4951-862b-f8021e9f6d02,how have you already dropped so far down from 2300?,#FF0000
|
||||
subscriber/1,,subscriber/0,,127550308,,,1595816116392,0,113854995,,0,xavierrocket,1,6200b631-4f59-4374-a551-1185e3eff4d9,"I've had a ton of messed up moves because of lag, I know the pain Sadge",#CC0000
|
||||
,,,25:4-8,127550308,d3edaa32d363cf4b4220b4bfbf730c3c,,1595816116471,0,6888738,,0,AznBoy222,0,73251b3e-c38e-4041-bb10-67adb9ca183b,yep Kappa,#FF0000
|
||||
subscriber/1,,subscriber/0,,127550308,,,1595816116526,0,48780004,,0,Cnoized,1,fffd4298-a450-42be-a2db-cb0e0e53a148,I saw it.,#00FF7F
|
||||
,,,,127550308,,,1595816116580,0,144960091,,0,jisos12369,0,f9c2ff7f-d306-4ca7-bbbd-2dbdd25c0614,YEP lag,#1E90FF
|
||||
,,premium/1,,127550308,3c37ca135a77f7597a4cdf86321b5bca,,1595816116668,0,442498004,,0,juanber,0,f8c1c408-4c4a-4a8e-b1a4-422345ce902f,brain lag,
|
||||
subscriber/7,1,subscriber/2006,302895853:0-7,127550308,10ba03ddf7192e3c492547c018c47c83,,1595816116704,0,255884924,,0,RO0PE,1,1a125c0f-3ffd-45c2-ae32-5c4758634c43,botezCIA,
|
||||
,,,25:58-62,127550308,7cab32d02b49d46c0f8f094192eb4e3a,,1595816117665,0,90516629,,0,Mossico,0,2104a46a-a31e-4811-8de9-42777b9ce925,perhaps your perception of time is impaired at the moment Kappa,
|
||||
subscriber/3,,subscriber/3,88:15-22,127550308,649c5c64e0b9a9946509692b9fe935fa,,1595816118589,0,152865823,,0,lurker_above,1,b4ae57d5-ff9b-4751-8b90-63aefd1015d4,24 hour stream PogChamp,
|
||||
,,premium/1,,127550308,805dc602bc1d75963a5e5bf9ffb86ab6,,1595816118924,0,177511477,,0,dildo_fire,0,f504ed44-9c19-4c4d-b69c-7456e76c74ba,that's why i play on lichess,#504B44
|
||||
,,,,127550308,,,1595816119093,0,527834016,,0,zloriginals,0,48474373-5e57-42e5-ba93-d346eaf8f184,Just u,
|
||||
,,,,127550308,319a67044c5003601f705abaf16542cd,,1595816119284,0,47117924,,0,CoDyPhin,0,f1a5b6d5-3614-4d6f-8a8f-c9511c7e3a61,1345 AndreaPls pepeD blobDance AndreaPls pepeD blobDance AndreaPls pepeD blobDance AndreaPls pepeD blobDance AndreaPls pepeD blobDance AndreaPls pepeD blobDance,#1E90FF
|
||||
subscriber/1,,"subscriber/0,premium/1",,127550308,,,1595816119373,0,98416009,0-4:A.3,0,Schultzky,1,507e9eb5-593d-48f5-b014-10b6784b5e8a,drunk,#FF0000
|
||||
,,,,127550308,ee1bbc8080c48ce26accd61ea405d39c,,1595816119464,0,189862796,,0,loayakram,0,a9fa6238-e237-4ac7-b9bd-57374a109d07,KAPPA,
|
||||
,1,,"145315:0-12,14-26,28-40,42-54,56-68,70-82,84-96,98-110,112-124,126-138,140-152,154-166,168-180,182-194,196-208,210-222,224-236,238-250,252-264,266-278,280-292,294-306,308-320",127550308,,,1595816119454,0,436262291,,0,itzghost6890,0,64ac2f7d-e975-457c-aa3e-ced46c94f678,TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati,
|
||||
subscriber/1,,"subscriber/2000,bits/100",,127550308,8aab484c2f0ef821c0536dde4f90f8fb,,1595816119878,0,55373647,,0,EpicTripleAssTap,1,11770323-aec0-4767-81b6-588208c53310,PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls,#00FF7F
|
||||
,,premium/1,,127550308,d8386d364e9de4113d16f99f088ad8ca,,1595816119897,0,478625547,,0,skitzt,0,074ab457-dcb8-49c3-be2f-163d20afe789,so 24hr stream?,
|
||||
subscriber/1,,"subscriber/0,premium/1",,127550308,,,1595816120966,0,9095096,,0,NoPantzzz,1,19d535d1-fe64-4750-8a9e-ffe7e43882d2,Laggggggg,#FEA400
|
||||
subscriber/11,,subscriber/6,,127550308,e2b66a7a4278499c62ef48eef673a41e,,1595816121587,0,250839454,,0,zPOUTINEZ,1,5241f949-62dc-45c5-bf81-176cd812b54b,its the wine dude,#FF0000
|
||||
,,,,127550308,5d93ca39fa974f87ae34faa6da934d3c,,1595816122054,0,500766391,,0,merlinnimue,0,5bc1e672-a956-4c64-8bf8-25884361a120,spirit of rasputin,
|
||||
subscriber/2,,subscriber/0,25:9-13,127550308,e84f1dc8db2401daa4e706f8e25802a4,,1595816122170,0,541613570,,0,botezslavic,1,71281c31-2ccc-4ca6-8115-dfcebe388ce4,wine lag Kappa,#8A2BE2
|
||||
,,premium/1,,127550308,3ba4d9d4e0e8bf2f750121df96d36bba,,1595816122308,0,152601449,,0,midgetpanda96,0,eedf2720-66c6-4459-84e0-9bdd6f82152c,ya,
|
||||
,,,25:0-4,127550308,8c590466109e0380d4329bdc33dded67,,1595816123077,0,152709545,,0,stepkc,0,88683f85-805a-4e87-9b78-4a72cadaab7a,Kappa hmm,#00FF7F
|
||||
,,,,127550308,4ba0e28fa15dda235da65be4fe4b7e5e,,1595816123425,0,265540494,,0,maek_28,0,1088b96e-4a40-433a-a620-36a569dec5ec,no lag nope,
|
||||
subscriber/1,1,"subscriber/0,sub-gifter/1",70433:0-8,127550308,,,1595816123499,0,553594803,,0,dogplatformr2,1,46ddc40c-e032-4056-a8a2-e751087f3162,KappaRoss,
|
||||
,,,,127550308,,,1595816123729,0,51032758,,0,Whole_Lotta_Lies,0,72c0bdeb-ce70-4a9d-95c8-777923a4685c,5Head lag,#2E8B57
|
||||
,1,,301443647:0-4/301443646:6-10,127550308,,,1595816124273,0,76087796,,0,Krappa_1_2_3,0,6606358f-2bbb-47e7-9341-3961719ebeea,nymn1 nymn2,#FF0000
|
||||
subscriber/1,,subscriber/0,,127550308,b43c8b5a271298708a7808d74ef71363,,1595816124725,0,522200051,,0,creatovert,1,edfd099d-37b8-4a69-b564-7467d8969fcf,MIND LAG DUE TO WINE,#8A2BE2
|
||||
,,,,127550308,,,1595816124894,0,484284968,,0,kaibennett06,0,a703c39a-7206-42c3-a559-99459054931f,YEP LAG,
|
||||
subscriber/1,,subscriber/0,,127550308,,,1595816124950,0,130382221,,0,k33ling33,1,8fe6738f-d9e7-4490-a703-cd240726ce39,Omg lag,
|
||||
,,,,127550308,f15ab8ab2a81f42f6919b7753be2285d,,1595816125071,0,32171084,,0,dslx,0,d5509a70-fe08-427c-b63a-fd4087dc06e7,Yep lag,#9ACD32
|
||||
,,glhf-pledge/1,123171:10-21,127550308,b182592194b2e3a041c4d0a3ceec34e5,,1595816126541,0,179916073,0-4:A.3,0,nefderek,0,a815d176-d0b5-486c-8c2f-dd606ec77bb5,drunk lag CoolStoryBob,#FF69B4
|
||||
,,,,127550308,f1742a95c860173cbed53c898e6ce917,,1595816126586,0,484766599,,0,deepbishop,0,1c14dd76-5384-47b4-bd4e-2f9e5bd010f7,keep chugging,
|
||||
|
1
twitchchatirc/examples/example.json
Normal file
1
twitchchatirc/examples/example.json
Normal file
File diff suppressed because one or more lines are too long
127
twitchchatirc/examples/example.txt
Normal file
127
twitchchatirc/examples/example.txt
Normal file
@@ -0,0 +1,127 @@
|
||||
[1595816099308] sophiexbc: Kappa
|
||||
[1595816099422] dougie___jones: lag Kappa
|
||||
[1595816099572] coffeeindex: L OMEGALUL G
|
||||
[1595816099785] AmazonESP: Kappa
|
||||
[1595816100038] Deflecti0n: Kappa lag
|
||||
[1595816100393] Dortok: YEP lag
|
||||
[1595816100907] danification9: Sadge
|
||||
[1595816101643] pab1994: yup
|
||||
[1595816101637] aa175: g3 rooooooooooook @BotezLive
|
||||
[1595816102163] vespereq_: It's t h e wine
|
||||
[1595816102288] botezslavic: DRUNK
|
||||
[1595816102306] rowrow_: no johns
|
||||
[1595816102360] slightlyHyPhi: KappaHD
|
||||
[1595816102389] ReadingRailroad: Yep
|
||||
[1595816102598] CrenshawViews: yeah it glitched
|
||||
[1595816102879] Heat_Signature: LAG ON CHESS OMEGALUL
|
||||
[1595816103185] LeetChocolate: Kappa lag
|
||||
[1595816103329] swornheart: that was brain lag
|
||||
[1595816103349] JpForrReal: OMEGALUL
|
||||
[1595816103439] AleFalnx: atpCap
|
||||
[1595816103488] hericium7: Kappa
|
||||
[1595816103492] ezeroh13: YEP LAG
|
||||
[1595816103535] Nativezk: lag Kappa
|
||||
[1595816103731] dougie___jones: yeah totally Kappa
|
||||
[1595816103979] CoDyPhin: Kappa
|
||||
[1595816104011] Nico3094: lag YEP
|
||||
[1595816104086] RoLoSC: yeah little lage
|
||||
[1595816104351] ArcticPolarbear: Kappa lag
|
||||
[1595816104364] kzp99: LAG
|
||||
[1595816104463] FrankDaTankGaming: does that for me sometimes too
|
||||
[1595816104600] modestmage: wasnt that a trade?
|
||||
[1595816104624] yop01: Yes
|
||||
[1595816104597] sophiexbc: Kappa lag
|
||||
[1595816104756] swift_ocelot: YEP lag
|
||||
[1595816105421] cinasxd: kappa
|
||||
[1595816105609] jrude72: So what r u up to for the next 24 hours?
|
||||
[1595816105662] brettydoes: YEP lag
|
||||
[1595816105720] kavifa6176: Brain lag
|
||||
[1595816106052] drawingdead: mhmmm Kappa
|
||||
[1595816106179] Cajun292: bullet lag
|
||||
[1595816106261] bittersandwich: blaming on lag LULW
|
||||
[1595816106687] loayakram: fake
|
||||
[1595816106783] xivi76: you're drunk
|
||||
[1595816106749] vespereq_: WINE LAG
|
||||
[1595816106826] deepbishop: drunk
|
||||
[1595816106963] HaloMonkey3009: Kappa
|
||||
[1595816107192] kilner111: Kappa
|
||||
[1595816107269] NotReformeduwu: YEP
|
||||
[1595816107375] juanhc24v2: YEP LAG
|
||||
[1595816107440] danification9: CHESS LAG
|
||||
[1595816107521] ItsRua: Kappa
|
||||
[1595816107628] Pong8770: Kappa
|
||||
[1595816107793] magnumd0nger: Kappa
|
||||
[1595816107829] rowrow_: no johns boatz
|
||||
[1595816108173] ArcticPolarbear: brain lag
|
||||
[1595816108223] febog: YEP lag
|
||||
[1595816108353] 1y1e: lag exists between eyes and brain
|
||||
[1595816108409] Nicktown: lag Kappa
|
||||
[1595816108414] Gabber__: monkaHmm
|
||||
[1595816108844] Adenosine_Tri_Phosphate: #blamechesscom
|
||||
[1595816108963] maek_28: nope
|
||||
[1595816109129] einn9: sadchamp
|
||||
[1595816109165] thekid_54: 24 hours?
|
||||
[1595816109286] oceanman_takemebytheh4nd: Kappa
|
||||
[1595816109366] skitlzx: lag Kappa
|
||||
[1595816109437] ImDisManyTwitch: 'Wine Lag'
|
||||
[1595816109656] deepbishop: lag in your brain
|
||||
[1595816109830] gretasdisciples: SURE, A lag
|
||||
[1595816110137] cupofcocoa__: Kappa
|
||||
[1595816110138] BBeatless: brain LAG
|
||||
[1595816110119] sophiexbc: Kappa sure
|
||||
[1595816110594] loayakram: NO
|
||||
[1595816110766] Shroffy7: chess.com PepeLaugh
|
||||
[1595816110976] LudwigVanBeethoven23: lag in chess
|
||||
[1595816111332] aa175: THE FINAL POSITION IS A DRAw
|
||||
[1595816111530] danification9: Brain lag
|
||||
[1595816111656] Whole_Lotta_Lies: Kappa
|
||||
[1595816111645] byebrows2020: LAG BLAME
|
||||
[1595816112076] slinkyshoots: Kapp
|
||||
[1595816112201] botezslavic: Kappa Drunk already
|
||||
[1595816112487] Nativezk: Kappa
|
||||
[1595816112658] ElJavieer: Brain lag
|
||||
[1595816112802] k4rzheka: Kappa
|
||||
[1595816113542] Toorshul891: yes
|
||||
[1595816113595] elsenatto: YEP LAG
|
||||
[1595816113605] iamzul95: there was a lag
|
||||
[1595816113693] SemiPro19: wine lag
|
||||
[1595816114198] Clench1k: YEP lag
|
||||
[1595816114801] Jaaledon: Sure, blame it on your ISP
|
||||
[1595816114958] ocelot022: ok sure Kappa
|
||||
[1595816115272] sepehr91: lag pepeD botez2300 pepeD botez2300 pepeD botez2300 pepeD botez2300 pepeD botez2300 lag
|
||||
[1595816115454] deepbishop: brain lag
|
||||
[1595816115903] augusto_vam: BRAIN LAG
|
||||
[1595816115910] 010293101: Dronk
|
||||
[1595816115909] mrchair1982: how have you already dropped so far down from 2300?
|
||||
[1595816116392] xavierrocket: I've had a ton of messed up moves because of lag, I know the pain Sadge
|
||||
[1595816116471] AznBoy222: yep Kappa
|
||||
[1595816116526] Cnoized: I saw it.
|
||||
[1595816116580] jisos12369: YEP lag
|
||||
[1595816116668] juanber: brain lag
|
||||
[1595816116704] RO0PE: botezCIA
|
||||
[1595816117665] Mossico: perhaps your perception of time is impaired at the moment Kappa
|
||||
[1595816118589] lurker_above: 24 hour stream PogChamp
|
||||
[1595816118924] dildo_fire: that's why i play on lichess
|
||||
[1595816119093] zloriginals: Just u
|
||||
[1595816119284] CoDyPhin: 1345 AndreaPls pepeD blobDance AndreaPls pepeD blobDance AndreaPls pepeD blobDance AndreaPls pepeD blobDance AndreaPls pepeD blobDance AndreaPls pepeD blobDance
|
||||
[1595816119373] Schultzky: drunk
|
||||
[1595816119464] loayakram: KAPPA
|
||||
[1595816119454] itzghost6890: TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati TheIlluminati
|
||||
[1595816119878] EpicTripleAssTap: PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls PUTINWALK AndreaPls
|
||||
[1595816119897] skitzt: so 24hr stream?
|
||||
[1595816120966] NoPantzzz: Laggggggg
|
||||
[1595816121587] zPOUTINEZ: its the wine dude
|
||||
[1595816122054] merlinnimue: spirit of rasputin
|
||||
[1595816122170] botezslavic: wine lag Kappa
|
||||
[1595816122308] midgetpanda96: ya
|
||||
[1595816123077] stepkc: Kappa hmm
|
||||
[1595816123425] maek_28: no lag nope
|
||||
[1595816123499] dogplatformr2: KappaRoss
|
||||
[1595816123729] Whole_Lotta_Lies: 5Head lag
|
||||
[1595816124273] Krappa_1_2_3: nymn1 nymn2
|
||||
[1595816124725] creatovert: MIND LAG DUE TO WINE
|
||||
[1595816124894] kaibennett06: YEP LAG
|
||||
[1595816124950] k33ling33: Omg lag
|
||||
[1595816125071] dslx: Yep lag
|
||||
[1595816126541] nefderek: drunk lag CoolStoryBob
|
||||
[1595816126586] deepbishop: keep chugging
|
||||
1
twitchchatirc/gonvo.txt
Normal file
1
twitchchatirc/gonvo.txt
Normal file
@@ -0,0 +1 @@
|
||||
<socket.socket fd=1180, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.88.240', 62994), raddr=('34.212.92.60', 6667)>
|
||||
4
twitchchatirc/requirements.txt
Normal file
4
twitchchatirc/requirements.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
argparse
|
||||
python-decouple
|
||||
emoji
|
||||
csv
|
||||
216
twitchchatirc/twitch_chat_irc.py
Normal file
216
twitchchatirc/twitch_chat_irc.py
Normal file
@@ -0,0 +1,216 @@
|
||||
import socket, re, json, argparse, emoji, csv
|
||||
# from decouple import config
|
||||
|
||||
class DefaultUser(Exception):
|
||||
"""Raised when you try send a message with the default user"""
|
||||
pass
|
||||
|
||||
class CallbackFunction(Exception):
|
||||
"""Raised when the callback function does not have (only) one required positional argument"""
|
||||
pass
|
||||
|
||||
class TwitchChatIRC():
|
||||
__HOST = 'irc.chat.twitch.tv'
|
||||
__DEFAULT_NICK = 'justinfan67420'
|
||||
__DEFAULT_PASS = 'SCHMOOPIIE'
|
||||
__PORT = 6667
|
||||
|
||||
__PATTERN = re.compile(r'@(.+?(?=\s+:)).*PRIVMSG[^:]*:([^\r\n]*)')
|
||||
|
||||
__CURRENT_CHANNEL = None
|
||||
|
||||
def __init__(self, username = None, password = None):
|
||||
|
||||
self.__NICK = self.__DEFAULT_NICK
|
||||
self.__PASS = self.__DEFAULT_PASS
|
||||
|
||||
# overwrite if specified
|
||||
if(username is not None):
|
||||
self.__NICK = username
|
||||
if(password is not None):
|
||||
self.__PASS = 'oauth:'+str(password).lstrip('oauth:')
|
||||
|
||||
# create new socket
|
||||
self.__SOCKET = socket.socket()
|
||||
|
||||
# start connection
|
||||
self.__SOCKET.connect((self.__HOST, self.__PORT))
|
||||
print('Connected to',self.__HOST,'on port',self.__PORT)
|
||||
|
||||
# log in
|
||||
self.__send_raw('CAP REQ :twitch.tv/tags')
|
||||
self.__send_raw('PASS ' + self.__PASS)
|
||||
self.__send_raw('NICK ' + self.__NICK)
|
||||
|
||||
def __send_raw(self, string):
|
||||
self.__SOCKET.send((string+'\r\n').encode('utf-8'))
|
||||
|
||||
def __print_message(self, message):
|
||||
print('['+message['tmi-sent-ts']+']',message['display-name']+':',emoji.demojize(message['message']).encode('utf-8').decode('utf-8','ignore'))
|
||||
|
||||
def __recvall(self, buffer_size):
|
||||
data = b''
|
||||
while True:
|
||||
part = self.__SOCKET.recv(buffer_size)
|
||||
data += part
|
||||
if len(part) < buffer_size:
|
||||
break
|
||||
return data.decode('utf-8')#,'ignore'
|
||||
|
||||
def __join_channel(self,channel_name):
|
||||
channel_lower = channel_name.lower()
|
||||
|
||||
if(self.__CURRENT_CHANNEL != channel_lower):
|
||||
self.__send_raw('JOIN #{}'.format(channel_lower))
|
||||
self.__CURRENT_CHANNEL = channel_lower
|
||||
|
||||
def is_default_user(self):
|
||||
return self.__NICK == self.__DEFAULT_NICK
|
||||
|
||||
def close_connection(self):
|
||||
self.__SOCKET.close()
|
||||
print('Connection closed')
|
||||
|
||||
def listen(self, channel_name, messages = [], timeout=None, message_timeout=1.0, on_message = None, buffer_size = 4096, message_limit = None, output=None):
|
||||
self.__join_channel(channel_name)
|
||||
self.__SOCKET.settimeout(message_timeout)
|
||||
|
||||
if(on_message is None):
|
||||
on_message = self.__print_message
|
||||
|
||||
print('Begin retrieving messages:')
|
||||
|
||||
time_since_last_message = 0
|
||||
readbuffer = ''
|
||||
try:
|
||||
while True:
|
||||
try:
|
||||
new_info = self.__recvall(buffer_size)
|
||||
readbuffer += new_info
|
||||
|
||||
if('PING :tmi.twitch.tv' in readbuffer):
|
||||
self.__send_raw('PONG :tmi.twitch.tv')
|
||||
|
||||
matches = list(self.__PATTERN.finditer(readbuffer))
|
||||
|
||||
if(matches):
|
||||
|
||||
time_since_last_message = 0
|
||||
|
||||
if(len(matches) > 1):
|
||||
matches = matches[:-1] # assume last one is incomplete
|
||||
|
||||
last_index = matches[-1].span()[1]
|
||||
readbuffer = readbuffer[last_index:]
|
||||
|
||||
for match in matches:
|
||||
|
||||
data = {}
|
||||
for item in match.group(1).split(';'):
|
||||
keys = item.split('=',1)
|
||||
data[keys[0]]=keys[1]
|
||||
data['message'] = match.group(2)
|
||||
print(data)
|
||||
|
||||
messages.append(data)
|
||||
|
||||
if(callable(on_message)):
|
||||
try:
|
||||
on_message(data)
|
||||
except TypeError:
|
||||
raise Exception('Incorrect number of parameters for function '+on_message.__name__)
|
||||
|
||||
if(message_limit is not None and len(messages) >= message_limit):
|
||||
return messages
|
||||
|
||||
except socket.timeout:
|
||||
if(timeout != None):
|
||||
time_since_last_message += message_timeout
|
||||
|
||||
if(time_since_last_message >= timeout):
|
||||
print('No data received in',timeout,'seconds. Timing out.')
|
||||
break
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print('Interrupted by user.')
|
||||
|
||||
except Exception as e:
|
||||
print('Unknown Error:',e)
|
||||
raise e
|
||||
|
||||
return messages
|
||||
|
||||
def send(self, channel_name, message):
|
||||
self.__join_channel(channel_name)
|
||||
|
||||
# check that is using custom login, not default
|
||||
if(self.is_default_user()):
|
||||
raise DefaultUser
|
||||
else:
|
||||
self.__send_raw('PRIVMSG #{} :{}'.format(channel_name.lower(),message))
|
||||
print('Sent "{}" to {}'.format(message,channel_name))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='Send and receive Twitch chat messages over IRC with python web sockets. For more info, go to https://dev.twitch.tv/docs/irc/guide')
|
||||
|
||||
parser.add_argument('channel_name', help='Twitch channel name (username)')
|
||||
parser.add_argument('-timeout','-t', default=None, type=float, help='time in seconds needed to close connection after not receiving any new data (default: None = no timeout)')
|
||||
parser.add_argument('-message_timeout','-mt', default=1.0, type=float, help='time in seconds between checks for new data (default: 1 second)')
|
||||
parser.add_argument('-buffer_size','-b', default=4096, type=int, help='buffer size (default: 4096 bytes = 4 KB)')
|
||||
parser.add_argument('-message_limit','-l', default=None, type=int, help='maximum amount of messages to get (default: None = unlimited)')
|
||||
|
||||
parser.add_argument('-username','-u', default=None, help='username (default: None)')
|
||||
parser.add_argument('-oauth', '-password','-p', default=None, help='oath token (default: None). Get custom one from https://twitchapps.com/tmi/')
|
||||
|
||||
parser.add_argument('--send', action='store_true', help='send mode (default: False)')
|
||||
parser.add_argument('-output','-o', default=None, help='output file (default: None = print to standard output)')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
twitch_chat_irc = TwitchChatIRC(username=args.username,password=args.oauth)
|
||||
|
||||
if(args.send):
|
||||
if(twitch_chat_irc.is_default_user()):
|
||||
print('Unable to send messages with default user. Please provide valid authentication.')
|
||||
else:
|
||||
try:
|
||||
while True:
|
||||
message = input('>>> Enter message (blank to exit): \n')
|
||||
if(not message):
|
||||
break
|
||||
twitch_chat_irc.send(args.channel_name, message)
|
||||
except KeyboardInterrupt:
|
||||
print('\nInterrupted by user.')
|
||||
|
||||
else:
|
||||
messages = twitch_chat_irc.listen(
|
||||
args.channel_name,
|
||||
timeout=args.timeout,
|
||||
message_timeout=args.message_timeout,
|
||||
buffer_size=args.buffer_size,
|
||||
message_limit=args.message_limit)
|
||||
|
||||
if(args.output != None):
|
||||
if(args.output.endswith('.json')):
|
||||
with open(args.output, 'w') as fp:
|
||||
json.dump(messages, fp)
|
||||
elif(args.output.endswith('.csv')):
|
||||
with open(args.output, 'w', newline='',encoding='utf-8') as fp:
|
||||
fieldnames = []
|
||||
for message in messages:
|
||||
fieldnames+=message.keys()
|
||||
|
||||
if(len(messages)>0):
|
||||
fc = csv.DictWriter(fp,fieldnames=list(set(fieldnames)))
|
||||
fc.writeheader()
|
||||
fc.writerows(messages)
|
||||
else:
|
||||
f = open(args.output,'w', encoding='utf-8')
|
||||
for message in messages:
|
||||
print('['+message['tmi-sent-ts']+']',message['display-name']+':',message['message'],file=f)
|
||||
f.close()
|
||||
|
||||
print('Finished writing',len(messages),'messages to',args.output)
|
||||
|
||||
twitch_chat_irc.close_connection()
|
||||
Reference in New Issue
Block a user