SpikeHD / AmazonMonitor

Amazon price checker, item monitor and stock monitor, all shoved into a Discord bot
GNU General Public License v3.0
221 stars 38 forks source link

[BUG] Detects empty values #77

Closed m4king closed 2 years ago

m4king commented 2 years ago

Describe the issue:

Hello SpikeHD.

This is a wonderful work.

If i add this or other items in my watchlist, the Amazonmonitor detects 2 or 3 empty values.

Can you please help me change this and make it work again?

!watch -l https://www.amazon.de/dp/B08WX922JY

my config.json,

This is my Config:
{
  "prefix":"!",
  "token":"mytoken",
  "minutes_per_check":2,
  "search_response_ms": 30000,
  "url_params":{
    "ref":"myref",
    "tag":"blabla-21"
  },
  "guild_item_limit":20,
  "cache_limit": 10,
  "required_perms":["ADMINISTRATOR", "ADMINISTRATOR"],
  "tld":"de",
  "auto_cart_link":true,
  "debug_enabled":true
}

This the Watchlist:

["guild_id":"643136305823219792","channel_id":"883333147268358204","link":"https://www.amazon.de/dp/B08WX922JY/?ref=myref&tag=blabal-21&","lastPrice":0,"item_name":"LEGO 41684 Friends Heartlake City Hotel, Puppenhaus, Resort, Konstruktionsspielzeug, Kinder","priceLimit":0,"type":"link"}]

console output with debug mode enabled:

[MESSAGE]  Type: headless
[MESSAGE]  Waiting a couple seconds for JavaScript to load...
[DEBUG]  Got page in 5890ms
[MESSAGE]  Type: spielzeug
                bau- & konstruktionsspielzeug
                 bauspielzeugsets
[DEBUG]  Detected as a regular item
[DEBUG]  Full object: 
[DEBUG]  {
  full_title: 'LEGO 41684 Friends Heartlake City Hotel, Puppenhaus, Resort, Konstruktionsspielzeug, Kinder',
  full_link: 'https://www.amazon.de/dp/B08WX922JY/?ref=myref&tag=blabla-21&?ref=myref&tag=blabla-21&',
  asin: 'B08WX922JY',
  seller: 'Besuchen Sie den LEGO-Store',
  price: '',
  symbol: '',
  shipping: 'Free with prime',
  rating: '4,8 von 5 Sternen',
  features: [
    ' - Das LEGO Friends Heartlake City Hotel Set verfügt über drei Etagen und fünf Zimmer im Pariser Puppenhaus-Stil und wird mit saisonalem Zubehör komplettiert',
    ' - Das Puppenhaus verfügt über eine Pianobar und eine Rezeption, Zimmer mit Bad und einen Essbereich im Freien, sowie über gehobene Ausstattung wie ein Spa und ein Penthouse',
    ' - Im Winter gibt es Kerzenlicht und Schneebälle, der Sommer bringt Blumen und Eiscreme und für den Herbst gibt es goldene Blätter und Kürbisse',
    ' - Das Heartlake City Resort enthält 4 LEGO Friends Mini-Puppen, darunter eine Schauspielerin und eine Empfangsdame, sowie 3 Tierfiguren und einen Essbereich im Freien',
    ' - Das perfekte Geschenk zu Weihnachten für Jungen und Mädchen ab 8 Jahren - auch mit weniger Erfahrung mit Bausteinen macht das Spielzeug unglaublich viel Spaß',
    ' - Kreative Kinder werden stundenlang Spaß mit dem Konstruktionsspielzeug haben und werden es lieben, das Heartlake Hotel je nach Jahreszeit mit Accessoires zu dekorieren'
  ],
  availability: 'Auf Lager.',
  image: 'https://m.media-amazon.com/images/I/71ieXLlmTYS._AC_SL1000_.jpg'
}
[WARNING]  Detected 2 empty values. Could potentially mean bot was flagged
SpikeHD commented 2 years ago

Detecting 2 or 3 empty values honestly isn't a huge deal, in your case it was just the price and price symbol (which comes from the price, so that was kinda connected). The bot is still working fine, but if it detects more along the lines of 6-7+, then there is a problem, and you should reduce you minutes_per_check or watchlist size.

Oh and I guess to explain why they're blank, there is no main price on that item because it is out of stock (disregarding the new and used ones from other sellers). The price being blank is actually recognized internally as the item being out of stock, and when the price comes back (AKA the item is back in stock), you will be sent a stock alert.

m4king commented 2 years ago

Oh thank you for your answer. Your are great man :)