websearch.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:jarvis 作者: anqxyr 项目源码 文件源码
def steam(inp, title, _cache={}):
    """Find steam games by their title."""
    if not _cache:
        data = requests.get(
            'http://api.steampowered.com/ISteamApps/GetAppList/v0001/').json()
        data = data['applist']['apps']['app']
        data = {i['name'].lower(): i['appid'] for i in data}
        _cache.update(data)
    if title in _cache:
        return get_steam_game(_cache[title])
    for k, v in _cache.items():
        if title in k:
            return get_steam_game(v)
    return lex.steam.not_found


###############################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号