clean and add yt dl video

This commit is contained in:
Grizouille
2025-11-10 10:56:29 +01:00
parent 45b442efcd
commit 4b4eb94ff7
6 changed files with 51 additions and 22 deletions

View File

@@ -2,12 +2,9 @@
import os
from subprocess import Popen, PIPE
from functools import wraps
import requests
import atexit
from flask import Flask, render_template, request, jsonify, session
from markupsafe import escape
import warnings
import giphypop
from deezer_downloader.configuration import config
from deezer_downloader.web.music_backend import sched
@@ -17,9 +14,6 @@ from deezer_downloader.nextcloud import addJwtInUserSession
app = Flask(__name__)
app.secret_key = "vilvhmqerjgùqrgojpùqjgvnùzevoijrpùvqpzejgijzepgùg"
warnings.filterwarnings("ignore", message="You are using the giphy public api key")
giphy = giphypop.Giphy()
def init():
sched.run_workers(config.getint('threadpool', 'workers'))
@@ -180,7 +174,7 @@ def deezer_download_song_or_album():
@app.route('/youtubedl', methods=['POST'])
@validate_schema("url", "add_to_playlist")
@validate_schema("url", "add_to_playlist", "getVideo")
def youtubedl_download():
"""
takes an url and tries to download it via youtuble-dl
@@ -193,7 +187,8 @@ def youtubedl_download():
task = sched.enqueue_task(desc, "download_youtubedl_and_queue",
video_url=user_input['url'],
add_to_playlist=user_input['add_to_playlist'],
uid_user=session['user_uid'])
uid_user=session['user_uid'],
video=user_input['getVideo'])
return jsonify({"task_id": id(task), })