mirror of
https://github.com/mitb-archive/filebot
synced 2025-01-10 21:38:04 -05:00
* fix subtitles-not-found issue caused by the limit of 500. The limit should now be 2000 and effectively not ever be an issue again
This commit is contained in:
parent
5fadfbe3e3
commit
2ad88bd306
@ -108,7 +108,7 @@ public class OpenSubtitlesSubtitleDescriptor implements SubtitleDescriptor, Seri
|
|||||||
try {
|
try {
|
||||||
stream = new GZIPInputStream(stream);
|
stream = new GZIPInputStream(stream);
|
||||||
} catch (ZipException e) {
|
} catch (ZipException e) {
|
||||||
throw new IOException(String.format("%s: anti-leech limit may have been reached", e.getMessage()));
|
throw new IOException(String.format("%s: anti-leech limit has been reached", e.getMessage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// fully download
|
// fully download
|
||||||
|
@ -96,7 +96,7 @@ public class OpenSubtitlesXmlRpc {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public List<OpenSubtitlesSubtitleDescriptor> searchSubtitles(Collection<Query> queryList) throws XmlRpcFault {
|
public List<OpenSubtitlesSubtitleDescriptor> searchSubtitles(Collection<Query> queryList) throws XmlRpcFault {
|
||||||
List<OpenSubtitlesSubtitleDescriptor> subtitles = new ArrayList<OpenSubtitlesSubtitleDescriptor>();
|
List<OpenSubtitlesSubtitleDescriptor> subtitles = new ArrayList<OpenSubtitlesSubtitleDescriptor>();
|
||||||
Map<?, ?> response = invoke("SearchSubtitles", token, queryList);
|
Map<?, ?> response = invoke("SearchSubtitles", token, queryList, singletonMap("limit", 2000));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List<Map<String, String>> subtitleData = (List<Map<String, String>>) response.get("data");
|
List<Map<String, String>> subtitleData = (List<Map<String, String>>) response.get("data");
|
||||||
|
@ -177,6 +177,15 @@ public class OpenSubtitlesXmlRpcTest {
|
|||||||
assertEquals(48717, data.remaining(), 0);
|
assertEquals(48717, data.remaining(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Test(expected = IOException.class)
|
||||||
|
public void fetchSubtitlesExceedLimit() throws Exception {
|
||||||
|
List<OpenSubtitlesSubtitleDescriptor> list = xmlrpc.searchSubtitles(773262, "eng");
|
||||||
|
|
||||||
|
for (int i = 0; true; i++) {
|
||||||
|
System.out.format("Fetch #%d: %s%n", i, list.get(i).fetch());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void logout() throws Exception {
|
public static void logout() throws Exception {
|
||||||
// logout manually
|
// logout manually
|
||||||
|
Loading…
Reference in New Issue
Block a user