Typos, comments and formatting

This commit is contained in:
TobiGr 2020-01-24 01:27:54 +01:00
parent 29a4cc78bf
commit 9b45c61103
3 changed files with 7 additions and 6 deletions

View File

@ -805,7 +805,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
final String sts = Parser.matchGroup1(stsPattern, embedPageContent); final String sts = Parser.matchGroup1(stsPattern, embedPageContent);
return new EmbeddedInfo(playerUrl, sts); return new EmbeddedInfo(playerUrl, sts);
} catch (Exception i) { } catch (Exception i) {
// if it failes we simply reply with no sts as then it does not seem to be necessary // if it fails we simply reply with no sts as then it does not seem to be necessary
return new EmbeddedInfo(playerUrl, ""); return new EmbeddedInfo(playerUrl, "");
} }
@ -871,7 +871,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
String decryptionFunctionName; String decryptionFunctionName;
// Cascading things in catch is ugly, but its faster than running a match before getting the actual name // Cascading things in catch is ugly, but its faster than running a match before getting the actual name
// to se if the function can actually be found with the given regex. // to se if the function can actually be found with the given regex.
// However if this cascading should propably be cleaned up somehow as it looks a bit weird. // However if this cascading should probably be cleaned up somehow as it looks a bit weird.
try { try {
decryptionFunctionName = Parser.matchGroup1(DECRYPTION_SIGNATURE_FUNCTION_REGEX, playerCode); decryptionFunctionName = Parser.matchGroup1(DECRYPTION_SIGNATURE_FUNCTION_REGEX, playerCode);
} catch (Parser.RegexException re) { } catch (Parser.RegexException re) {

View File

@ -67,6 +67,7 @@ public class Parser {
if (foundMatch) { if (foundMatch) {
return mat.group(group); return mat.group(group);
} else { } else {
// only pass input to exception message when it is not too long
if (input.length() > 1024) { if (input.length() > 1024) {
throw new RegexException("failed to find pattern \"" + pat.pattern()); throw new RegexException("failed to find pattern \"" + pat.pattern());
} else { } else {