Fix extraction of YouTube chapters (#531)
YouTube changed the name of the chapters in the JSON from engagement-panel-macro-markers to engagement-panel-macro-markers-description-chapters, so extracting chapters doesn't work.
This commit is contained in:
parent
bfa639950e
commit
1414a6f178
2 changed files with 4 additions and 3 deletions
|
@ -1079,8 +1079,10 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||
|
||||
// Search for correct panel containing the data
|
||||
for (int i = 0; i < panels.size(); i++) {
|
||||
if (panels.getObject(i).getObject("engagementPanelSectionListRenderer")
|
||||
.getString("panelIdentifier").equals("engagement-panel-macro-markers")) {
|
||||
final String panelIdentifier = panels.getObject(i).getObject("engagementPanelSectionListRenderer")
|
||||
.getString("panelIdentifier");
|
||||
if (panelIdentifier.equals("engagement-panel-macro-markers-description-chapters")
|
||||
|| panelIdentifier.equals("engagement-panel-macro-markers")) {
|
||||
segmentsArray = panels.getObject(i).getObject("engagementPanelSectionListRenderer")
|
||||
.getObject("content").getObject("macroMarkersListRenderer").getArray("contents");
|
||||
break;
|
||||
|
|
|
@ -259,7 +259,6 @@ public class YoutubeStreamExtractorDefaultTest {
|
|||
|
||||
@Override public int expectedStreamSegmentsCount() { return 7; }
|
||||
@Test
|
||||
@Ignore("TODO fix")
|
||||
public void testStreamSegment() throws Exception {
|
||||
final StreamSegment segment = extractor.getStreamSegments().get(1);
|
||||
assertEquals(164, segment.getStartTimeSeconds());
|
||||
|
|
Loading…
Reference in a new issue