diff --git a/test/test_youtube_chapters.py b/test/test_youtube_chapters.py
index 324ca8525..63a9a88c1 100644
--- a/test/test_youtube_chapters.py
+++ b/test/test_youtube_chapters.py
@@ -15,6 +15,41 @@ from youtube_dl.extractor import YoutubeIE
class TestYoutubeChapters(unittest.TestCase):
_TEST_CASES = [
+ (
+ # https://www.youtube.com/watch?v=gBRKnvK1JUE
+ # pattern: 00:00 - 09:24
+ '''Here is Nucleus's 1979 album Out Of The Long Dark: https://www.youtube.com/watch?v=GX4Eh1DPb-E
And here is their 1971 live album: https://www.youtube.com/watch?v=cpbM75B8qaE
00:00 - 09:24 roots
09:24 - 14:19 images
14:19 - 18:20 caliban
18:20 - 21:42 whapatiti
21:42 - 26:18 capricorn
26:18 - 29:42 odokamona
29:42 - 37:26 southern roots and celebration
Bass Guitar – Roger Sutton
Design – Keith Davis (3)
Drums – Clive Thacker
Engineer – Roger Wake
Guitar – Jocelyn Pitchen
Percussion – Aureo de Souza
Piano, Electric Piano – Dave MacRae
Producer – Fritz Fryer
Tenor Saxophone, Soprano Saxophone, Flute, Flute [Bamboo] – Brian Smith
Trumpet – Ian Carr
Vocals – Joy Yates
Written-By – Brian Smith (tracks: B1 to B3), Dave MacRae (tracks: B4), Ian Carr (tracks: A) ''',
+ 2246,
+ [{
+ 'start_time': 0,
+ 'end_time': 564,
+ 'title': 'roots',
+ }, {
+ 'start_time': 564,
+ 'end_time': 859,
+ 'title': 'images',
+ }, {
+ 'start_time': 859,
+ 'end_time': 1100,
+ 'title': 'caliban',
+ }, {
+ 'start_time': 1100,
+ 'end_time': 1302,
+ 'title': 'whapatiti',
+ }, {
+ 'start_time': 1302,
+ 'end_time': 1578,
+ 'title': 'capricorn',
+ }, {
+ 'start_time': 1578,
+ 'end_time': 1782,
+ 'title': 'odokamona',
+ }, {
+ 'start_time': 1782,
+ 'end_time': 2246,
+ 'title': 'southern roots and celebration',
+ }]
+ ),
(
# https://www.youtube.com/watch?v=A22oy8dFjqc
# pattern: 00:00 -
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index afaa12b1b..7c38531bf 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -1621,7 +1621,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
if not description:
return None
chapter_lines = re.findall(
- r'(?:^|
)([^<]*]+onclick=["\']yt\.www\.watch\.player\.seekTo[^>]+>(\d{1,2}:\d{1,2}(?::\d{1,2})?)[^>]*)(?=$|
)',
+ r'(?:^|
)([^<]*]+onclick=["\']yt\.www\.watch\.player\.seekTo[^>]+>(\d{1,2}:\d{1,2}(?::\d{1,2})?)(?:[^<]*]*)(?=$|
)',
description)
if not chapter_lines:
return None