In english please

This commit is contained in:
Djeex 2025-06-03 12:41:49 +00:00
parent 27966c04e5
commit 8124ad6a2d

171
README.md
View File

@ -1,50 +1,49 @@
<h1 align="center">Nvidia Stock Bot</h1> <h1 align="center">Nvidia Stock Bot</h1>
<div align="center"> <div align="center">
<a href="https://discord.gg/gxffg3GA96"> <a href="https://discord.gg/gxffg3GA96">
<img src="https://img.shields.io/badge/JV%20hardware-rejoindre-green?style=flat-square&logo=discord&logoColor=%23fff" alt="JV Hardware"> <img src="https://img.shields.io/badge/JV%20hardware-join-green?style=flat-square&logo=discord&logoColor=%23fff" alt="JV Hardware">
<a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank"> <a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">
<img src="https://img.shields.io/badge/License-CC%20BY--NC%204.0-8E44AD?style=flat-square" alt="License: CC BY-NC 4.0"> <img src="https://img.shields.io/badge/License-CC%20BY--NC%204.0-8E44AD?style=flat-square" alt="License: CC BY-NC 4.0">
</a> </a>
</div> </div>
<div align="center" > <div align="center" >
<img src="https://git.djeex.fr/Djeex/nvidia-stock-bot/raw/branch/main/assets/img/nvidia-stock-bot-logo.png" alt="Nvidia Stock Bot" width="300"> <img src="https://git.djeex.fr/Djeex/nvidia-stock-bot/raw/branch/main/assets/img/nvidia-stock-bot-logo.png" alt="Nvidia Stock Bot" width="300">
</div> </div>
**🤖 Nvidia Stock Bot** - Un robot qui permet d'être alerté en temps réel des stocks de cartes graphiques **Nvidia RTX FE** grâce à des notifications Discord. **🤖 Nvidia Stock Bot** - A bot that alerts you in real-time about **Nvidia RTX FE** GPU stock availability through Discord notifications.
*Le code a été en partie rédigé et structuré à l'aide d'une IA générative.* *The code was partially written and structured using a generative AI.*
## 📌 Sommaire ## 📌 Table of Contents
- [✨ Fonctionnalités](#fonctionnalit%C3%A9s) - [✨ Features](#features)
- [🐳 Installation docker sans le dépot (rapide)](#installation-sans-le-d%C3%A9pot-avec-docker-compose) - [🐳 Docker Installation without cloning the repo (quick)](#docker-installation-without-the-repo-quick)
- [🐙 Installation docker avec le dépot (développeur)](#installation-avec-le-d%C3%A9pot) - [🐙 Docker Installation with the repo (developer)](#docker-installation-with-the-repo)
- [🐍 Installation avec Python (développeur)](#installation-avec-python) - [🐍 Python Installation (developer)](#python-installation)
- [🖼️ Captures d'écran](#captures-d%C3%A9cran) - [🖼️ Screenshots](#screenshots)
- [🧑‍💻 Contributeurs](#contributeurs) - [🧑‍💻 Contributors](#contributors)
## ✨ Fonctionnalités ## ✨ Features
- Notification Discord `@everyone` en cas de changement du SKU (potentiel drop imminent) - Discord `@everyone` notification on SKU change (possible imminent drop)
- Notification Discord `@everyone` en cas de stock détecté avec modèle, prix, et lien - Discord `@everyone` notification when stock is detected, including model, price, and link
- Notification Discord silencieuse en cas d'absence de stock détécté - Silent Discord notification when no stock is detected
- Choix de la fréquence de la vérification - Selectable check frequency
- Choix du modèle à surveiller - Selectable GPU model
<img src="https://git.djeex.fr/Djeex/nvidia-stock-bot/raw/branch/main/assets/img/nvbot_schematics.png" align="center"> <img src="https://git.djeex.fr/Djeex/nvidia-stock-bot/raw/branch/main/assets/img/nvbot_schematics.png" align="center">
## 🐳 Installation sans le dépot avec docker compose ## 🐳 Docker Installation without the repo (quick)
Vous trouverez-ci dessous les instructions pour configurer le conteneur avec notre image pré-compilée. Avec cette solution, votre bot tournera tout seul tant que le conteneur est actif. Below are the instructions to set up the container using our pre-built image. With this setup, your bot will run independently as long as the container is active.
**Pré-requis** **Requirements**
- [Docker](https://docs.docker.com/engine/install/) - [Docker](https://docs.docker.com/engine/install/)
**Configuration** **Configuration**
- Créez un dossier `nvidia-stock-bot` - Create a folder named `nvidia-stock-bot`
- Créez le fichier `compose.yaml` dans ce dossier avec la configuration ci-dessous : - Create a `compose.yaml` file inside that folder with the following content:
```yaml ```yaml
services: services:
@ -53,120 +52,122 @@ services:
container_name: nvidia-stock-bot container_name: nvidia-stock-bot
restart: unless-stopped restart: unless-stopped
environment: environment:
- DISCORD_WEBHOOK_URL= # URL de votre webhook Discord - DISCORD_WEBHOOK_URL= # Your Discord webhook URL
- PRODUCT_NAME= # Le nom exact du GPU que vous recherchez comme "RTX 5080" - PRODUCT_NAME= # Exact GPU name like "RTX 5080"
- PYTHONUNBUFFERED=1 # Permet d'afficher les logs en temps réel - PYTHONUNBUFFERED=1 # Enables real-time log output
command: python nvidia-stock-bot.py command: python nvidia-stock-bot.py
``` ```
**Variables d'environnements :** **Environment Variables:**
| Variables | Explications | Valeurs possibles | Valeur par défaut | | Variable | Description | Possible Values | Default Value |
|---------------------|-------------------------------------------------|--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------| |---------------------|-------------------------------------------------|------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| DISCORD_WEBHOOK_URL | URL de votre webhook Discord | Une URL | | | DISCORD_WEBHOOK_URL | Your Discord webhook URL | A valid URL | |
| REFRESH_TIME | Durée de rafraichissement du script en secondes | `60`, `30`, etc... | `30` | | REFRESH_TIME | Script refresh interval in seconds | `60`, `30`, etc. | `30` |
| API_URL_SKU | API listant le produit | Une URL | `https://api.nvidia.partners/edge/product/search?page=1&limit=100&locale=fr-fr&Manufacturer=Nvidia` | | API_URL_SKU | API listing the product | A URL | `https://api.nvidia.partners/edge/product/search?page=1&limit=100&locale=fr-fr&Manufacturer=Nvidia` |
| API_URL_STOCK | API donnant le stock | Une URL | `https://api.store.nvidia.com/partner/v1/feinventory?locale=fr-fr&skus=` | | API_URL_STOCK | API providing stock data | A URL | `https://api.store.nvidia.com/partner/v1/feinventory?locale=fr-fr&skus=` |
| PRODUCT_URL | URL d'achat du GPU | Une URL | `https://marketplace.nvidia.com/fr-fr/consumer/graphics-cards/?locale=fr-fr&page=1&limit=12&manufacturer=NVIDIA` | | PRODUCT_URL | GPU purchase URL | A URL | `https://marketplace.nvidia.com/fr-fr/consumer/graphics-cards/?locale=fr-fr&page=1&limit=12&manufacturer=NVIDIA` |
| PRODUCT_NAME | Le nom exact du GPU que vous recherchez | `RTX 5090`, `RTX 5080` ou `RTX 5070`. | | | PRODUCT_NAME | The exact GPU name you're searching for | `RTX 5090`, `RTX 5080`, `RTX 5070` | |
| TEST_MODE | Pour tester sans envoyer de notifs | `True`, `False` | `False` | | TEST_MODE | For testing without sending notifications | `True`, `False` | `False` |
| PYTHONUNBUFFERED | #Permet d'afficher les logs en temps réel | `1`, `0` | `1` | | PYTHONUNBUFFERED | Enables real-time log output | `1`, `0` | `1` |
**Lancer l'image** **Run the image**
Rendez-vous dans le dossier `nvidia-stock-bot` et lancez le conteneur : Navigate to the `nvidia-stock-bot` folder and launch the container:
```sh ```sh
docker compose up -d docker compose up -d
``` ```
**Voir les logs pour vérifier le bon fonctionnement** **Check logs to verify operation**
```sh ```sh
docker logs -f nvidia-stock-bot docker logs -f nvidia-stock-bot
``` ```
## 📦 Installation avec le dépot ## 📦 Docker Installation with the repo
Vous trouverez-ci dessous les instructions pour installer le dépot, compiler l'image docker, et lancer le conteneur. Avec cette solution, votre bot tournera tout seul tant que le conteneur est actif. Instructions below show how to install the repo, build the Docker image, and launch the container. Your bot will run independently as long as the container is active.
**Pré-requis** **Requirements**
- [Git](https://git-scm.com/docs) - [Git](https://git-scm.com/docs)
- [Docker](https://docs.docker.com/engine/install/) - [Docker](https://docs.docker.com/engine/install/)
**Cloner et paramétrer** **Clone and configure**
- Clonez le repo : - Clone the repo:
```sh ```sh
git clone https://git.djeex.fr/Djeex/nvidia-stock-bot.git git clone https://git.djeex.fr/Djeex/nvidia-stock-bot.git
``` ```
- Rendez vous dans le dossier `nvidia-stock-bot` et compilez l'image docker : - Navigate to `nvidia-stock-bot` and build the Docker image:
```sh ```sh
docker build -t nvidia-stock-bot . docker build -t nvidia-stock-bot .
``` ```
- Puis rendez-vous dans le dossier `nvidia-stock-bot/docker` et éditez le fichier `.env` avec : - Then go to `nvidia-stock-bot/docker` and edit the `.env` file with:
- l'url de votre webhook discord - Your Discord webhook URL
- les différents liens API et produits - The API and product URLs
- la fréquence de consultation des stock (par défaut 60s, attention à ne pas trop descendre sous peine de blocage de votre adresse IP par nVidia) - Stock checking frequency (default: 60s; lowering too much may get your IP blocked by Nvidia)
**Lancer l'image** **Run the image**
Rendez-vous dans le dossier `nvidia-stock-bot/docker` et lancez le conteneur : Navigate to `nvidia-stock-bot/docker` and launch the container:
```sh ```sh
docker compose up -d docker compose up -d
``` ```
**Voir les logs pour vérifier le bon fonctionnement** **Check logs to verify operation**
```sh ```sh
docker logs -f nvidia-stock-bot docker logs -f nvidia-stock-bot
``` ```
## 🐍 Installation avec Python ## 🐍 Python Installation
Vous trouverez ci-dessous comment exécuter directement le script Python. Avec cette solution, le bot s'arretera si vous fermez votre terminal. Instructions to directly run the Python script. Note: the bot stops when you close the terminal.
**Pré-requis** **Requirements**
- Python 3.11 ou plus - Python 3.11 or newer
- requests : `pip install requests` - requests: `pip install requests`
**Configuration** **Configuration**
- Créez un environnement virtuel (exemple : `python3 -m venv nom_de_l_environnement` ) - Create a virtual environment (e.g., `python3 -m venv env_name`)
- Créez un dossier et aller dedans - Create and navigate into a folder
- Téléchargez le script python : - Download the Python script:
```sh
curl -o nvidia-stock-bot.py -# https://git.djeex.fr/Djeex/nvidia-stock-bot/raw/branch/main/nvidia-stock-bot.py
```
- Exportez les variables d'environnement avec votre webhook discord et le temps de rafraichissement en secondes, par exemple :
```sh
export DISCORD_WEBHOOK_URL="https://votre_url_discord"
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%205080"
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
```
- Lancez le script
```sh
python nvidia-stock-bot.py
```
## 🖼️ Captures d'écran ```sh
curl -o nvidia-stock-bot.py -# https://git.djeex.fr/Djeex/nvidia-stock-bot/raw/branch/main/nvidia-stock-bot.py
```
<div align="center" > - Export the environment variables with your webhook and refresh time:
<img src="https://git.djeex.fr/Djeex/nvidia-stock-bot/raw/branch/main/assets/img/nvidia-stock-bot-discord.png" alt="Nvidia Stock Bot - captures">
```sh
export DISCORD_WEBHOOK_URL="https://your_discord_url"
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%205080"
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
```
- Run the script
```sh
python nvidia-stock-bot.py
```
## 🖼️ Screenshots
<div align="center" >
<img src="https://git.djeex.fr/Djeex/nvidia-stock-bot/raw/branch/main/assets/img/nvidia-stock-bot-discord.png" alt="Nvidia Stock Bot - screenshots">
</div> </div>
## 🧑‍💻 Contributeurs ## 🧑‍💻 Contributors
On remercie pour leurs contributions : Thanks for their contributions:
- Djeex - Djeex
- KevOut - KevOut