from typing import Union
from typing import List
from typing import Dict
import time
import json
import requests


def download(url: str) -> Union[List, Dict]:
    """ Download data from SRC API, with throttling """
    print('[tools.py::download] Fetching', url)
    time.sleep(1)
    headers = {'user-agent': 'akleemans-gameboy-wr-bot/2.0'}
    content = json.loads(requests.get(url, headers=headers).text)
    data = content['data']
    return data