Skip to content

Commit 9b45c61

Browse files
committed
Typos, comments and formatting
1 parent 29a4cc7 commit 9b45c61

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/Extractor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void fetchPage() throws IOException, ExtractionException {
5656
}
5757

5858
protected void assertPageFetched() {
59-
if(!pageFetched) throw new IllegalStateException("Page is not fetched. Make sure you call fetchPage()");
59+
if (!pageFetched) throw new IllegalStateException("Page is not fetched. Make sure you call fetchPage()");
6060
}
6161

6262
protected boolean isPageFetched() {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ private String getPlayerUrl(JsonObject playerConfig) throws ParsingException {
773773
private JsonObject getPlayerResponse() throws ParsingException {
774774
try {
775775
String playerResponseStr;
776-
if(playerArgs != null) {
776+
if (playerArgs != null) {
777777
playerResponseStr = playerArgs.getString("player_response");
778778
} else {
779779
playerResponseStr = videoInfoPage.get("player_response");
@@ -805,7 +805,7 @@ private EmbeddedInfo getEmbeddedInfo() throws ParsingException, ReCaptchaExcepti
805805
final String sts = Parser.matchGroup1(stsPattern, embedPageContent);
806806
return new EmbeddedInfo(playerUrl, sts);
807807
} catch (Exception i) {
808-
// if it failes we simply reply with no sts as then it does not seem to be necessary
808+
// if it fails we simply reply with no sts as then it does not seem to be necessary
809809
return new EmbeddedInfo(playerUrl, "");
810810
}
811811

@@ -871,7 +871,7 @@ private String getDecryptionFuncName(String playerCode) throws DecryptException
871871
String decryptionFunctionName;
872872
// Cascading things in catch is ugly, but its faster than running a match before getting the actual name
873873
// to se if the function can actually be found with the given regex.
874-
// However if this cascading should propably be cleaned up somehow as it looks a bit weird.
874+
// However if this cascading should probably be cleaned up somehow as it looks a bit weird.
875875
try {
876876
decryptionFunctionName = Parser.matchGroup1(DECRYPTION_SIGNATURE_FUNCTION_REGEX, playerCode);
877877
} catch (Parser.RegexException re) {
@@ -891,7 +891,7 @@ private String getDecryptionFuncName(String playerCode) throws DecryptException
891891
@Nonnull
892892
private List<SubtitlesInfo> getAvailableSubtitlesInfo() throws SubtitlesException {
893893
// If the video is age restricted getPlayerConfig will fail
894-
if(isAgeRestricted) return Collections.emptyList();
894+
if (isAgeRestricted) return Collections.emptyList();
895895

896896
final JsonObject captions;
897897
if (!playerResponse.has("captions")) {
@@ -908,7 +908,7 @@ private List<SubtitlesInfo> getAvailableSubtitlesInfo() throws SubtitlesExceptio
908908
// This check is necessary since there may be cases where subtitles metadata do not contain caption track info
909909
// e.g. https://www.youtube.com/watch?v=-Vpwatutnko
910910
final int captionsSize = captionsArray.size();
911-
if(captionsSize == 0) return Collections.emptyList();
911+
if (captionsSize == 0) return Collections.emptyList();
912912

913913
List<SubtitlesInfo> result = new ArrayList<>();
914914
for (int i = 0; i < captionsSize; i++) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public static String matchGroup(Pattern pat, String input, int group) throws Reg
6767
if (foundMatch) {
6868
return mat.group(group);
6969
} else {
70+
// only pass input to exception message when it is not too long
7071
if (input.length() > 1024) {
7172
throw new RegexException("failed to find pattern \"" + pat.pattern());
7273
} else {

0 commit comments

Comments
 (0)