Merge pull request #355 from Redirion/patch-1

Added a comment
This commit is contained in:
Tobias Groza 2020-06-27 11:47:50 +02:00 committed by GitHub
commit dbf6ab9e91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 5 deletions

View File

@ -108,7 +108,12 @@ public class YoutubeParsingHelper {
return host.equalsIgnoreCase("invidio.us") || host.equalsIgnoreCase("dev.invidio.us") || host.equalsIgnoreCase("www.invidio.us") || host.equalsIgnoreCase("invidious.snopyta.org") || host.equalsIgnoreCase("de.invidious.snopyta.org") || host.equalsIgnoreCase("fi.invidious.snopyta.org") || host.equalsIgnoreCase("vid.wxzm.sx") || host.equalsIgnoreCase("invidious.kabi.tk") || host.equalsIgnoreCase("invidiou.sh") || host.equalsIgnoreCase("www.invidiou.sh") || host.equalsIgnoreCase("no.invidiou.sh") || host.equalsIgnoreCase("invidious.enkirton.net") || host.equalsIgnoreCase("tube.poal.co") || host.equalsIgnoreCase("invidious.13ad.de") || host.equalsIgnoreCase("yt.elukerio.org");
}
public static long parseDurationString(String input)
/**
* Parses the duration string of the video expecting ":" or "." as seperators
* @return the duration in seconds
* @throws ParsingException when more than 3 seperators are found
*/
public static int parseDurationString(final String input)
throws ParsingException, NumberFormatException {
// If time separator : is not detected, try . instead
final String[] splitInput = input.contains(":")
@ -143,10 +148,10 @@ public class YoutubeParsingHelper {
throw new ParsingException("Error duration string with unknown format: " + input);
}
return ((Long.parseLong(Utils.removeNonDigitCharacters(days)) * 24
+ Long.parseLong(Utils.removeNonDigitCharacters(hours))) * 60
+ Long.parseLong(Utils.removeNonDigitCharacters(minutes))) * 60
+ Long.parseLong(Utils.removeNonDigitCharacters(seconds));
return ((Integer.parseInt(Utils.removeNonDigitCharacters(days)) * 24
+ Integer.parseInt(Utils.removeNonDigitCharacters(hours))) * 60
+ Integer.parseInt(Utils.removeNonDigitCharacters(minutes))) * 60
+ Integer.parseInt(Utils.removeNonDigitCharacters(seconds));
}
public static String getFeedUrlFrom(final String channelIdOrUser) {