Skip to content

Commit

Permalink
Update scryfall.py
Browse files Browse the repository at this point in the history
Fix set code not working with scryfall search
  • Loading branch information
Investigamer committed Nov 7, 2022
1 parent c859f24 commit 189d8ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions proxyshop/scryfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ def get_card_search(name: str, lang: Optional[str] = None, set_code: Optional[st
lang = f"+lang:{lang}" if lang else ""

# Set code given?
code = f"+set:{set_code}" if set_code else ""
code = f"+set%3A{set_code}" if set_code else ""

# Query Scryfall, 3 retries
url = f'https://api.scryfall.com/cards/search?q=!"{name}"&unique=prints{order}{lang}{code}'
url = f'https://api.scryfall.com/cards/search?q=!"{name}"{code}&unique=prints{order}{lang}'
print(url)
err = None
for i in range(3):
try:
Expand Down

0 comments on commit 189d8ca

Please sign in to comment.