main
Raynoxis 10 months ago
parent 7050c6fe56
commit 8660287916

@ -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)

@ -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:

@ -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

@ -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

@ -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 @@
<div class="formats-section" id="formatsSection">
<div class="section">
<div class="section-title">📹 Sélection des formats</div>
<div class="input-group">
<label>
<input type="checkbox" id="audioOnlyMode" onchange="toggleAudioOnlyMode()">
🎵 Mode Audio Seulement
</label>
</div>
<div class="format-row">
<div class="input-group">
<div class="input-group" id="videoFormatGroup">
<label for="videoFormat">Format Vidéo</label>
<select id="videoFormat">
<option value="">Meilleure qualité auto</option>
@ -300,12 +320,14 @@
<div class="section">
<div class="section-title">⚙️ Options de sortie</div>
<div class="output-options">
<div class="input-group">
<div class="input-group" id="outputContainerGroup">
<label for="outputContainer">Conteneur</label>
<select id="outputContainer">
<option value="mp4" selected>MP4</option>
<option value="mkv">MKV</option>
<option value="webm">WebM</option>
<option value="m4a">M4A (Audio)</option>
<option value="mp3">MP3 (Audio)</option>
</select>
</div>
<div class="input-group">
@ -347,6 +369,46 @@
<script>
let currentFilename = '';
function toggleAudioOnlyMode() {
const audioOnly = document.getElementById('audioOnlyMode').checked;
const videoFormatGroup = document.getElementById('videoFormatGroup');
const videoFormat = document.getElementById('videoFormat');
const videoLabel = videoFormatGroup.querySelector('label');
const outputContainer = document.getElementById('outputContainer');
const outputContainerGroup = document.getElementById('outputContainerGroup');
const outputLabel = outputContainerGroup.querySelector('label');
if (audioOnly) {
// Griser le format vidéo
videoFormat.disabled = true;
videoFormat.style.opacity = '0.5';
videoFormat.style.cursor = 'not-allowed';
videoLabel.style.opacity = '0.5';
// Passer automatiquement à un format audio
if (!['m4a', 'mp3'].includes(outputContainer.value)) {
outputContainer.value = 'm4a';
}
// Griser aussi le conteneur (optionnel, mais on garde le choix)
outputLabel.innerHTML = 'Format de sortie (Audio)';
} else {
// Réactiver le format vidéo
videoFormat.disabled = false;
videoFormat.style.opacity = '1';
videoFormat.style.cursor = 'pointer';
videoLabel.style.opacity = '1';
// Rétablir le label normal
outputLabel.innerHTML = 'Conteneur';
// Si un format audio était sélectionné, revenir à mp4
if (['m4a', 'mp3'].includes(outputContainer.value)) {
outputContainer.value = 'mp4';
}
}
}
function toggleBitrateInput() {
const audioCodec = document.getElementById('audioCodec').value;
const audioBitrate = document.getElementById('audioBitrate');
@ -443,7 +505,8 @@
async function downloadVideo() {
const url = document.getElementById('url').value.trim();
const videoFormat = document.getElementById('videoFormat').value;
const audioOnly = document.getElementById('audioOnlyMode').checked;
const videoFormat = audioOnly ? '' : document.getElementById('videoFormat').value;
const audioFormat = document.getElementById('audioFormat').value;
const outputContainer = document.getElementById('outputContainer').value;
const audioCodec = document.getElementById('audioCodec').value;
@ -464,7 +527,8 @@
audio_format: audioFormat,
output_container: outputContainer,
audio_codec: audioCodec,
audio_bitrate: audioBitrate
audio_bitrate: audioBitrate,
audio_only: audioOnly
})
});
@ -481,6 +545,7 @@
<strong>✅ Téléchargement terminé !</strong><br>
Fichier: ${data.filename}<br>
Taille: ${sizeMB} MB<br>
${data.audio_only ? '🎵 Mode: Audio seulement<br>' : ''}
Format utilisé: ${data.format_used}<br>
Codec audio: ${data.audio_codec}<br>
Bitrate audio: ${data.audio_bitrate}<br>

Loading…
Cancel
Save