regek / facebook-marketplace-rss

Generates a RSS feed for Facebook Marketplace
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

AttributeError: 'fbRssAdMonitor' object has no attribute 'logger' #2

Open SugarRayLua opened 16 hours ago

SugarRayLua commented 16 hours ago

Hi-- your Facebook Marketplace program looks like it will be very helpful!

However, even though I think I installed it correctly, I'm getting the following attribute error when I'm trying to set up the server:

(venv) mikes@tuxedo-os:~/facebook-marketplace-rss$ python3
Python 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
(venv) mikes@tuxedo-os:~/facebook-marketplace-rss$ python fb_ad_monitor.py
Traceback (most recent call last):
  File "/home/mikes/facebook-marketplace-rss/fb_ad_monitor.py", line 145, in load_from_json
    self.refersh_interval_minutes = data['refersh_interval_minutes']
                                    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'refersh_interval_minutes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mikes/facebook-marketplace-rss/fb_ad_monitor.py", line 393, in <module>
    monitor = fbRssAdMonitor(json_file=config_file)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mikes/facebook-marketplace-rss/fb_ad_monitor.py", line 45, in __init__
    self.load_from_json(json_file)
  File "/home/mikes/facebook-marketplace-rss/fb_ad_monitor.py", line 150, in load_from_json
    self.logger.error(f"Error loading filters from JSON: {e}")
    ^^^^^^^^^^^
AttributeError: 'fbRssAdMonitor' object has no attribute 'logger'
(venv) mikes@tuxedo-os:~/facebook-marketplace-rss$ ls
'=3.10.4'      config.sample.json   fb-rss-feed.db   lib       pyvenv.cfg         venv
 bin           Dockerfile           include          lib64     README.md
 config.json   fb_ad_monitor.py     init_db.py       LICENSE   requirements.txt

Any suggestions?

I'm on a Ubuntu Noble derivative, AMD x86_64 and t=using your example json file as the config.json file

Thanks!

regek commented 16 hours ago

seems like an issue with config.json check if this key is correct 'refersh_interval_minutes' in the config.json

SugarRayLua commented 11 hours ago

Thanks, @regek.

This is my config.json (copied from example):

{
    "server_ip": "0.0.0.0",
    "server_port": "5000", 
    "currency": "$",
    "refresh_interval_minutes": 15,
    "log_filename": "fb-rssfeed.log",
    "url_filters": {
        "https://www.facebook.com/marketplace/page1": {
            "level1": ["tv"],
            "level2": ["smart"],
            "level3": ["55\"", "55 inch"]
        },
        "https://www.facebook.com/marketplace/page2": {
            "level1": ["dishwasher"],
            "level2": ["kitchenaid", "samsung"]
        },
        "https://www.facebook.com/marketplace/page2": {}
    }
}

refresh_interval_minutes seems to present and set to value 15