more polish
Marco Andronaco andronacomarco@gmail.com
Tue, 29 Aug 2023 21:15:15 +0200
3 files changed,
6 insertions(+),
11 deletions(-)
M
docker-compose.yaml
→
docker-compose.yaml
@@ -4,9 +4,6 @@ build: .
image: ghcr.io/birabittoh/fixyoutube:main container_name: fixyoutube restart: unless-stopped - ports: - - 127.0.0.1:1111:80 - swag: image: ghcr.io/linuxserver/swag container_name: swag@@ -15,7 +12,7 @@ - NET_ADMIN
env_file: - docker/swag.env volumes: - - /etc/config/swag:/config + #- /etc/config/swag:/config - ./docker/fixyoutube.subdomain.conf:/config/nginx/proxy-confs/fixyoutube.subdomain.conf:ro ports: - 443:443
M
fixyoutube/templates/index.html
→
fixyoutube/templates/index.html
@@ -1,4 +1,3 @@
- <!doctype html> <html lang="en">
M
fixyoutube/views.py
→
fixyoutube/views.py
@@ -41,11 +41,10 @@ @app.route('/proxy/<path:path>')
def proxy(path): result = get_video_from_cache(path) - if result is None: + try: + if result.url == "": + raise AttributeError + except AttributeError: return abort(400) - url = result.url - if url == "": - return abort(400) - - return Response(get(url).content, headers=c.PROXY_HEADERS) + return Response(get(result.url).content, headers=c.PROXY_HEADERS)