Plusieurs modifications au niveau des pages et du bouton pour raffraichir

This commit is contained in:
Gu1llaum-3 2023-01-03 23:33:04 +01:00
parent c9cdacd349
commit 637d4e585c
5 changed files with 27 additions and 5 deletions

5
app.py
View File

@ -54,10 +54,15 @@ def download_file():
return render_template('erreur.html')
urls = [url1, url2, url3, url4, url5]
process_file(urls)
PATH = "downloads/musics.zip"
return send_file(PATH, as_attachment=True)
@app.errorhandler(404)
def page_not_found(error):
return render_template('404.html'), 404
if __name__ == '__main__':
app.run(debug=True, port=3000)

View File

@ -74,7 +74,7 @@ body {
color: whitesmoke
}
.title {
h1 {
color: rgb(24,216,96);
}

15
templates/404.html Normal file
View File

@ -0,0 +1,15 @@
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/css/style.css", filename= 'style.css'>
<title>SpotDL Web</title>
</head>
<body>
<div class="container">
<h1>Error 404</h1>
<h2>Il semble que vous soyez perdu. Revenez à la page d'accueil</h2>
<button class="btn" onclick="window.location.href = '/';">Accueil</button>
</div>
</body>

View File

@ -5,10 +5,10 @@
</head>
<body>
<div class="erreur">
<div class="container">
<h1 class="title"> SpotDL Web </h1>
<h2> Veuillez entrer au moins une URL ! </h2>
<button class="btn" onclick="window.location.href = '/';">Télécharger à nouveau</button>
<button class="btn" onclick="window.location.href = '/';">Accueil</button>
{% if message %}
<p>{{ message }}</p>

View File

@ -27,10 +27,12 @@
<input type="text" class="form-control" name="url5" id="url5" pattern="^https://open\.spotify\.com/(?:album|playlist)/[\w-]+(?:\?si=[\w-]+)?$" placeholder="Entrez l'URL d'un Album ou d'une Playlist">
</div>
<button type="submit" class="btn" id="download-button" onclick="startDownload()">Télécharger</button>
<button type="reset" class="btn" id="refresh-button" onclick="refreshPage()">Rafraîchir</button>
</form>
<button class="btn2" id="refresh-button" onclick="refreshPage()">Rafraîchir</button>
<button type="reset" class="btn" id="refresh-button" onclick="refreshPage()">Rafraîchir</button>
<!-- <button class="btn2" id="refresh-button" onclick="refreshPage()">Rafraîchir</button> -->
<!-- <button type="reset" class="btn" id="refresh-button" onclick="refreshPage()">Rafraîchir</button> -->
</div>
<script>
function startDownload() {
document.getElementById('download-button').innerHTML = 'Téléchargement en cours...';