From 98adc6cfac9199d59fa1b9802f4dd272e0cd8bfa Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Thu, 15 Sep 2022 05:18:42 +0000 Subject: [PATCH] Exclude backslashes in channel patterns --- youtube-extract | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube-extract b/youtube-extract index 7e20075..899dd8c 100755 --- a/youtube-extract +++ b/youtube-extract @@ -53,10 +53,10 @@ noisePattern = '|'.join([ ]) channelPattern = '|'.join([ - r'''/www\.youtube\.com/c/[^/?&=."'>\s]+''', + r'''/www\.youtube\.com/c/[^/?&=."'>\\\s]+''', r'/www\.youtube\.com/user/[A-Za-z0-9]{1,20}', r'/www\.youtube\.com/channel/UC[0-9A-Za-z_-]{22}', - r'''/www\.youtube\.com/[^/?&=."'>\s]+(?=/?(\s|["'>]|$))''', + r'''/www\.youtube\.com/[^/?&=."'>\\\s]+(?=/?(\s|\\?["'>]|$))''', ]) # Make sure that the last 11 chars of the match are always the video ID (because Python's re doesn't support \K).