all repos — FixYouTube-legacy @ 2ea1ba90fb06ebe7f2a993e27e9320f149ccc4b1

A better way to embed YouTube videos everywhere (inspired by FixTweet).

more polish
Marco Andronaco andronacomarco@gmail.com
Tue, 29 Aug 2023 21:15:15 +0200
commit

2ea1ba90fb06ebe7f2a993e27e9320f149ccc4b1

parent

31f04920c1bee2052588a51fe81008cc811b236b

3 files changed, 6 insertions(+), 11 deletions(-)

jump to
M docker-compose.yamldocker-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.htmlfixyoutube/templates/index.html

@@ -1,4 +1,3 @@

- <!doctype html> <html lang="en">
M fixyoutube/views.pyfixyoutube/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)