def is_dict(string_content):
    """Try load string_content as json, if failed, return False, else return True."""
    try:
        json.loads(string_content)
    except JSONDecodeError:
        return False
    return True
Try load string_content as json, if failed, return False, else return True.
src/scrapy_redis/utils.py