def main():
    # 获取登录状态
    steam_class = steam.Steam(need_login=False)

    # 已删除的游戏
    deleted_app_list = steam_class.load_deleted_app_list()

    output.print_msg(f"总共获取{len(deleted_app_list)}个已删除游戏")

    result_game_ids = []
    while len(deleted_app_list) > 0:
        game_id = deleted_app_list.pop()

        output.print_msg(f"游戏:{game_id},剩余数量:{len(deleted_app_list)}")

        # 获取游戏信息
        try:
            game_data = steam.get_game_store_index(game_id)
        except crawler.CrawlerException as e:
            output.print_msg(e.http_error(f"游戏{game_id}"))
            continue
        if game_data["deleted"] is False:
            output.print_msg(f"游戏 {game_id} 不在已删除列表中")
            result_game_ids.append(game_id)

    output.print_msg(result_game_ids)
Beispiel #2
0
def main():
    # 获取登录状态
    steam_class = steam.Steam(need_login=False)

    # 已删除的游戏
    restricted_app_list = steam_class.load_restricted_app_list()

    output.print_msg(f"总共获取{len(restricted_app_list)}个已受限游戏")

    result_game_ids = []
    while len(restricted_app_list) > 0:
        game_id = restricted_app_list.pop()

        output.print_msg(f"游戏:{game_id},剩余数量:{len(restricted_app_list)}")

        # 获取游戏信息
        try:
            game_data = steam.get_game_store_index(game_id)
        except crawler.CrawlerException as e:
            output.print_msg(e.http_error(f"游戏{game_id}"))
            continue
        if game_data["error"]:
            output.print_msg(f"游戏 {game_id} 访问错误,{game_data['error']}")
            result_game_ids.append(game_id)
        elif game_data["restricted"] is False:
            output.print_msg(f"游戏 {game_id} 不在已受限列表中")
            result_game_ids.append(game_id)

    output.print_msg(result_game_ids)
    restricted_app_list = steam_class.load_restricted_app_list()
    for game_id in result_game_ids:
        restricted_app_list.remove(game_id)
    steam_class.save_restricted_app_list(restricted_app_list)
def main():
    # 获取登录状态
    steam_class = steam.Steam(need_login=False)

    # 已删除的游戏
    deleted_app_list = steam_class.load_deleted_app_list()

    try:
        banned_game_list = madjoki.get_banned_game_list()
    except crawler.CrawlerException as e:
        output.print_msg(e.http_error("已下线游戏列表"))
    else:
        output.print_msg(f"总共获取{len(banned_game_list)}个已删除游戏")

        banned_game_id_list = {}
        for game_info in banned_game_list:
            banned_game_id_list[str(game_info["game_id"])] = 1
        for game_id in deleted_app_list:
            if game_id not in banned_game_id_list:
                # 获取游戏信息
                try:
                    game_data = steam.get_game_store_index(game_id)
                except crawler.CrawlerException as e:
                    output.print_msg(e.http_error(f"游戏{game_id}"))
                    continue
                if game_data["deleted"] is False:
                    output.print_msg(f"游戏 {game_id} 不在已删除列表中")
Beispiel #4
0
def main():
    # 获取登录状态
    steam_class = steam.Steam(need_login=False)
    steam_class.format_cache_app_info()

    # 已删除的游戏
    deleted_app_list = steam_class.load_deleted_app_list()
    # 已资料受限制的游戏
    restricted_app_list = steam_class.load_restricted_app_list()

    output.print_msg(deleted_app_list + restricted_app_list)
Beispiel #5
0
def main():
    # 获取登录状态
    steam_class = steam.Steam(need_login=True)

    # 获取所有库存
    try:
        inventory_item_list = steam.get_account_inventory(
            steam_class.account_id)
    except crawler.CrawlerException as e:
        output.print_msg(e.http_error("库存"))
        raise
    badges_list = {}
    if CHECK_EXTRA_CARD:
        # 获取徽章等级
        try:
            badges_list = steam.get_account_badges(steam_class.account_id)
        except crawler.CrawlerException as e:
            output.print_msg(e.http_error("账号徽章列表"))
            raise
    for item_id, item_info in inventory_item_list.items():
        if item_info["type"] == steam.INVENTORY_ITEM_TYPE_PROFILE_BACKGROUND:
            if CHECK_DUPLICATE_BACKGROUND and item_info["count"] > 1:
                output.print_msg(item_info)
        elif item_info["type"] == steam.INVENTORY_ITEM_TYPE_EMOTICON:
            if CHECK_DUPLICATE_EMOTICON and item_info["count"] > 1:
                output.print_msg(item_info)
        elif item_info["type"] == steam.INVENTORY_ITEM_TYPE_TRADE_CARD:
            if CHECK_EXTRA_CARD:
                # 闪卡,跳过
                if item_info['name'].find("(Foil)") >= 0 or item_info[
                        'name'].find("(Foil Trading Card)") >= 0:
                    continue
                if item_info["game_id"] in badges_list:
                    badge_level = badges_list[item_info["game_id"]]
                else:
                    badge_level = 0
                # 如果剩余卡牌数量 + 当前徽章等级 > 5
                if item_info["count"] + badge_level > steam.MAX_BADGE_LEVEL:
                    output.print_msg(item_info)
Beispiel #6
0
def main():
    # 获取登录状态
    steam_class = steam.Steam(need_login=False)

    steamdb.SteamDb()

    # 已删除的游戏
    deleted_app_list = steam_class.load_deleted_app_list()

    try:
        banned_game_list = madjoki.get_banned_game_list()
    except crawler.CrawlerException as e:
        output.print_msg(e.http_error("已下线游戏列表"))
    else:
        output.print_msg(f"总共获取{len(banned_game_list)}个已删除游戏")

        for game_info in banned_game_list:
            if str(game_info["game_id"]) not in deleted_app_list:
                if str(game_info["game_id"]) in ["533120"]:
                    continue
                try:
                    steamdb_info = steamdb.get_game_store_index(
                        game_info["game_id"])
                except crawler.CrawlerException as e:
                    output.print_msg(e.http_error(f"游戏{game_info['game_id']}"))
                else:
                    deleted_app_list.append(str(game_info["game_id"]))
                    output.print_msg(
                        "\t".join(
                            list(
                                map(str, [
                                    game_info["game_id"],
                                    game_info["game_name"],
                                    steamdb_info["develop_name"]
                                ]))), False)

        steam_class.save_deleted_app_list(deleted_app_list)
def main():
    steam_class = steam.Steam(need_login=False)
    owned_game_list = steam.get_account_owned_app_list(steam_class.account_id)
    for game_id in owned_game_list:
        output.print_msg(f"开始解析游戏 {game_id}")
        astats.get_game_invalid_achievements(game_id)
def main():
    # 获取登录状态
    steam_class = steam.Steam(need_login=True)

    # 所有打折游戏
    discount_game_file_path = os.path.abspath(os.path.join(steam_class.cache_data_path, "discount.txt"))
    discount_game_list = tool.json_decode(file.read_file(discount_game_file_path), [])
    game_id_list = []
    for game_info in discount_game_list:
        if game_info["type"] == "game":
            game_id_list.append(game_info["app_id"])
        else:
            game_id_list += game_info["app_id"]
    # 已检测过的游戏列表
    checked_apps_file_path = os.path.join(steam_class.cache_data_path, "discount_checked.txt")
    checked_apps_string = file.read_file(checked_apps_file_path)
    if checked_apps_string:
        checked_apps_list = checked_apps_string.split(",")
    else:
        checked_apps_list = []
    # 已删除的游戏
    deleted_app_list = steam_class.load_deleted_app_list()
    # 已资料受限制的游戏
    restricted_app_list = steam_class.load_restricted_app_list()
    # 游戏的DLC列表
    game_dlc_list = steam_class.load_game_dlc_list()

    while len(game_id_list) > 0:
        game_id = game_id_list.pop()
        game_id = str(game_id)
        if game_id[-1:] != "0":
            continue
        if game_id in deleted_app_list or game_id in restricted_app_list:
            continue
        if game_id in checked_apps_list:
            continue

        output.print_msg(f"游戏:{game_id},剩余数量:{len(game_id_list)}")

        # 获取游戏信息
        try:
            game_data = steam.get_game_store_index(game_id)
        except crawler.CrawlerException as e:
            output.print_msg(e.http_error(f"游戏{game_id}"))
            continue

        if len(game_data["dlc_list"]) > 0:
            output.print_msg(f"游戏:{game_id}全部DLC:{game_data['dlc_list']}")
            is_change = False
            for dlc_id in game_data["dlc_list"]:
                if dlc_id not in game_dlc_list:
                    is_change = True
                    game_dlc_list[dlc_id] = game_id
            # 保存数据
            if is_change:
                steam_class.save_game_dlc_list(game_dlc_list)

        # 已资料受限制
        if game_data["restricted"]:
            output.print_msg(f"游戏:{game_id}已资料受限制")
            restricted_app_list.append(game_id)
            # 保存数据
            steam_class.save_restricted_app_list(restricted_app_list)

        # 增加检测标记
        checked_apps_list.append(game_id)
        file.write_file(",".join(checked_apps_list), checked_apps_file_path, file.WRITE_FILE_TYPE_REPLACE)
Beispiel #9
0
def main(check_game=True):
    # 获取登录状态
    steam_class = steam.Steam(need_login=True)

    # 历史记录
    apps_cache_data = steam_class.load_cache_apps_info()
    # 已检测过的游戏列表
    checked_apps_file_path = os.path.join(steam_class.cache_data_path,
                                          "review_checked.txt")
    checked_apps_string = file.read_file(checked_apps_file_path)
    if checked_apps_string:
        checked_apps_list = checked_apps_string.split(",")
    else:
        checked_apps_list = []
    # 已删除的游戏
    deleted_app_list = steam_class.load_deleted_app_list()
    # 已资料受限制的游戏
    restricted_app_list = steam_class.load_restricted_app_list()
    # 游戏的DLC列表
    game_dlc_list = steam_class.load_game_dlc_list()

    # 获取自己的全部玩过的游戏列表
    try:
        played_game_list = steam.get_account_owned_app_list(
            steam_class.account_id, True)
    except crawler.CrawlerException as e:
        output.print_msg(e.http_error("个人游戏主页"))
        raise

    if check_game:
        while len(played_game_list) > 0:
            game_id = played_game_list.pop()
            if game_id in deleted_app_list:
                continue
            if game_id in checked_apps_list:
                continue

            output.print_msg(f"开始解析游戏 {game_id},剩余数量:{len(played_game_list)}")

            # 获取游戏信息
            try:
                game_data = steam.get_game_store_index(game_id)
            except crawler.CrawlerException as e:
                output.print_msg(f"游戏 {game_id} 解析失败,原因:{e.message}")
                output.print_msg(e.http_error(f"游戏{game_id}"))
                continue

            is_change = False
            # 已删除
            if game_data["deleted"]:
                deleted_app_list.append(game_id)
                # 保存数据
                steam_class.save_deleted_app_list(deleted_app_list)
            else:
                # 有DLC的话,遍历每个DLC
                for dlc_id in game_data["dlc_list"]:
                    # 已经评测过了,跳过检查
                    if dlc_id in apps_cache_data["review_list"]:
                        continue

                    # DLC和游戏本体关系字典
                    if dlc_id not in game_dlc_list:
                        game_dlc_list[dlc_id] = game_id
                        is_change = True

                    # 获取DLC信息
                    try:
                        dlc_data = steam.get_game_store_index(dlc_id)
                    except crawler.CrawlerException as e:
                        output.print_msg(e.http_error(f"游戏{dlc_id}"))
                        continue

                    if dlc_data["owned"]:
                        # 已经评测过了
                        if dlc_data["reviewed"]:
                            # 从待评测列表中删除
                            if dlc_id in apps_cache_data["can_review_lists"]:
                                apps_cache_data["can_review_lists"].remove(
                                    dlc_id)
                            # 增加已评测记录
                            if dlc_id not in apps_cache_data["review_list"]:
                                apps_cache_data["review_list"].append(dlc_id)
                        # 新的可以评测游戏
                        else:
                            if dlc_id not in apps_cache_data[
                                    "can_review_lists"]:
                                apps_cache_data["can_review_lists"].append(
                                    dlc_id)

                # 已经评测过了
                if game_data["reviewed"]:
                    # 从待评测列表中删除
                    if game_id in apps_cache_data["can_review_lists"]:
                        apps_cache_data["can_review_lists"].remove(game_id)
                    # 增加已评测记录
                    if game_id not in apps_cache_data["review_list"]:
                        apps_cache_data["review_list"].append(game_id)
                # 新的可以评测游戏
                else:
                    if game_id not in apps_cache_data["can_review_lists"]:
                        apps_cache_data["can_review_lists"].append(game_id)

                if is_change:
                    steam_class.save_game_dlc_list(game_dlc_list)

                # 已资料受限制
                if game_data["restricted"]:
                    if game_id not in restricted_app_list:
                        restricted_app_list.append(game_id)
                        # 保存数据
                        steam_class.save_restricted_app_list(
                            restricted_app_list)

            # 增加检测标记
            steam_class.save_cache_apps_info(apps_cache_data)
            # 保存数据
            checked_apps_list.append(game_id)
            file.write_file(",".join(checked_apps_list),
                            checked_apps_file_path,
                            file.WRITE_FILE_TYPE_REPLACE)

    # 输出
    print_list(apps_cache_data, game_dlc_list)
def main():
    # 获取登录状态
    steam_class = steam.Steam(need_login=True)

    # 获取自己的全部游戏列表
    try:
        owned_game_list = steam.get_account_owned_app_list(steam_class.account_id)
    except crawler.CrawlerException as e:
        output.print_msg(e.http_error("个人游戏主页"))
        raise

    # 已检测过的游戏列表
    checked_apps_file_path = os.path.join(steam_class.cache_data_path, "checked.txt")
    checked_apps_string = file.read_file(checked_apps_file_path)
    if checked_apps_string:
        checked_apps_list = checked_apps_string.split(",")
    else:
        checked_apps_list = []
    # 已删除的游戏
    deleted_app_list = steam_class.load_deleted_app_list()
    # 已资料受限制的游戏
    restricted_app_list = steam_class.load_restricted_app_list()
    # 游戏的DLC列表
    game_dlc_list = steam_class.load_game_dlc_list()

    while len(owned_game_list) > 0:
        game_id = owned_game_list.pop()
        if game_id in checked_apps_list:
            continue

        output.print_msg(f"游戏: {game_id},剩余数量: {len(owned_game_list)}")
        # 获取游戏信息
        try:
            game_data = steam.get_game_store_index(game_id)
        except crawler.CrawlerException as e:
            output.print_msg(e.http_error(f"游戏 {game_id}"))
            raise

        # 已删除
        if game_data["deleted"]:
            output.print_msg(f"游戏 {game_id} 已删除")
            if game_id not in deleted_app_list:
                deleted_app_list.append(game_id)
                # 保存数据
                steam_class.save_deleted_app_list(deleted_app_list)
        else:
            # 受限制
            if game_data["restricted"]:
                output.print_msg(f"游戏 {game_id} 已受限制")
                if game_id not in restricted_app_list:
                    restricted_app_list.append(game_id)
                    # 保存数据
                    steam_class.save_restricted_app_list(restricted_app_list)
            # 所有的DLC
            if len(game_data["dlc_list"]) > 0:
                is_change = False
                for dlc_id in game_data["dlc_list"]:
                    output.print_msg(f"游戏 {game_id},DLC {dlc_id}")
                    if dlc_id not in game_dlc_list:
                        game_dlc_list[dlc_id] = game_id
                # 保存数据
                if is_change:
                    steam_class.save_game_dlc_list(game_dlc_list)

        checked_apps_list.append(game_id)
        file.write_file(",".join(checked_apps_list), checked_apps_file_path, file.WRITE_FILE_TYPE_REPLACE)
Beispiel #11
0
def main():
    global INCLUDE_GAME, INCLUDE_PACKAGE, INCLUDE_BUNDLE, SKIP_RESTRICTED_GAME
    global MIN_DISCOUNT_PERCENT, MAX_DISCOUNT_PERCENT, MAX_SELLING_PERCENT
    config = crawler.read_config(EXTRA_CONFIG_FILE_PATH)

    INCLUDE_GAME = crawler.analysis_config(
        config, "INCLUDE_GAME", True, crawler.CONFIG_ANALYSIS_MODE_BOOLEAN)
    INCLUDE_PACKAGE = crawler.analysis_config(
        config, "INCLUDE_PACKAGE", True, crawler.CONFIG_ANALYSIS_MODE_BOOLEAN)
    INCLUDE_BUNDLE = crawler.analysis_config(
        config, "INCLUDE_BUNDLE", True, crawler.CONFIG_ANALYSIS_MODE_BOOLEAN)
    SKIP_RESTRICTED_GAME = crawler.analysis_config(
        config, "SKIP_RESTRICTED_GAME", True,
        crawler.CONFIG_ANALYSIS_MODE_BOOLEAN)
    MIN_DISCOUNT_PERCENT = crawler.analysis_config(
        config, "MIN_DISCOUNT_PERCENT", 75,
        crawler.CONFIG_ANALYSIS_MODE_INTEGER)
    MAX_DISCOUNT_PERCENT = crawler.analysis_config(
        config, "MAX_DISCOUNT_PERCENT", 100,
        crawler.CONFIG_ANALYSIS_MODE_INTEGER)
    MAX_SELLING_PERCENT = crawler.analysis_config(
        config, "MAX_SELLING_PERCENT", 1, crawler.CONFIG_ANALYSIS_MODE_INTEGER)
    MIN_DISCOUNT_PERCENT = min(max(MIN_DISCOUNT_PERCENT, 1), 100)
    MAX_DISCOUNT_PERCENT = min(max(MAX_DISCOUNT_PERCENT, 1), 100)
    MAX_SELLING_PERCENT = max(MAX_SELLING_PERCENT, 1)

    # 获取登录状态
    steam_class = steam.Steam(need_login=True)
    cache_file_path = os.path.abspath(
        os.path.join(steam_class.cache_data_path, "discount.txt"))
    # 已资料受限制的游戏
    restricted_app_list = steam_class.load_restricted_app_list()
    # 游戏的DLC列表
    game_dlc_list = steam_class.load_game_dlc_list()

    # 从文件里获取打折列表
    discount_game_list = load_discount_list(cache_file_path)
    if not discount_game_list:
        # 调用API获取打折列表
        try:
            discount_game_list = steam.get_discount_game_list()
        except crawler.CrawlerException as e:
            output.print_msg(e.http_error("打折游戏"))
            raise
        # 将打折列表写入文件
        save_discount_list(cache_file_path, discount_game_list)
        output.print_msg("get discount game list from website")
    else:
        output.print_msg("get discount game list from cache file")
    # 获取自己的全部游戏列表
    try:
        owned_game_list = steam.get_account_owned_app_list(
            steam_class.account_id)
    except crawler.CrawlerException as e:
        output.print_msg(e.http_error("个人游戏主页"))
        raise
    for discount_info in discount_game_list:
        # 获取到的价格不大于0的跳过
        if discount_info["now_price"] <= 0 or discount_info["old_price"] <= 0:
            continue
        # 只显示当前价格或折扣小等于限制的那些游戏
        if discount_info[
                "now_price"] <= MAX_SELLING_PERCENT or MAX_DISCOUNT_PERCENT >= discount_info[
                    "discount"] >= MIN_DISCOUNT_PERCENT:
            # bundle 或者 package,都包含多个游戏
            if discount_info["type"] == "bundle" or discount_info[
                    "type"] == "package":
                # 是否不显示package
                if discount_info["type"] == "package" and not INCLUDE_PACKAGE:
                    continue
                # 是否不显示bundle
                if discount_info["type"] == "bundle" and not INCLUDE_BUNDLE:
                    continue
                is_all = True
                # 遍历包含的全部游戏,如果都有了,则跳过
                for app_id in discount_info["app_id"]:
                    if SKIP_RESTRICTED_GAME and app_id in restricted_app_list:
                        is_all = True
                        break
                    if app_id not in owned_game_list and app_id not in game_dlc_list:
                        is_all = False
                        # break
                if not is_all:
                    if discount_info["type"] == "bundle":
                        output.print_msg(
                            f"http://store.steampowered.com/bundle/{discount_info['id']}/ ,discount {discount_info['discount']}%%, old price: {discount_info['old_price']}, discount price: {discount_info['now_price']}",
                            False)
                    else:
                        output.print_msg(
                            f"http://store.steampowered.com/sub/{discount_info['id']}/ ,discount {discount_info['discount']}%%, old price: {discount_info['old_price']}, discount price: {discount_info['now_price']}",
                            False)
            else:
                if not INCLUDE_GAME:
                    continue
                if SKIP_RESTRICTED_GAME and discount_info[
                        "app_id"] in restricted_app_list:
                    continue
                if discount_info[
                        "app_id"] not in owned_game_list and discount_info[
                            "app_id"] not in game_dlc_list:
                    output.print_msg(
                        f"http://store.steampowered.com/app/{discount_info['id']}/ ,discount {discount_info['discount']}%%, old price: {discount_info['old_price']}, discount price: {discount_info['now_price']}",
                        False)