You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When downloading the chat of a whole channel or doing similarly large tasks the application constistently consumes more memory until it crashes at about 2.1GB memory usage.
This happens after downloading about 55MB of chat or 175 vods with a very active chat.
Traceback (most recent call last):
File "c:\program files (x86)\python38-32\lib\runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files (x86)\python38-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files (x86)\Python38-32\Scripts\tcd.exe\__main__.py", line 9, in <module>
File "c:\program files (x86)\python38-32\lib\site-packages\tcd\__init__.py", line 82, in main
Downloader().channels(Arguments().channels)
File "c:\program files (x86)\python38-32\lib\site-packages\tcd\downloader.py", line 195, in channels
self.video(video)
File "c:\program files (x86)\python38-32\lib\site-packages\tcd\downloader.py", line 143, in video
for formatted_comment, comment in comment_tuple:
File "c:\program files (x86)\python38-32\lib\site-packages\tcd\formats\custom.py", line 29, in comment_generator
for comment in comments:
File "c:\program files (x86)\python38-32\lib\site-packages\twitch\v5\resources\comments.py", line 22, in __iter__
fragment = self.fragment(fragment['_next'])
File "c:\program files (x86)\python38-32\lib\site-packages\twitch\v5\resources\comments.py", line 16, in fragment
return self._api.get(self._path.format(video_id=self._video_id), params={'cursor': cursor})
File "c:\program files (x86)\python38-32\lib\site-packages\twitch\api.py", line 111, in get
return self.request('GET', path, ignore_cache, params=params, headers=self._headers(headers), **kwargs)
File "c:\program files (x86)\python38-32\lib\site-packages\twitch\api.py", line 104, in request
API.SHARED_CACHE.set(key=cache_key, value=response.json(), duration=self.cache_duration)
File "c:\program files (x86)\python38-32\lib\site-packages\requests\models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "c:\program files (x86)\python38-32\lib\site-packages\requests\models.py", line 861, in text
content = str(self.content, encoding, errors='replace')
MemoryError
The text was updated successfully, but these errors were encountered:
Randomly stumbled upon this issue while waiting for a download to finish after having some self-caused issues with the program and having to look under the hood. This is likely caused by the request cache provided by the Twitch API library, which TCD enables here.
Since I believe the cache is used to enable outputting the data in multiple formats without making the requests again for every format disabling it is not an option, but fortunately the Twitch library (which I just realized is written by the same person, neat!) already exposes a function to clear the cache which could be called after downloading the chat for each video is done.
This however has the drawback of also clearing all the cache for the information about videos, so an alternative would be to selectively manually remove the cache entries for all keys for that video's chat/"comments" after we're done with that video. I think it'd be something along the lines of helix.video.<video_id>.<whatever>?
I'll leave the implementation of this up to someone who knows Python better than I do.
(Also, thank you Petter Kraabøl for creating this. It saved me some time archiving things. Oh, an the idea to export as subtitles is actually quite genius.)
When downloading the chat of a whole channel or doing similarly large tasks the application constistently consumes more memory until it crashes at about 2.1GB memory usage.
This happens after downloading about 55MB of chat or 175 vods with a very active chat.
The text was updated successfully, but these errors were encountered: