From e5fdbb90b48c7ff66b68d14c37ae29caf410026c Mon Sep 17 00:00:00 2001 From: akeia Date: Fri, 5 Nov 2021 14:19:34 +0100 Subject: [PATCH] Update parser.rb avoid nil's in youtube .vtt --- lib/webvtt/parser.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/webvtt/parser.rb b/lib/webvtt/parser.rb index e6666c7..68e5e61 100644 --- a/lib/webvtt/parser.rb +++ b/lib/webvtt/parser.rb @@ -158,6 +158,9 @@ def parse # it's a note, ignore return if lines[0] =~ /NOTE/ + + # youtube loves empty lines + return if lines.nil? or lines[0].nil? if !lines[0].include?("-->") @identifier = lines[0]