mirror of
https://github.com/correl/mage.git
synced 2025-01-12 03:00:13 +00:00
Force Scryfall URL enconding
This commit is contained in:
parent
e913346a35
commit
74b396d7d4
1 changed files with 7 additions and 0 deletions
|
@ -13,6 +13,7 @@ import org.mage.plugins.card.images.CardDownloadData;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.Proxy;
|
import java.net.Proxy;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
|
@ -95,6 +96,12 @@ public enum ScryfallImageSource implements CardImageSource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
scryfallCollectorId = URLEncoder.encode(scryfallCollectorId, "utf-8");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
// URL failed to encode, this will cause download to miss in certain environments
|
||||||
|
}
|
||||||
|
|
||||||
baseUrl = "https://api.scryfall.com/cards/" + formatSetName(card.getSet(), isToken) + "/"
|
baseUrl = "https://api.scryfall.com/cards/" + formatSetName(card.getSet(), isToken) + "/"
|
||||||
+ scryfallCollectorId + "/" + localizedCode + "?format=image";
|
+ scryfallCollectorId + "/" + localizedCode + "?format=image";
|
||||||
alternativeUrl = "https://api.scryfall.com/cards/" + formatSetName(card.getSet(), isToken) + "/"
|
alternativeUrl = "https://api.scryfall.com/cards/" + formatSetName(card.getSet(), isToken) + "/"
|
||||||
|
|
Loading…
Reference in a new issue