diff --git a/README.md b/README.md index 4d1f514..26b3eb8 100644 --- a/README.md +++ b/README.md @@ -21,20 +21,20 @@ Interface web moderne pour télécharger des vidéos YouTube avec [yt-dlp](https ### Avec Docker ```bash -docker pull votreusername/ytdlp-web:latest -docker run -d -p 5000:5000 --name ytdlp-web votreusername/ytdlp-web:latest +docker pull raynoxis/yt-dlp-web-interface:latest +docker run -d -p 5000:5000 --name ytdlp-web raynoxis/yt-dlp-web-interface:latest ``` ### Avec Podman ```bash -podman pull votreusername/ytdlp-web:latest -podman run -d -p 5000:5000 --name ytdlp-web votreusername/ytdlp-web:latest +podman pull raynoxis/yt-dlp-web-interface:latest +podman run -d -p 5000:5000 --name ytdlp-web raynoxis/yt-dlp-web-interface:latest ``` ### Avec Docker Compose ```bash -git clone https://github.com/votreusername/yt-dlp-web.git -cd yt-dlp-web +git clone https://github.com/Raynoxis/yt-dlp-Web-Interface.git +cd yt-dlp-Web-Interface docker-compose up -d ``` @@ -48,17 +48,17 @@ Accédez à l'interface : **http://localhost:5000** ## 🛠️ Build depuis les sources ```bash # Cloner le repo -git clone https://github.com/votreusername/yt-dlp-web.git -cd yt-dlp-web +git clone https://github.com/Raynoxis/yt-dlp-Web-Interface.git +cd yt-dlp-Web-Interface # Build avec Docker -docker build -t ytdlp-web . +docker build -t raynoxis/yt-dlp-web-interface . # Ou avec Podman -podman build -t ytdlp-web . +podman build -t raynoxis/yt-dlp-web-interface . # Lancer -docker run -d -p 5000:5000 --name ytdlp-web ytdlp-web +docker run -d -p 5000:5000 --name ytdlp-web raynoxis/yt-dlp-web-interface ``` ## 🎯 Utilisation @@ -83,7 +83,7 @@ docker run -d \ -p 5000:5000 \ -v ./downloads:/app/downloads \ --name ytdlp-web \ - votreusername/ytdlp-web:latest + raynoxis/yt-dlp-web-interface:latest ``` ### Variables d'environnement @@ -92,7 +92,7 @@ docker run -d \ -p 5000:5000 \ -e FLASK_ENV=production \ --name ytdlp-web \ - votreusername/ytdlp-web:latest + raynoxis/yt-dlp-web-interface:latest ``` ## 🤝 Contribution @@ -119,3 +119,10 @@ Ce projet est sous licence MIT. Voir le fichier [LICENSE](LICENSE) pour plus de Cet outil est destiné à un usage personnel et éducatif. Respectez les conditions d'utilisation de YouTube et les lois sur le droit d'auteur de votre pays. +## 📧 Contact + +Raynoxis - [GitHub](https://github.com/Raynoxis) + +Lien du projet: [https://github.com/Raynoxis/yt-dlp-Web-Interface](https://github.com/Raynoxis/yt-dlp-Web-Interface) + +Lien Docker Hub: [https://hub.docker.com/r/raynoxis/yt-dlp-web-interface](https://hub.docker.com/r/raynoxis/yt-dlp-web-interface) diff --git a/app.py b/app.py index 635e283..0db886a 100644 --- a/app.py +++ b/app.py @@ -123,19 +123,28 @@ def download_video(): output_container = data.get('output_container', 'mp4') audio_codec = data.get('audio_codec', 'aac') audio_bitrate = data.get('audio_bitrate', '192k') + audio_only = data.get('audio_only', False) if not url: return jsonify({'error': 'URL manquante'}), 400 # Construction de la chaîne de format - if video_format and audio_format: - format_string = f"{video_format}+{audio_format}" - elif video_format: - format_string = f"{video_format}+ba" - elif audio_format: - format_string = f"bv+{audio_format}" + if audio_only: + # Mode audio seulement + if audio_format: + format_string = audio_format + else: + format_string = "ba/best" else: - format_string = "bv+ba/best" + # Mode vidéo + audio + if video_format and audio_format: + format_string = f"{video_format}+{audio_format}" + elif video_format: + format_string = f"{video_format}+ba" + elif audio_format: + format_string = f"bv+{audio_format}" + else: + format_string = "bv+ba/best" # Nom de fichier sécurisé avec timestamp pour éviter les conflits import time @@ -150,9 +159,13 @@ def download_video(): '-o', output_template ] + # Pour l'audio seulement, on peut aussi extraire l'audio + if audio_only and output_container in ['mp3', 'm4a']: + cmd.extend(['-x', '--audio-format', output_container.replace('m4a', 'aac')]) + # Ajout des arguments de post-processing pour l'audio postproc_added = False - if audio_codec and audio_codec != 'copy': + if audio_codec and audio_codec != 'copy' and not (audio_only and output_container in ['mp3', 'm4a']): postproc_args = f"-c:a {audio_codec}" if audio_bitrate: postproc_args += f" -b:a {audio_bitrate}" @@ -199,7 +212,8 @@ def download_video(): 'format_used': format_string, 'postproc_applied': postproc_added, 'audio_codec': audio_codec if audio_codec != 'copy' else 'original (copy)', - 'audio_bitrate': audio_bitrate if audio_codec != 'copy' else 'original' + 'audio_bitrate': audio_bitrate if audio_codec != 'copy' else 'original', + 'audio_only': audio_only }) except subprocess.TimeoutExpired: diff --git a/docker-compose.yml b/docker-compose.yml index 836a442..065e837 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,9 +3,9 @@ version: '3.8' services: ytdlp-web: build: . - container_name: ytdlp-web + container_name: ytdlp-webinterface ports: - - "5001:5000" + - "5000:5000" volumes: - ./downloads:/app/downloads restart: unless-stopped diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index 9ef8187..547f4fc 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -10,32 +10,32 @@ ### 1. Via Docker Hub ```bash -docker pull votreusername/ytdlp-web:latest -docker run -d -p 5000:5000 --name ytdlp-web votreusername/ytdlp-web:latest +docker pull raynoxis/yt-dlp-web-interface:latest +docker run -d -p 5000:5000 --name ytdlp-web raynoxis/yt-dlp-web-interface:latest ``` ### 2. Build depuis les sources ```bash -git clone https://github.com/votreusername/yt-dlp-web.git -cd yt-dlp-web -docker build -t ytdlp-web . -docker run -d -p 5000:5000 --name ytdlp-web ytdlp-web +git clone https://github.com/Raynoxis/yt-dlp-Web-Interface.git +cd yt-dlp-Web-Interface +docker build -t raynoxis/yt-dlp-web-interface . +docker run -d -p 5000:5000 --name ytdlp-web raynoxis/yt-dlp-web-interface ``` ## Installation avec Podman ### 1. Via registre ```bash -podman pull votreusername/ytdlp-web:latest -podman run -d -p 5000:5000 --name ytdlp-web votreusername/ytdlp-web:latest +podman pull raynoxis/yt-dlp-web-interface:latest +podman run -d -p 5000:5000 --name ytdlp-web raynoxis/yt-dlp-web-interface:latest ``` ### 2. Build depuis les sources ```bash -git clone https://github.com/votreusername/yt-dlp-web.git -cd yt-dlp-web -podman build -t ytdlp-web . -podman run -d -p 5000:5000 --name ytdlp-web ytdlp-web +git clone https://github.com/Raynoxis/yt-dlp-Web-Interface.git +cd yt-dlp-Web-Interface +podman build -t raynoxis/yt-dlp-web-interface . +podman run -d -p 5000:5000 --name ytdlp-web raynoxis/yt-dlp-web-interface ``` ## Configuration avancée @@ -47,7 +47,7 @@ docker run -d \ -p 5000:5000 \ -v ~/ytdlp-downloads:/app/downloads:Z \ --name ytdlp-web \ - votreusername/ytdlp-web:latest + raynoxis/yt-dlp-web-interface:latest ``` ### Avec Docker Compose @@ -70,7 +70,7 @@ docker logs ytdlp-web Changez le port : ```bash -docker run -d -p 8080:5000 --name ytdlp-web votreusername/ytdlp-web:latest +docker run -d -p 8080:5000 --name ytdlp-web raynoxis/yt-dlp-web-interface:latest ``` ### Permissions SELinux diff --git a/templates/index.html b/templates/index.html index 5dd9d29..4fe029f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -80,12 +80,24 @@ transition: border-color 0.3s; } + input[type="checkbox"] { + margin-right: 8px; + cursor: pointer; + } + input[type="text"]:focus, select:focus { outline: none; border-color: #667eea; } + input[type="text"]:disabled, + select:disabled { + opacity: 0.5; + cursor: not-allowed; + background-color: #f5f5f5; + } + .btn { padding: 12px 30px; border: none; @@ -281,8 +293,16 @@