14 Commits

Author SHA1 Message Date
dfa3a5e19c In english 2025-03-26 15:38:46 +00:00
cdbb1be864 Minor change 2025-03-26 12:01:31 +00:00
3ed38e7aa3 badge license 2025-03-26 12:01:12 +00:00
c392efce35 Ajout license 2025-03-26 11:55:09 +00:00
2761a9dacb License 2025-03-26 11:53:23 +00:00
006531aacc Maj intro 2025-03-14 15:12:40 +00:00
a8d4c05c81 Fix python section 2025-03-14 15:08:30 +00:00
280e8d0347 Maj schema 2025-03-14 15:05:06 +00:00
53c46b1d2f WIP to MAIN 2025-03-14 12:02:54 +00:00
5b1e180c6f Minor changes 2025-03-14 11:51:48 +00:00
7872f8aa00 Fixed sku notif 2025-03-14 11:33:50 +00:00
23b2f375fc Minor fixes 2025-03-14 11:21:56 +00:00
62bc725a1c Fixed coma 2025-03-14 11:04:57 +00:00
b381efd257 Readme 2025-03-14 10:55:41 +00:00
4 changed files with 30 additions and 13 deletions

14
LICENSE Normal file
View 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/

View File

@ -1,9 +1,13 @@
# Nvidia Stock Bot - WIP # Nvidia Stock Bot
Par KevOut & Djeex Par KevOut & Djeex
[![](https://img.shields.io/badge/JV%20hardware-rejoindre-green?style=flat-square&logo=discord&logoColor=%23fff&label=JV%20hardware&link=https%3A%2F%2Fdiscord.gg%2Fgxffg3GA96)](https://discord.gg/gxffg3GA96) *Ce projet est protégé par la license Non-Profit Open Software License 3.0 (NPOSL-3.0)*
[![](https://img.shields.io/badge/JV%20hardware-rejoindre-green?style=flat-square&logo=discord&logoColor=%23fff&label=JV%20hardware&link=https%3A%2F%2Fdiscord.gg%2Fgxffg3GA96)](https://discord.gg/gxffg3GA96) ![Licence: NPOSL-3.0](https://img.shields.io/badge/license-NPOSL--3.0-blue?style=flat-square&)
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

View File

@ -108,7 +108,7 @@ def send_discord_notification(gpu_name: str, product_link: str, products_price:
"fields": [ "fields": [
{ {
"name": "Prix", "name": "Prix",
"value": f"`{products_price} €`", "value": f"`{products_price}€`",
"inline": True "inline": True
}, },
@ -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