Skip to content

Commit 4f5554f

Browse files
authored
header variable
1 parent e0656a5 commit 4f5554f

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

scripts/update_image_links.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
import shutil
1818

1919
SCRYFALL_MAX_LIST_SIZE = 75
20+
SCRYFALL_API_HEADERS = {
21+
'Content-Type': 'application/json',
22+
'User-Agent': 'Magic-Token',
23+
'Accept': 'application/json',
24+
}
2025

2126
def cards_collection(identifiers):
2227
"""
@@ -38,9 +43,7 @@ def cards_collection(identifiers):
3843
n += SCRYFALL_MAX_LIST_SIZE
3944

4045
payload = json.dumps({'identifiers': chunk}).encode('utf-8')
41-
req = Request('https://api.scryfall.com/cards/collection', payload,
42-
headers={
43-
'Content-Type': 'application/json'})
46+
req = Request('https://api.scryfall.com/cards/collection', payload, headers=SCRYFALL_API_HEADERS)
4447
# Rate limiting
4548
cur_time = time.time()
4649
delta_time = cur_time - start_time

0 commit comments

Comments
 (0)