mirror of
https://github.com/Cockatrice/Magic-Spoiler.git
synced 2026-08-28 04:15:25 -05:00
Use scryfall data for C17 (disables all other sources) (#127)
* Use scryfall data for C17 (disables all other sources) * Allow individual sets to be scryfall-only sourced. Remove prototyped variables (and add one...)
This commit is contained in:
13
main.py
13
main.py
@@ -16,14 +16,9 @@ presets = {
|
||||
"isfullspoil": False, # when full spoil comes around, we only want to use WOTC images
|
||||
"includeMasterpieces": True, # if the set has masterpieces, let's get those too
|
||||
"oldRSS": False, # maybe MTGS hasn't updated their spoiler.rss but new cards have leaked
|
||||
# if we want to use one site before another for card data TODO
|
||||
"siteorder": ['scryfall', 'mtgs', 'mythicspoiler'],
|
||||
# prioritize images from certain sources
|
||||
"imageorder": ['wotc', 'scryfall', 'mtgs', 'mythicspoiler'],
|
||||
"useexclusively": '', # if we *only* want to use one site TODO
|
||||
"dumpXML": False, # let travis print XML for testing
|
||||
# if we want to debug compare scryfall to other sources, enable
|
||||
"scryfallComparison": False,
|
||||
# only use Scryfall data (no mtgs for ANY sets)
|
||||
"scryfallOnly": False,
|
||||
"dumpErrors": True # print the error log from out/errors.json
|
||||
}
|
||||
|
||||
@@ -130,10 +125,10 @@ if __name__ == '__main__':
|
||||
mtgs, manual_sets[setinfo['code']], card_corrections, delete_cards['delete']) # fix using the fixfiles
|
||||
mtgjson = spoilers.get_image_urls(
|
||||
mtgs, presets['isfullspoil'], setinfo['code'], setinfo['name'], setinfo['size'], setinfo) # get images
|
||||
if presets['scryfallComparison']:
|
||||
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())
|
||||
mtgjson = scryfall_scraper.smash_mtgs_scryfall(mtgs, scryfall)
|
||||
mtgjson = scryfall #_scraper.smash_mtgs_scryfall(mtgs, scryfall)
|
||||
if 'fullSpoil' in setinfo and setinfo['fullSpoil']:
|
||||
wotc = wizards_scraper.scrape_fullspoil('', setinfo)
|
||||
wizards_scraper.smash_fullspoil(mtgjson, wotc)
|
||||
|
||||
@@ -50,6 +50,7 @@ size: 279
|
||||
releaseDate: "2017-09-29"
|
||||
type: "expansion"
|
||||
noRSS: true
|
||||
mythicOnly: true
|
||||
---
|
||||
code: "C17"
|
||||
name: "Commander 2017"
|
||||
@@ -57,4 +58,5 @@ size: 309
|
||||
releaseDate: "2017-09-29"
|
||||
type: "commander"
|
||||
noRSS: true
|
||||
noBooster: true
|
||||
noBooster: true
|
||||
scryfallOnly: true
|
||||
@@ -482,7 +482,7 @@ def write_xml(mtgjson, code, name, releaseDate):
|
||||
|
||||
cardsxml.write("</cards>\n</cockatrice_carddatabase>")
|
||||
|
||||
print 'XML Stats for ' + name
|
||||
print 'XML Stats for ' + code
|
||||
print 'Total cards: ' + str(count)
|
||||
if dfccount > 0:
|
||||
print 'DFC: ' + str(dfccount)
|
||||
|
||||
Reference in New Issue
Block a user