TTMediaBot icon indicating copy to clipboard operation
TTMediaBot copied to clipboard

After Cache File is Modified, the Bot Is Prevented from Running because of It Not Properly Recognized (So It Seems)

Open ChrisDuffley opened this issue 10 months ago • 3 comments

As far as my limited Python knowledge goes it seems to me that after subsequent restarts of the bot, the cache file is not actually being loaded even though it clearly states it's the right one in the JSON file.

Here's what I get after running it with ./TTMediaBot.sh:

/home/chris/.local/lib/python3.10/site-packages/pydantic/_migration.py:283: UserWarning: `pydantic.error_wrappers:ValidationError` has been moved to `pydantic:ValidationError`.
  warnings.warn(f'`{import_path}` has been moved to `{new_location}`.')
Traceback (most recent call last):
  File "/home/chris/TTMediaBot/TTMediaBot.py", line 64, in <module>
    main()
  File "/home/chris/TTMediaBot/TTMediaBot.py", line 45, in main
    bot = Bot(config, cache, log)
  File "/home/chris/TTMediaBot/bot/__init__.py", line 60, in __init__
    self.cache_manager = cache.CacheManager(cache_file_name)
  File "/home/chris/TTMediaBot/bot/cache.py", line 42, in __init__
    self.data = cache_migrator.migrate(self, self._load())
  File "/home/chris/TTMediaBot/bot/cache.py", line 55, in _load
    return pickle.load(f)
  File "/home/chris/.local/lib/python3.10/site-packages/yt_dlp/utils/networking.py", line 70, in __setitem__
    super().__setitem__(key.title(), str(value).strip())
  File "/usr/lib/python3.10/collections/__init__.py", line 1109, in __setitem__
    self.data[key] = item
AttributeError: 'HTTPHeaderDict' object has no attribute 'data'

Running on a test instance of Ubuntu 22.04 before I upgrade my main server. Any reason why this is happening and can this be fixed?

ChrisDuffley avatar Mar 27 '24 16:03 ChrisDuffley