Skip to content

Commit

Permalink
Merge pull request #355 from Redirion/patch-1
Browse files Browse the repository at this point in the history
Added a comment
  • Loading branch information
TobiGr authored Jun 27, 2020
2 parents 92f6754 + 5767549 commit dbf6ab9
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ public static boolean isInvidioURL(URL url) {
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(":")
Expand Down Expand Up @@ -143,10 +148,10 @@ public static long parseDurationString(String input)
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) {
Expand Down

0 comments on commit dbf6ab9

Please sign in to comment.