Skip to content

Commit 786d0c7

Browse files
committed
Started fixing YoutubeDashManifestCreatorsTest
1 parent a09eedf commit 786d0c7

File tree

8 files changed

+107
-515
lines changed

8 files changed

+107
-515
lines changed

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/dashmanifestcreator/AbstractYoutubeDashManifestCreator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ protected void generateRepresentationElement() {
284284
final String codec = itagInfo.getCodec();
285285
if (isNullOrEmpty(codec)) {
286286
throw DashManifestCreationException.couldNotAddElement(ADAPTATION_SET,
287-
"the codec value of the ItagItem is null or empty");
287+
"invalid codec=" + codec);
288288
}
289289

290290
appendNewAttrWithValue(
@@ -326,7 +326,7 @@ protected void generateRepresentationElement() {
326326

327327
if (videoQualityData.fps() > 0) {
328328
appendNewAttrWithValue(
329-
representationElement, "height", videoQualityData.fps());
329+
representationElement, "frameRate", videoQualityData.fps());
330330
}
331331
}
332332

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/dashmanifestcreator/YoutubeProgressiveDashManifestCreator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public String generateManifest() {
3434
}
3535

3636
generateDocumentAndCommonElements(streamDurationMs);
37+
generateBaseUrlElement(itagInfo.getStreamUrl());
3738
generateSegmentBaseElement();
3839
generateInitializationElement();
3940

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ public void onFetchPage(@Nonnull final Downloader downloader)
840840
.getBytes(StandardCharsets.UTF_8);
841841
nextResponse = getJsonPostResponse(NEXT, body, localization);
842842

843-
if ((!isAgeRestricted && !isLive && !isPostLive())
843+
if ((!isAgeRestricted && !isLive && !isPostLive)
844844
|| isAndroidClientFetchForced) {
845845
try {
846846
fetchAndroidMobileJsonPlayer(contentCountry, localization, videoId);
@@ -1318,7 +1318,7 @@ private <I extends ItagFormat<?>> ItagInfo<I> buildItagInfo(
13181318
itagInfo.setFps(getNullableInteger(formatData, "fps"));
13191319
}
13201320

1321-
itagInfo.setBitRate(getNullableInteger(formatData, "bitRate"));
1321+
itagInfo.setBitRate(getNullableInteger(formatData, "bitrate"));
13221322
itagInfo.setQuality(formatData.getString("quality"));
13231323

13241324
final String mimeType = formatData.getString("mimeType", "");

extractor/src/main/java/org/schabi/newpipe/extractor/streamdata/delivery/simpleimpl/SimpleDASHManifestDeliveryDataImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public DashManifestCreator getDashManifestCreator() {
3939

4040
@Override
4141
public String getCachedDashManifestAsString() {
42-
if (cachedDashManifest != null) {
42+
if (cachedDashManifest == null) {
4343
cachedDashManifest = getDashManifestCreator().generateManifest();
4444
}
4545
return cachedDashManifest;

extractor/src/main/java/org/schabi/newpipe/extractor/utils/ManifestCreatorCache.java

Lines changed: 0 additions & 255 deletions
This file was deleted.

extractor/src/main/java/org/schabi/newpipe/extractor/utils/Pair.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
package org.schabi.newpipe.extractor.utils;
22

3-
import java.io.Serializable;
43
import java.util.Objects;
54

65
/**
7-
* Serializable class to create a pair of objects.
6+
* class to create a pair of objects.
87
*
9-
* <p>
10-
* The two objects of the pair must be {@link Serializable serializable} and can be of the same
11-
* type.
12-
* </p>
138
*
149
* <p>
1510
* Note that this class is not intended to be used as a general-purpose pair and should only be
1611
* used when interfacing with the extractor.
1712
* </p>
1813
*
19-
* @param <F> the type of the first object, which must be {@link Serializable}
20-
* @param <S> the type of the second object, which must be {@link Serializable}
14+
* @param <F> the type of the first object
15+
* @param <S> the type of the second object
2116
*/
22-
public class Pair<F extends Serializable, S extends Serializable> implements Serializable {
17+
public class Pair<F, S> {
2318

2419
/**
2520
* The first object of the pair.

0 commit comments

Comments
 (0)