Adapt for youtube shorts

This commit is contained in:
matthias@matsewe.de
2024-06-12 15:01:58 +02:00
parent 70edc621cf
commit 5dd4b48529

View File

@@ -33,7 +33,7 @@ def get_youtube_id(url):
youtube_regex = ( youtube_regex = (
r'(https?://)?(www\.)?' r'(https?://)?(www\.)?'
'(youtube|youtu|youtube-nocookie)\.(com|be)/' '(youtube|youtu|youtube-nocookie)\.(com|be)/'
'(watch\?v=|embed/|v/|.+\?v=)?([^&=%\?]{11})') '(watch\?v=|embed/|shorts/|v/|.+\?v=)?([^&=%\?]{11})')
youtube_regex_match = re.match(youtube_regex, url) youtube_regex_match = re.match(youtube_regex, url)
if youtube_regex_match: if youtube_regex_match: