Skip to content

Commit 455cf8e

Browse files
committed
[YouTube] Extract xtags of formats
Extracts the `xtags` field, which encodes additional data of the format, such as if the format is using dynamic range compression. This is required for using SABR.
1 parent 10377d5 commit 455cf8e

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ public MediaFormat getMediaFormat() {
268268
private Locale audioLocale;
269269

270270
private long lastModified;
271+
private String xtags;
271272
private boolean isDrc;
272273

273274
public long getLastModified() {
@@ -278,6 +279,14 @@ public void setLastModified(final long lastModified) {
278279
this.lastModified = lastModified;
279280
}
280281

282+
public String getXtags() {
283+
return xtags;
284+
}
285+
286+
public void setXtags(final String xtags) {
287+
this.xtags = xtags;
288+
}
289+
281290
public Boolean isDrc() {
282291
return isDrc;
283292
}

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
@@ -1423,6 +1423,7 @@ private ItagInfo buildAndAddItagInfoToList(
14231423
itagItem.setCodec(codec);
14241424
itagItem.setIsDrc(formatData.getBoolean("isDrc", false));
14251425
itagItem.setLastModified(Long.parseLong(formatData.getString("lastModified", "-1")));
1426+
itagItem.setXtags(formatData.getString("xtags"));
14261427

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

0 commit comments

Comments
 (0)