def METHOD_NAME(self, mode, source, line):
    match = re.search(r"(https?://((m|music)\.)?|www\.)youtu(\.be/|be\.com/(shorts/|watch\S+v=))"
                      r"(?P<video_id>[-\w]{11})", line)
    if not match:
        return None
    video_id = match.group("video_id")
    if source in self.last_video_id[mode] and self.last_video_id[mode][source] == video_id:
        return None
    self.last_video_id[mode][source] = video_id
    return video_id