import requests


def init_session(proxy=None):
    """Creates a new requests session with sensible defaults."""

    session = requests.Session()
    session.headers[
        "User-Agent"
    ] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92 Safari/537.36"

    if proxy is not None:
        session.proxies = {
            "http": proxy,
            "https": proxy,
        }

    return session