New set_info value mythicCode (#135)

* New set_info value mythicCode

Mythicspoiler is using IXA rather than XLN for some reason. Creating a new parameter to account for this.

* mythicCode

* mythicCode

* Mtgs name fixes

* Mtgs name fixes

* Set mythicCode to code if not present in setinfo
This commit is contained in:
Cheldra 2017-09-02 16:25:22 +01:00 committed by Dave
parent bbf48cf077
commit d042f71009
4 changed files with 11 additions and 4 deletions

View File

@ -69,7 +69,11 @@ corrections: #
#XLN
Jace, Cunning Castaway:
loyalty: 3
~Invite the Party:
name: "Invite the Party"
~Belligerent Dinosaur:
name: "Belligerent Dinosaur"
Jace, Ingenious Mind-Mage:
loyalty: 5
Huatli, Dinosaur Knight:
loyalty: 4
loyalty: 4

View File

@ -127,8 +127,10 @@ if __name__ == '__main__':
manual_cards = []
mtgs = spoilers.correct_cards(
mtgs, manual_cards, card_corrections, delete_cards['delete']) # fix using the fixfiles
if not 'mythicCode' in setinfo:
setinfo['mythicCode'] = setinfo['code']
mtgjson = spoilers.get_image_urls(
mtgs, presets['isfullspoil'], setinfo['code'], setinfo['name'], setinfo['size'], setinfo) # get images
mtgs, presets['isfullspoil'], setinfo['code'], setinfo['mythicCode'], setinfo['name'], setinfo['size'], setinfo) # get images
if presets['scryfallOnly'] or 'scryfallOnly' in setinfo and setinfo['scryfallOnly']:
scryfall = scryfall_scraper.get_scryfall(
'https://api.scryfall.com/cards/search?q=++e:' + setinfo['code'].lower())

View File

@ -52,6 +52,7 @@ releaseDate: "2017-09-29"
type: "expansion"
mtgsurl: "http://www.mtgsalvation.com/spoilers/185-ixalan"
mtgscardpath: "http://www.mtgsalvation.com/cards/ixalan/"
mythicCode: "ixa"
fullSpoil: false
# masterpieces:
# code: "MPS_?"

View File

@ -302,7 +302,7 @@ def remove_corrected_errors(errorlog=[], card_corrections=[], print_fixed=False)
return errorlog2
def get_image_urls(mtgjson, isfullspoil, code, name, size=269, setinfo=False):
def get_image_urls(mtgjson, isfullspoil, code, mythicCode, name, size=269, setinfo=False):
IMAGES = 'http://magic.wizards.com/en/content/' + \
name.lower().replace(' ', '-') + '-cards'
IMAGES2 = 'http://mythicspoiler.com/newspoilers.html'
@ -314,7 +314,7 @@ def get_image_urls(mtgjson, isfullspoil, code, name, size=269, setinfo=False):
text3 = requests.get(IMAGES3).text
wotcpattern = r'<img alt="{}.*?" src="(?P<img>.*?\.png)"'
wotcpattern2 = r'<img src="(?P<img>.*?\.png).*?alt="{}.*?"'
mythicspoilerpattern = r' src="' + code.lower() + '/cards/{}.*?.jpg">'
mythicspoilerpattern = r' src="' + mythicCode.lower() + '/cards/{}.*?.jpg">'
WOTC = []
for c in mtgjson['cards']:
if 'names' in c: