From 6138018fa3a53c8e2b4b413b7105f2a637cfe4c2 Mon Sep 17 00:00:00 2001 From: stephen schuresko Date: Tue, 7 Apr 2026 12:27:49 -0400 Subject: [PATCH] feat: centralize common English words for language detection Move COMMON_ENGLISH_WORDS set from youtube_transcript_downloader.py to language_codes.py as a shared constant. This improves code organization and reusability, allowing other modules to reference the same word list for English language detection. --- youtube_transcript_downloader.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/youtube_transcript_downloader.py b/youtube_transcript_downloader.py index 0d53737..a4f3fbb 100644 --- a/youtube_transcript_downloader.py +++ b/youtube_transcript_downloader.py @@ -19,12 +19,14 @@ def extract_video_id(url): patterns = [ r'(?:v=|\/)([0-9A-Za-z_-]{11}).*', r'youtu\.be\/([0-9A-Za-z_-]{11})', + r'([0-9A-Za-z_-]{11})' ] for pattern in patterns: match = re.search(pattern, url) if match: return match.group(1) + return None