mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-14 14:20:33 +05:30
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
@ -1079,8 +1079,10 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||||||
|
|
||||||
// Search for correct panel containing the data
|
// Search for correct panel containing the data
|
||||||
for (int i = 0; i < panels.size(); i++) {
|
for (int i = 0; i < panels.size(); i++) {
|
||||||
if (panels.getObject(i).getObject("engagementPanelSectionListRenderer")
|
final String panelIdentifier = panels.getObject(i).getObject("engagementPanelSectionListRenderer")
|
||||||
.getString("panelIdentifier").equals("engagement-panel-macro-markers")) {
|
.getString("panelIdentifier");
|
||||||
|
if (panelIdentifier.equals("engagement-panel-macro-markers-description-chapters")
|
||||||
|
|| panelIdentifier.equals("engagement-panel-macro-markers")) {
|
||||||
segmentsArray = panels.getObject(i).getObject("engagementPanelSectionListRenderer")
|
segmentsArray = panels.getObject(i).getObject("engagementPanelSectionListRenderer")
|
||||||
.getObject("content").getObject("macroMarkersListRenderer").getArray("contents");
|
.getObject("content").getObject("macroMarkersListRenderer").getArray("contents");
|
||||||
break;
|
break;
|
||||||
|
@ -259,7 +259,6 @@ public class YoutubeStreamExtractorDefaultTest {
|
|||||||
|
|
||||||
@Override public int expectedStreamSegmentsCount() { return 7; }
|
@Override public int expectedStreamSegmentsCount() { return 7; }
|
||||||
@Test
|
@Test
|
||||||
@Ignore("TODO fix")
|
|
||||||
public void testStreamSegment() throws Exception {
|
public void testStreamSegment() throws Exception {
|
||||||
final StreamSegment segment = extractor.getStreamSegments().get(1);
|
final StreamSegment segment = extractor.getStreamSegments().get(1);
|
||||||
assertEquals(164, segment.getStartTimeSeconds());
|
assertEquals(164, segment.getStartTimeSeconds());
|
||||||
|
Loading…
Reference in New Issue
Block a user