From d0638e71af91f0fc507bf20726d4e40cabb8040c Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sun, 23 Jun 2019 18:56:25 +0400 Subject: [PATCH] Fixed symbols and images download from wizards; --- .../org/mage/plugins/card/dl/sources/GathererSets.java | 2 +- .../mage/plugins/card/dl/sources/GathererSymbols.java | 4 ++-- .../card/dl/sources/WizardCardsImageSource.java | 10 +++++----- Mage.Sets/src/mage/cards/c/CreepingDread.java | 2 +- Mage.Sets/src/mage/cards/s/ScarredPuma.java | 2 +- Mage.Sets/src/mage/cards/v/VulshokBattlemaster.java | 2 +- .../cards/abilities/enters/SkylineCascadeTest.java | 2 +- .../test/cards/continuous/ImprisonedInTheMoonTest.java | 2 +- .../test/cards/replacement/LeylineOfTheVoidTest.java | 2 +- .../cards/single/fut/MuragandaPetroglyphsTest.java | 2 +- Utils/cut.pl | 6 +++--- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java index 2d7de49b9b..a271963e94 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java @@ -332,7 +332,7 @@ public class GathererSets implements Iterable { if (codeReplacements.containsKey(set)) { set = codeReplacements.get(set); } - String url = "http://gatherer.wizards.com/Handlers/Image.ashx?type=symbol&set=" + set + "&size=small&rarity=" + urlRarity; + String url = "https://gatherer.wizards.com/Handlers/Image.ashx?type=symbol&set=" + set + "&size=small&rarity=" + urlRarity; return new DownloadJob(set + '-' + rarity, fromURL(url), toFile(dst)); } } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSymbols.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSymbols.java index 7a4182df2f..d222a5929e 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSymbols.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSymbols.java @@ -23,11 +23,11 @@ import static org.mage.plugins.card.utils.CardImageUtils.getImagesDir; */ public class GathererSymbols implements Iterable { //TODO chaos and planeswalker symbol - //chaos: http://gatherer.wizards.com/Images/Symbols/chaos.gif + //chaos: https://gatherer.wizards.com/Images/Symbols/chaos.gif private static File outDir; - private static final String urlFmt = "http://gatherer.wizards.com/handlers/image.ashx?size=%1$s&name=%2$s&type=symbol"; + private static final String urlFmt = "https://gatherer.wizards.com/handlers/image.ashx?size=%1$s&name=%2$s&type=symbol"; private static final String[] sizes = {"small", "medium", "large"}; diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java index 3ee788d1e5..6a8cd5d478 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java @@ -501,8 +501,8 @@ public enum WizardCardsImageSource implements CardImageSource { } } } - if (link != null && !link.startsWith("http://")) { - link = "http://gatherer.wizards.com" + link; + if (link != null && !link.startsWith("https://")) { + link = "https://gatherer.wizards.com" + link; } if (link != null) { @@ -528,7 +528,7 @@ public enum WizardCardsImageSource implements CardImageSource { int firstMultiverseIdLastPage = 0; Pages: while (page < 999) { - String searchUrl = "http://gatherer.wizards.com/Pages/Search/Default.aspx?sort=cn+&page=" + page + "&action=advanced&output=spoiler&method=visual&set=+%5B%22" + URLSetName + "%22%5D"; + String searchUrl = "https://gatherer.wizards.com/Pages/Search/Default.aspx?sort=cn+&page=" + page + "&action=advanced&output=spoiler&method=visual&set=+%5B%22" + URLSetName + "%22%5D"; logger.debug("URL: " + searchUrl); Document doc = CardImageUtils.downloadHtmlDocument(searchUrl); Elements cardsImages = doc.select("img[src^=../../Handlers/]"); @@ -588,7 +588,7 @@ public enum WizardCardsImageSource implements CardImageSource { criteria.setCodes(cardSet); List cards = CardRepository.instance.findCards(criteria); - String urlLandDocument = "http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=" + multiverseId; + String urlLandDocument = "https://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=" + multiverseId; Document landDoc = CardImageUtils.downloadHtmlDocument(urlLandDocument); Elements variations = landDoc.select("a.variationlink"); if (!variations.isEmpty()) { @@ -635,7 +635,7 @@ public enum WizardCardsImageSource implements CardImageSource { } private HashMap getlocalizedMultiverseIds(Integer englishMultiverseId) throws IOException { - String cardLanguagesUrl = "http://gatherer.wizards.com/Pages/Card/Languages.aspx?multiverseid=" + englishMultiverseId; + String cardLanguagesUrl = "https://gatherer.wizards.com/Pages/Card/Languages.aspx?multiverseid=" + englishMultiverseId; Document cardLanguagesDoc = CardImageUtils.downloadHtmlDocument(cardLanguagesUrl); Elements languageTableRows = cardLanguagesDoc.select("tr.cardItem"); HashMap localizedIds = new HashMap<>(); diff --git a/Mage.Sets/src/mage/cards/c/CreepingDread.java b/Mage.Sets/src/mage/cards/c/CreepingDread.java index c2b0e0e8a0..31fcb6936b 100644 --- a/Mage.Sets/src/mage/cards/c/CreepingDread.java +++ b/Mage.Sets/src/mage/cards/c/CreepingDread.java @@ -62,7 +62,7 @@ class CreepingDreadEffect extends OneShotEffect { each player selects a card from their hand without revealing it, sets it aside, and then all of those cards are revealed and discarded at once. - http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=409851 + https://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=409851 */ @Override public boolean apply(Game game, Ability source) { diff --git a/Mage.Sets/src/mage/cards/s/ScarredPuma.java b/Mage.Sets/src/mage/cards/s/ScarredPuma.java index d1f88ee6b1..a42b40a185 100644 --- a/Mage.Sets/src/mage/cards/s/ScarredPuma.java +++ b/Mage.Sets/src/mage/cards/s/ScarredPuma.java @@ -69,7 +69,7 @@ public final class ScarredPuma extends CardImpl { public boolean applies(Permanent permanent, Ability source, Game game) { if (permanent.getId().equals(source.getSourceId())) { for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { - //excludes itself (http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=23067) + //excludes itself (https://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=23067) if (!Objects.equals(creature.getId(), source.getSourceId())) { ObjectColor color = creature.getColor(game); if (color.isBlack() || color.isGreen()) { diff --git a/Mage.Sets/src/mage/cards/v/VulshokBattlemaster.java b/Mage.Sets/src/mage/cards/v/VulshokBattlemaster.java index 417f18ace4..4f69e8aadc 100644 --- a/Mage.Sets/src/mage/cards/v/VulshokBattlemaster.java +++ b/Mage.Sets/src/mage/cards/v/VulshokBattlemaster.java @@ -69,7 +69,7 @@ public final class VulshokBattlemaster extends CardImpl { filter.add(new SubtypePredicate(SubType.EQUIPMENT)); for (Permanent equipment : game.getBattlefield().getAllActivePermanents(filter, game)) { if (equipment != null) { - //If an Equipment can't equip Vulshok Battlemaster, it isn't attached to the Battlemaster, and it doesn't become unattached (if it's attached to a creature). (http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=48125) + //If an Equipment can't equip Vulshok Battlemaster, it isn't attached to the Battlemaster, and it doesn't become unattached (if it's attached to a creature). (https://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=48125) if (!battlemaster.cantBeAttachedBy(equipment, game)) { battlemaster.addAttachment(equipment.getId(), game); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/SkylineCascadeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/SkylineCascadeTest.java index 93974d8ee3..fe5b0016b5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/SkylineCascadeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/SkylineCascadeTest.java @@ -51,7 +51,7 @@ public class SkylineCascadeTest extends CardTestPlayerBase { * * "Skyline Cascade's triggered ability doesn't tap the creature. It can target any creature, tapped or untapped. * If that creature is already untapped at the beginning of its controller's next untap step, the effect won't do anything." - * http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=402038 + * https://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=402038 * * An untapped creature will remain untapped. */ diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ImprisonedInTheMoonTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ImprisonedInTheMoonTest.java index 8583715ed7..78547484d5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ImprisonedInTheMoonTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ImprisonedInTheMoonTest.java @@ -19,7 +19,7 @@ public class ImprisonedInTheMoonTest extends CardTestPlayerBase { /* * Reported bug: Urza land enchanted with Imprisoned In the Moon incorrectly makes it so other Urza lands only tap for 1 <> . * - * Card ruling: http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=414360 + * Card ruling: https://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=414360 * If the enchanted permanent is a land and has land types, it retains those types even though it loses any intrinsic mana abilities associated with them. * For example, a Plains enchanted by Imprisoned in the Moon is still a Plains, but it can't tap for {W}, only for {C}. */ diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/LeylineOfTheVoidTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/LeylineOfTheVoidTest.java index 3da3b7cefa..b35f8571c0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/LeylineOfTheVoidTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/LeylineOfTheVoidTest.java @@ -102,7 +102,7 @@ public class LeylineOfTheVoidTest extends CardTestPlayerBase { /* "Leyline of the Void's second ability doesn't affect token permanents that would be put into an opponent's graveyard from the battlefield. They'll be put into that graveyard as normal (causing any applicable triggered abilities to trigger), then they'll cease to exist." - http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=107682 + https://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=107682 */ @Test diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/MuragandaPetroglyphsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/MuragandaPetroglyphsTest.java index 0b86e47c8b..a7856156d9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/MuragandaPetroglyphsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/MuragandaPetroglyphsTest.java @@ -9,7 +9,7 @@ import org.mage.test.serverside.base.CardTestPlayerBase; /** * This test is based on rulings of the card Muraganda Petroglyphs in magic Gatherer site - * (http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=145110), accessed in + * (https://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=145110), accessed in * 08/01/2017. * * @author alexsandro. diff --git a/Utils/cut.pl b/Utils/cut.pl index 3b03a0a5b5..16e54a43d0 100644 --- a/Utils/cut.pl +++ b/Utils/cut.pl @@ -32,8 +32,8 @@ use POSIX qw(strftime); print (" cut.pl bob.txt 0 0 str_condense (Used for making similar lines in files smaller..)\n"); print (" cut.pl stdin \"http://bob.com/a=XXX.id\" 1000 oneupcount \n"); print (" cut.pl stdin \"http://www.comlaw.gov.au/Details/XXX\" 1000 wget\n"); - print (" cut.pl stdin \"http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=XXX\" 5274 oneupcount\n"); - print (" cut.pl stdin \"http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=XXX' 5274 wget\n"); + print (" cut.pl stdin \"https://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=XXX\" 5274 oneupcount\n"); + print (" cut.pl stdin \"https://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=XXX' 5274 wget\n"); print (" cut.pl modern_bluesa \";;;\" \"0,7\" fields | cut.pl stdin \";;;\" 3 wordcombos\n"); print (" cut.pl modern_bluesa \";;;\" \"0,7\" fields | cut.pl stdin 0 0 uniquewords\n"); print (" cut.pl modern_bluesa \";;;\" \"0,2\" images_html\n"); @@ -47,7 +47,7 @@ use POSIX qw(strftime); print ('\necho "" | cut.pl stdin "http://mythicspoiler.com/c17/cards/stalkingleonin.html" 0 wget_card_spoiler\n'); print ('dir /a /b /s *.jar | cut.pl stdin "^" "7z l -r \"" replace | cut.pl stdin "$" "\"" replace > d:\temp\xyz.bat'); print ("\n"); - print ('echo "1" | cut.pl stdin "http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=16431&type=card" "6ED/Phantasmal Terrain.full.jpg" wget_image'); + print ('echo "1" | cut.pl stdin "https://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=16431&type=card" "6ED/Phantasmal Terrain.full.jpg" wget_image'); print ("\n"); exit 0; }