Suchwow.xyz task

This commit is contained in:
dsc 2021-04-05 21:03:35 +02:00
parent 35cc00c88e
commit 4e7338a4ea
8 changed files with 165 additions and 33 deletions

View file

@ -2,11 +2,13 @@
# Copyright (c) 2020, The Monero Project.
# Copyright (c) 2020, dsc@xmr.pm
import os
import asyncio
import json
from quart import websocket, jsonify
from quart import websocket, jsonify, send_from_directory
import settings
from wowlet_backend.factory import app
from wowlet_backend.wsparse import WebsocketParse
from wowlet_backend.utils import collect_websocket, feather_data
@ -18,6 +20,13 @@ async def root():
return jsonify(data)
@app.route("/suchwow/<path:name>")
async def suchwow(name: str):
"""Download a SuchWow.xyz image"""
base = os.path.join(settings.cwd, "data", "suchwow")
return await send_from_directory(base, name)
@app.websocket('/ws')
@collect_websocket
async def ws(queue):