Fix Checkstyle issues, revert resolution string changes for YouTube video streams and don't return the rn parameter in DASH manifests

This parameter is still used to get the initialization sequence of OTF and POST-live streams, but is not returned anymore in the manifests.
It has been removed in order to avoid fingerprinting based on the number sent (e.g. when starting to play a stream close to the end and using 123 as the request number where it should be 1) and should be added dynamically by clients in their requests.
The relevant test has been also updated.

Checkstyle issues in YoutubeDashManifestCreator have been fixed, and the changes in the resolution string returned for video streams in YoutubeStreamExtractor have been reverted, as they create issues on NewPipe right now.
This commit is contained in:
TiA4f8R
2022-04-03 18:42:01 +02:00
parent f61e2092a1
commit 2fb1a412a6
4 changed files with 49 additions and 42 deletions

View File

@@ -21,7 +21,12 @@ import java.net.URL;
import java.util.List;
import java.util.Random;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
import static org.schabi.newpipe.extractor.utils.Utils.isBlank;
@@ -428,8 +433,8 @@ class YoutubeDashManifestCreatorTest {
throw new AssertionError("The value of the initialization attribute is not an URL",
e);
}
assertTrue(initializationValue.endsWith("&sq=0&rn=0"),
"The value of the initialization attribute doesn't end with &sq=0&rn=0");
assertTrue(initializationValue.endsWith("&sq=0"),
"The value of the initialization attribute doesn't end with &sq=0");
final String mediaValue = segmentTemplateElement.getAttribute("media");
assertFalse(isBlank(mediaValue),
@@ -440,8 +445,8 @@ class YoutubeDashManifestCreatorTest {
throw new AssertionError("The value of the media attribute is not an URL",
e);
}
assertTrue(mediaValue.endsWith("&sq=$Number$&rn=$Number$"),
"The value of the media attribute doesn't end with &sq=$Number$&rn=$Number$");
assertTrue(mediaValue.endsWith("&sq=$Number$"),
"The value of the media attribute doesn't end with &sq=$Number$");
final String startNumberValue = segmentTemplateElement.getAttribute("startNumber");
assertFalse(isBlank(startNumberValue),