diff --git a/websitemodule.py b/websitemodule.py index 2ed9448..b36affc 100644 --- a/websitemodule.py +++ b/websitemodule.py @@ -1,8 +1,12 @@ import os import sqlite3 import datetime -# For now import flask +import re + +def is_youtube_id(video_id): + """Check if the video_id is a valid YouTube ID""" + return re.match(r'^[a-zA-Z0-9_-]{11}$', str(video_id)) is not None def read_music_database(): conn = sqlite3.connect("assets/localwrapped/music.db") @@ -61,7 +65,6 @@ def generatehtmlcode(year: int = datetime.datetime.now().year): -