From 0924759fc406666225727ecf481762d4ce6edc69 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 29 Sep 2015 12:51:26 +0000 Subject: [PATCH] * fix for issue with SxE verification metric not passing through episode subtitles --- source/net/filebot/web/ShooterSubtitles.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source/net/filebot/web/ShooterSubtitles.java b/source/net/filebot/web/ShooterSubtitles.java index 1f3a6fa7..5a7f5a43 100644 --- a/source/net/filebot/web/ShooterSubtitles.java +++ b/source/net/filebot/web/ShooterSubtitles.java @@ -9,6 +9,7 @@ import java.io.IOException; import java.io.RandomAccessFile; import java.io.Serializable; import java.math.BigInteger; +import java.net.MalformedURLException; import java.net.URI; import java.net.URL; import java.nio.ByteBuffer; @@ -61,6 +62,14 @@ public class ShooterSubtitles implements VideoHashSubtitleService { return result; } + protected URL getSubApiUrl() { + try { + return new URL(System.getProperty("net.filebot.web.ShooterSubtitles.url", "https://www.shooter.cn/api/subapi.php")); + } catch (MalformedURLException e) { + throw new RuntimeException(e); + } + } + /** * @see https://docs.google.com/document/d/1ufdzy6jbornkXxsD-OGl3kgWa4P9WO5NZb6_QYZiGI0/preview */ @@ -72,7 +81,7 @@ public class ShooterSubtitles implements VideoHashSubtitleService { return emptyList(); } - URL endpoint = new URL("https://www.shooter.cn/api/subapi.php"); + URL endpoint = getSubApiUrl(); Map param = new LinkedHashMap(); param.put("filehash", computeFileHash(file)); param.put("pathinfo", file.getPath()); @@ -225,6 +234,10 @@ public class ShooterSubtitles implements VideoHashSubtitleService { return new File(getPath()); } + @Override + public String toString() { + return String.format("%s [%s]", getName(), getLanguageName()); + } } }