mirror of
https://github.com/Cockatrice/Magic-Spoiler.git
synced 2026-04-19 05:27:34 -05:00
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:
parent
bbf48cf077
commit
d042f71009
|
|
@ -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
|
||||
4
main.py
4
main.py
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -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_?"
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user