Skip to content

Commit 10377d5

Browse files
committed
[YouTube] Extract lastModified format data
Extracts the `lastModified` field of format, which is need for initiating SABR playback.
1 parent 500279f commit 10377d5

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,18 @@ public MediaFormat getMediaFormat() {
266266
private AudioTrackType audioTrackType;
267267
@Nullable
268268
private Locale audioLocale;
269+
270+
private long lastModified;
269271
private boolean isDrc;
270272

273+
public long getLastModified() {
274+
return lastModified;
275+
}
276+
277+
public void setLastModified(final long lastModified) {
278+
this.lastModified = lastModified;
279+
}
280+
271281
public Boolean isDrc() {
272282
return isDrc;
273283
}

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,7 @@ private ItagInfo buildAndAddItagInfoToList(
14221422
itagItem.setQuality(formatData.getString("quality"));
14231423
itagItem.setCodec(codec);
14241424
itagItem.setIsDrc(formatData.getBoolean("isDrc", false));
1425+
itagItem.setLastModified(Long.parseLong(formatData.getString("lastModified", "-1")));
14251426

14261427
if (streamType == StreamType.LIVE_STREAM || streamType == StreamType.POST_LIVE_STREAM) {
14271428
itagItem.setTargetDurationSec(formatData.getInt("targetDurationSec"));

0 commit comments

Comments
 (0)