You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
435 B
19 lines
435 B
from flask import Blueprint, request, jsonify
|
|
from scraper.download_controller import DownloadController
|
|
|
|
bp_download = Blueprint("download", __name__)
|
|
|
|
|
|
@bp_download.post("/api/download")
|
|
def api_download():
|
|
data = request.get_json() or {}
|
|
url = data.get("url")
|
|
|
|
if not url:
|
|
return jsonify({"error": "Missing URL"}), 400
|
|
|
|
ctl = DownloadController(url)
|
|
result = ctl.start()
|
|
|
|
return jsonify(result), 200
|