Skip to content

Commit f3bcde1

Browse files
AudricVtsiflimagas
andcommitted
Improve the SEGMENT_DURATION_MS_PATTERN regular expression in YoutuDashManifestCreator
The Segment-Durations-Ms part of the first sequence of some OTF streams was not fully parsed by the previous regular expression. This commit should fix the issue. Huge thanks to tsiflimagas for the fix. Co-authored-by: tsiflimagas <kgstradviolin@outlook.com>
1 parent 44edcfa commit f3bcde1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeDashManifestCreator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
public class YoutubeDashManifestCreator {
3131

32-
private static final Pattern SEGMENT_DURATION_MS_PATTERN =
33-
Pattern.compile("Segment-Durations-Ms: ((?:\\d+,\\d+,)?(?:\\d+\\(r=\\d+\\),\\d+,)+)");
32+
private static final Pattern SEGMENT_DURATION_MS_PATTERN = Pattern.compile(
33+
"Segment-Durations-Ms: ((?:\\d+,\\d+,)?(?:\\d+\\(r=\\d+\\)(,\\d+)+,)+)");
3434

3535
private static final List<Integer> segmentsDuration = new ArrayList<>();
3636
private static final List<Integer> durationRepetitions = new ArrayList<>();

0 commit comments

Comments
 (0)