PetterKraabol / Twitch-Python

Object-oriented Twitch API for Python developers
https://pypi.org/project/twitch-python
MIT License
214 stars 37 forks source link

Fix Issue #26 #27

Closed Oshawk closed 3 years ago

Oshawk commented 3 years ago

Used the same style as in line 41 to avoid passing None to the Commenter and Message constructors. This fixes issue #26. I think it also fixes https://github.com/PetterKraabol/Twitch-Chat-Downloader/issues/112.

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

vanyamlb commented 3 years ago

@Oshawk could you please explain what change I should do in what file to skip #112 problem in tcd? Thanks!

Oshawk commented 3 years ago

@Oshawk could you please explain what change I should do in what file to skip #112 problem in tcd? Thanks!

@vanyamlb Running pip install --upgrade --force-reinstall git+https://github.com/PetterKraabol/Twitch-Python.git should do it.

vanyamlb commented 3 years ago

@Oshawk I ran this command and also the same but with Twitch-Chat-Downloader.git and still getting data get name error... Maybe because the changes were made only here, but not in tcd repo?

I entered the command again... now I get this

self._map_user_colors(data) File "c:\users\vanya\appdata\local\programs\python\python39\lib\site-packages\tcd\pipe.py", line 187, in _map_user_colors sha256.update(str.encode(data['commenter']['_id'])) TypeError: 'NoneType' object is not subscriptable

did I do something wrong or the error occurs? It happens when I try to download many chats with Twitch Chat Downloader...

Oshawk commented 3 years ago

@Oshawk I ran this command and also the same but with Twitch-Chat-Downloader.git and still getting data get name error... Maybe because the changes were made only here, but not in tcd repo?

I entered the command again... now I get this

self._map_user_colors(data) File "c:\users\vanya\appdata\local\programs\python\python39\lib\site-packages\tcd\pipe.py", line 187, in _map_user_colors sha256.update(str.encode(data['commenter']['_id'])) TypeError: 'NoneType' object is not subscriptable

did I do something wrong or the error occurs? It happens when I try to download many chats with Twitch Chat Downloader...

@vanyamlb It looks like that is a different issue. Can you tell me what command you are running?

vanyamlb commented 3 years ago

@Oshawk I ran this command and also the same but with Twitch-Chat-Downloader.git and still getting data get name error... Maybe because the changes were made only here, but not in tcd repo? I entered the command again... now I get this self._map_user_colors(data) File "c:\users\vanya\appdata\local\programs\python\python39\lib\site-packages\tcd\pipe.py", line 187, in _map_user_colors sha256.update(str.encode(data['commenter']['_id'])) TypeError: 'NoneType' object is not subscriptable did I do something wrong or the error occurs? It happens when I try to download many chats with Twitch Chat Downloader...

@vanyamlb It looks like that is a different issue. Can you tell me what command you are running?

for example, this

tcd -c mrmashadi --first=500

after some amount of VODs downloaded, I get this:

[PS5] WL Road to Top200 - Road to 2k Follower - !instagram !youtube !watchtime !team [default] ./874918085.txt [PS5] Pack Opening - Road to 2k Follower - !instagram !youtube !watchtime !team Traceback (most recent call last): File "c:\users\vanya\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\vanya\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\vanya\AppData\Local\Programs\Python\Python39\Scripts\tcd.exe__main.py", line 7, in File "c:\users\vanya\appdata\local\programs\python\python39\lib\site-packages\tcd\init__.py", line 92, in main Downloader().channels(Arguments().channels) File "c:\users\vanya\appdata\local\programs\python\python39\lib\site-packages\tcd\downloader.py", line 195, in channels self.video(video) File "c:\users\vanya\appdata\local\programs\python\python39\lib\site-packages\tcd\downloader.py", line 143, in video for formatted_comment, comment in comment_tuple: File "c:\users\vanya\appdata\local\programs\python\python39\lib\site-packages\tcd\formats\custom.py", line 30, in comment_generator yield Pipe(self.format_dictionary['comments']).comment(comment.data), comment File "c:\users\vanya\appdata\local\programs\python\python39\lib\site-packages\tcd\pipe.py", line 51, in comment return self.format(comment_data) File "c:\users\vanya\appdata\local\programs\python\python39\lib\site-packages\tcd\pipe.py", line 41, in format self.mapper(data) File "c:\users\vanya\appdata\local\programs\python\python39\lib\site-packages\tcd\pipe.py", line 136, in mapper self._map_user_colors(data) File "c:\users\vanya\appdata\local\programs\python\python39\lib\site-packages\tcd\pipe.py", line 186, in _map_user_colors sha256.update(str.encode(data['commenter']['_id'])) TypeError: 'NoneType' object is not subscriptable

Oshawk commented 3 years ago

@vanyamlb You should probably add this as an issue on https://github.com/PetterKraabol/Twitch-Chat-Downloader.

vanyamlb commented 3 years ago

@Oshawk did that. Thank you for your help.