samuelm2/Nvidia-Notify

Nvidia API endpoint

Closed this issue · 11 comments

Zyrth commented

Did the nvidia api uri change? I'm only getting 504 errors from it in postman

"https://api-prod.nvidia.com/direct-sales-shop/DR/products/en_us/USD/5438481700"

It appears their API is down. I tested via VPN, so I don't think it's any form of blocking/etc. Guess we'll have to wait.

In the meantime, you can take those entries out of the script as they'll cause delays.

Also, we should probably increase the default timeout, with more people using scripts like this, we don't want to inadvertently start DDOSing.

Zyrth commented

Adding a simple timeout to the nvidia_get function helps a bit

def nvidia_get(url, api_url):
    response = requests.get(api_url, timeout=1)
    item = response.json()

    #print(item['products']['product'][0]['inventoryStatus']['status'])
    if item['products']['product'][0]['inventoryStatus']['status'] != "PRODUCT_INVENTORY_OUT_OF_STOCK":
        alert(url)

maybe not a '1' but a 3 or 5 but yeah, that's a good way to handle it.

I was just going to post here about this, you guys beat me to it. I'll try the longer timeout. Thank you.

Isn't there an implicit timeout because the other searches run afterwards? I guess if you're looking for a 3080 or 3090 then back to back might be an issue but you could space them out or only search for one.

It's a micro-optimization more than anything. Said implicit timeout takes longer than a full round of store checks so it ends up being less responsive. Sure you only lose a few seconds, but when it's an easy fix ¯\_(ツ)_/¯

would it be wise to revert back to the non-api check method if it's going to be this unreliable?

@dereckhall When I get a chance, I'm gonna spend some time to see if I can find a better way to do it that won't cause false positives, because the previous way caused a lot of false positives. In the meantime, if you want to submit a PR that reverts to the old way, I'll merge it (I'd do it myself, but not at my PC right now). Or if you happen to come up with a better way, feel free to submit a PR

the webpage itself calls that api endpoint (you can use F12 and verify it yourself on the network tab). Meaning, whether it gets changed back or not, right now it wont be showing any useful data till that endpoint gets fixed on nvidia's end.

firefox_qjYT688f2h

Just going to leave this here: https://github.com/jef/nvidia-snatcher

@ItsCalebJones yeah I saw that too. The subreddit seems to be removing references to that tool. I actually use both myself.

As for the topic of this issue, the API is back up and appears to be working as intended, so closing this for now.