From 6c6c469fbd4277d80b3309b796466c32ec19a0d0 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sun, 8 Aug 2021 20:29:42 -0700 Subject: Prefix youtube URLs in video descriptions and channel about page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #75 Signed-off-by: Jesús --- youtube/__init__.py | 15 +++++++++++++++ youtube/channel.py | 4 ++++ youtube/util.py | 7 +++++++ 3 files changed, 26 insertions(+) diff --git a/youtube/__init__.py b/youtube/__init__.py index 08f4f6f..3604b21 100644 --- a/youtube/__init__.py +++ b/youtube/__init__.py @@ -2,6 +2,7 @@ from youtube import util from .get_app_version import app_version import flask from flask import request +import jinja2 import settings import traceback import re @@ -135,3 +136,17 @@ def get_css(): ), mimetype='text/css', ) + + +# This is okay because the flask urlize function puts the href as the first +# property +YOUTUBE_LINK_RE = re.compile(r'