Compare commits
14 Commits
037f5bebf8
...
v2.2
Author | SHA1 | Date | |
---|---|---|---|
dfa3a5e19c | |||
cdbb1be864 | |||
3ed38e7aa3 | |||
c392efce35 | |||
2761a9dacb | |||
006531aacc | |||
a8d4c05c81 | |||
280e8d0347 | |||
53c46b1d2f | |||
5b1e180c6f | |||
7872f8aa00 | |||
23b2f375fc | |||
62bc725a1c | |||
b381efd257 |
14
LICENSE
Normal file
14
LICENSE
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
Non-Profit Open Software License 3.0 (NPOSL-3.0)
|
||||||
|
|
||||||
|
Copyright (C) 2025 Djeex - Nvidia Stock Bot
|
||||||
|
|
||||||
|
The NPOSL-3.0 is a free and open-source license, but it has restrictions.
|
||||||
|
You are allowed to:
|
||||||
|
- Use, copy, and modify the software for non-commercial purposes.
|
||||||
|
- Distribute the software, provided it remains free and non-commercial.
|
||||||
|
|
||||||
|
You are not allowed to:
|
||||||
|
- Use the software for commercial purposes.
|
||||||
|
- Modify the software and redistribute it under another license.
|
||||||
|
|
||||||
|
Full text of the license can be found at: https://sourceforge.net/p/npdl/wiki/NPOSL_3_0/
|
15
README.md
15
README.md
@ -1,9 +1,13 @@
|
|||||||
# Nvidia Stock Bot - WIP
|
# Nvidia Stock Bot
|
||||||
Par KevOut & Djeex
|
Par KevOut & Djeex
|
||||||
|
|
||||||
[](https://discord.gg/gxffg3GA96)
|
*Ce projet est protégé par la license Non-Profit Open Software License 3.0 (NPOSL-3.0)*
|
||||||
|
|
||||||
|
|
||||||
|
[](https://discord.gg/gxffg3GA96) 
|
||||||
|
|
||||||
|
Bot qui permet d'être alerté des stocks de Nvidia RTX FE.
|
||||||
|
|
||||||
Ce robot :
|
Ce robot :
|
||||||
- Appelle l'API de Nvidia listant le produit (par défaut toutes les 60s)
|
- Appelle l'API de Nvidia listant le produit (par défaut toutes les 60s)
|
||||||
- Récupère le SKU du produit concerné
|
- Récupère le SKU du produit concerné
|
||||||
@ -11,6 +15,7 @@ Ce robot :
|
|||||||
- Si du stock est trouvé, envoie une notification discord via le webhook paramétré
|
- Si du stock est trouvé, envoie une notification discord via le webhook paramétré
|
||||||
- Si le produit était déjà en stock, il n'envoie plus de notification
|
- Si le produit était déjà en stock, il n'envoie plus de notification
|
||||||
- Si le produit était en stock mais ne l'est plus, envoie une notification discord signifiant la fin du stock
|
- Si le produit était en stock mais ne l'est plus, envoie une notification discord signifiant la fin du stock
|
||||||
|
- Si le SKU change, une notification est envoyée alertant de l'éventuelle imminence du drop
|
||||||
|
|
||||||
<img src="https://git.djeex.fr/Djeex/nvidia-stock-bot/raw/branch/main/assets/img/nvbot.png" align="center">
|
<img src="https://git.djeex.fr/Djeex/nvidia-stock-bot/raw/branch/main/assets/img/nvbot.png" align="center">
|
||||||
|
|
||||||
@ -69,7 +74,7 @@ Vous trouverez-ci dessous les instructions pour configurer le conteneur avec not
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
services:
|
services:
|
||||||
nvidia-stock-bot:
|
nvidia-stock-bot:
|
||||||
image: git.djeex.fr/djeex/nvidia-stock-bot:wip
|
image: git.djeex.fr/djeex/nvidia-stock-bot:latest
|
||||||
container_name: nvidia-stock-bot
|
container_name: nvidia-stock-bot
|
||||||
restart: always # Le conteneur redémarrera automatiquement en cas d'échec
|
restart: always # Le conteneur redémarrera automatiquement en cas d'échec
|
||||||
environment:
|
environment:
|
||||||
@ -107,8 +112,10 @@ Vous trouverez ci-dessous comment exécuter directement le script Python. Avec c
|
|||||||
```sh
|
```sh
|
||||||
export DISCORD_WEBHOOK_URL="https://votre_url_discord"
|
export DISCORD_WEBHOOK_URL="https://votre_url_discord"
|
||||||
export REFRESH_TIME="60"
|
export REFRESH_TIME="60"
|
||||||
export API_URL_SKU="https://api.nvidia.partners/edge/product/search?page=1&limit=100&locale=fr-fr&Manufacturer=Nvidia&gpu=RTX%205090"
|
export API_URL_SKU="https://api.nvidia.partners/edge/product/search?page=1&limit=100&locale=fr-fr&Manufacturer=Nvidia&gpu=RTX%205080"
|
||||||
export API_URL_STOCK="https://api.store.nvidia.com/partner/v1/feinventory?locale=fr-fr&skus="
|
export API_URL_STOCK="https://api.store.nvidia.com/partner/v1/feinventory?locale=fr-fr&skus="
|
||||||
|
export PRODUCT_URL= "https://marketplace.nvidia.com/fr-fr/consumer/graphics-cards/?locale=fr-fr&page=1&limit=12&gpu=RTX%205080&manufacturer=NVIDIA"
|
||||||
|
export PRODUCT_NAME="RTX 5080"
|
||||||
export TEST_MODE=false
|
export TEST_MODE=false
|
||||||
```
|
```
|
||||||
- Lancez le script
|
- Lancez le script
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 4.3 MiB After Width: | Height: | Size: 4.8 MiB |
@ -117,14 +117,8 @@ def send_discord_notification(gpu_name: str, product_link: str, products_price:
|
|||||||
"value": f"<t:{timestamp_unix}:d> <t:{timestamp_unix}:T>",
|
"value": f"<t:{timestamp_unix}:d> <t:{timestamp_unix}:T>",
|
||||||
"inline": True
|
"inline": True
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
"name": "Lien",
|
|
||||||
"value": f"{PRODUCT_URL}"
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"description": f"**:point_right: [Acheter maintenant]({product_link})**",
|
"description": f"**:point_right: [Acheter maintenant]({product_link})**",
|
||||||
"url": f"{product_link}"
|
|
||||||
"footer": {
|
"footer": {
|
||||||
"text": "Par KevOut & Djeex"
|
"text": "Par KevOut & Djeex"
|
||||||
}
|
}
|
||||||
@ -180,7 +174,7 @@ def send_out_of_stock_notification(gpu_name: str, product_link: str, products_pr
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"🚨 Erreur lors de l'envoi du webhook : {e}")
|
logging.error(f"🚨 Erreur lors de l'envoi du webhook : {e}")
|
||||||
|
|
||||||
def send_sku_change_notification(old_sku: str, new_sku: str):
|
def send_sku_change_notification(old_sku: str, new_sku: str, product_link: str):
|
||||||
|
|
||||||
# Récupérer le timestamp UNIX actuel
|
# Récupérer le timestamp UNIX actuel
|
||||||
timestamp_unix = int(time.time())
|
timestamp_unix = int(time.time())
|
||||||
@ -191,6 +185,7 @@ def send_sku_change_notification(old_sku: str, new_sku: str):
|
|||||||
|
|
||||||
embed = {
|
embed = {
|
||||||
"title": f"🔄 {PRODUCT_NAME} Changement de SKU détecté",
|
"title": f"🔄 {PRODUCT_NAME} Changement de SKU détecté",
|
||||||
|
"url": f"{product_link}",
|
||||||
"description": f"**Ancien SKU** : `{old_sku}`\n**Nouveau SKU** : `{new_sku}`",
|
"description": f"**Ancien SKU** : `{old_sku}`\n**Nouveau SKU** : `{new_sku}`",
|
||||||
"color": 16776960, # Jaune
|
"color": 16776960, # Jaune
|
||||||
|
|
||||||
@ -244,8 +239,9 @@ def check_rtx_50_founders():
|
|||||||
# Vérifier si c'est la première exécution
|
# Vérifier si c'est la première exécution
|
||||||
if last_sku is not None and product_sku != last_sku:
|
if last_sku is not None and product_sku != last_sku:
|
||||||
if not first_run: # Évite d'envoyer une notification au premier appel
|
if not first_run: # Évite d'envoyer une notification au premier appel
|
||||||
|
product_link = PRODUCT_URL
|
||||||
logging.warning(f"⚠️ SKU modifié : {last_sku} → {product_sku}")
|
logging.warning(f"⚠️ SKU modifié : {last_sku} → {product_sku}")
|
||||||
send_sku_change_notification(last_sku, product_sku)
|
send_sku_change_notification(last_sku, product_sku, product_link)
|
||||||
|
|
||||||
# Mettre à jour le SKU stocké
|
# Mettre à jour le SKU stocké
|
||||||
last_sku = product_sku
|
last_sku = product_sku
|
||||||
|
Reference in New Issue
Block a user