bernardopires / twitch-chat-logger

A simple app for logging twitch's chat to a PostgreSQL database.
MIT License
60 stars 14 forks source link

No stream_log when channel list is specified. #10

Open apleith opened 7 years ago

apleith commented 7 years ago

I assume this is a byproduct of the code - stream data pulled with top streamer list - but I just wanted to make sure I'm not doing something incorrectly.

I am attempting to use a version of your code to pull chat logs for a larger subsection of Twitch.

For now, I'm just running a large list of specified channels to log their correlated chats but my research requires me to identify chat differences based on stream differences (e.g., game selection and viewer count). In the near future, I am hoping to adapt your bots to pull the top 1000+ English speaking channels. Based on my minimal knowledge, this would require running multiple list pulls using offset (though I'm unsure how the pagination is currently defined, I'm guessing I'll just trial-and-error).

Any suggestions or fixes for the stream_log problem would be greatly appreciated, as well as advice on language selection, offsetting, or bypassing the cap of 100 channels.

bernardopires commented 7 years ago

There's no cap of 100 channels. You can just pass -n 1000 or whatever number you want. Did that not work?

apleith commented 6 years ago

This is nearly 1.5 years later, but I had to switch projects to one that did not require such a large set of channels. But, I'm toying with this again now and am still having issues when I tool it up to 1000. Here is the output that occurs when I try to run it through the terminal.

apleith@APi:~/tcl$ python main.py -n 1000 Traceback (most recent call last): File "main.py", line 24, in main() File "main.py", line 18, in main manager.run_log_loop() File "/home/apleith/tcl/manager.py", line 112, in run_log_loop self._run_popular_streams_loop() File "/home/apleith/tcl/manager.py", line 78, in _run_popular_streams_loop streams = get_top_streams(self.channels_amount) File "/home/apleith/tcl/utils.py", line 13, in get_top_streams return json.loads(requests.get(twitch_api_url, headers=headers).text)['streams'] KeyError: 'streams'

If you readily know why this could be happening, that is great. Do not stress about it too much. If you can't, I know this isn't a priority of yours.

EDIT: It actually isn't working with anything over 100 (just tried it with 101).

seonghobae commented 5 years ago

Yes, this is not resolved. If I specified channel names, that is not working.