Nickwasused / FreeGamesonSteam

Searching SteamDB for Free Games and Activating them using ArchiSteamFarm
Mozilla Public License 2.0
28 stars 5 forks source link

[BUG] Systemctl Status claims config is broken #39

Closed MayhemBill closed 3 years ago

MayhemBill commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Fill out Config file
  2. execute service
  3. run systemctl status steambot.service
  4. See error Your config seems to be broken! with no other context.

Expected behavior A clear and concise description of what you expected to happen. it just works:tm: Please complete the following information:

Additional context

MayhemBill commented 3 years ago

Also adding that status also returns Not Using Proxy Servers alongside the config message

MayhemBill commented 3 years ago
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Nickwasused

class config:
    # Config /Example for Bot (asf) bot_names = ["asf"]
    # !Important please change the Settings here!
    bots = ['{"name": "Bot name 1", "steamid": "ID"}, {"name": "Bot name 2", "steamid": "ID2"}']

    # e.g multiple bots
    # bots = ['{"name": "YOUR_BOT_NAME", "steamid": "YOUR_STEAM_ID_64"}, {"name": "YOUR_BOT_NAME_2", "steamid": "YOUR_STEAM_ID_64_2"}']

    boturl = 'http://127.0.0.1:1242/Api/Command/'
    botip = '127.0.0.1'
    boturl = 'http://localhost:1242/Api/Command/'

    # Log Default: true
    log = 'true'
    # Logfile Default: freegames-log
    logfile = 'freegames.log'
    # Proxys are disabled by default
    proxy = 'disabled'
    # Timeout for redeeming Keys: Default 2 Seconds
    timeout = 2

    #You dont need to change things here:
    links = ['https://steamdb.info/sales/?min_discount=95&min_rating=0', 'https://steamdb.info/upcoming/free/#live-promotions']
    basesteam = 'https://store.steampowered.com/app/'

    def getsteamapilink(self, steamid):
        steam_api_key = "APIKEY"
        if (steam_api_key == "YOUR_STEAM_API_KEY"):
            return "https://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key={}&steamid={}&format=json".format(steam_api_key, steamid)

    # You can change the User Agent here:
    # Default: Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail appname/appversion
    headers = {
        'User-Agent': 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail appname/appversion'
    }

Config for context with info removed.

Nickwasused commented 3 years ago

Please try again with: https://github.com/Nickwasused/FreeGamesonSteam/releases/tag/master.150 Now there is an output for the error. For example "Your config seems to be broken: Expecting ',' delimiter: line 1 column 56 (char 55)".

MayhemBill commented 3 years ago

using that, it gives me Your config seems to be broken: Extra data: line 1 column 51 (char 50) but it doesn't go that far. line 1 only has 23 chars.

attached the updated config.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Nickwasused

class config:
    # Config /Example for Bot (asf) bot_names = ["asf"]
    # !Important please change the Settings here!
    bots = ['{"name": "name", "steamid": "ID"},{"name": "name2", "steamid":"ID2"}']

    # e.g multiple bots
    # bots = ['{"name": "YOUR_BOT_NAME", "steamid": "YOUR_STEAM_ID_64"}, {"name": "YOUR_BOT_NAME_2", "steamid": "YOUR_STEAM_ID_64_2"}']

    boturl = 'http://127.0.0.1:1242/Api/Command/'
    botip = '127.0.0.1'
    boturl = 'http://localhost:1242/Api/Command/'

    # Log Default: true
    log = 'true'
    # Logfile Default: freegames-log
    logfile = 'freegames.log'
    # Proxys are disabled by default
    proxy = 'disabled'
    # Timeout for redeeming Keys: Default 2 Seconds
    timeout = 2

    #You dont need to change things here:
    links = ['https://steamdb.info/sales/?min_discount=95&min_rating=0', 'https://steamdb.info/upcoming/free/#live-promotions']
    basesteam = 'https://store.steampowered.com/app/'

    def getsteamapilink(self, steamid):
        steam_api_key = "APIKEY"
        if (steam_api_key == "YOUR_STEAM_API_KEY"):
            print("Please edit the Config file!")
            return
        return "https://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key={}&steamid={}&format=json".format(steam_api_key, steamid)

    # You can change the User Agent here:
    # Default: Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail appname/appversion
    headers = {
        'User-Agent': 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail appname/appversion'
    }
Nickwasused commented 3 years ago

Should be fixed with: https://github.com/Nickwasused/FreeGamesonSteam/releases/tag/master.152

MayhemBill commented 3 years ago

Okay I can confirm this fixed the issue, but now it is saying that "There are no IDs in the list" are these game appIDs, if so are they pulled automatically or do I need to populate a list file somewhere?

Nickwasused commented 3 years ago

The games are pulled from here: https://steamdb.info/sales/?min_discount=95&min_rating=0 https://steamdb.info/upcoming/free/#live-promotions

The type of ids mentioned is Steam App ids. They should be pulled automatically but I noticed the following today (See yellow text): firefox_zraJG0ROEx

This is going to be another problem. Please see #41 for that. If there is anything else for this Issue please reopen it.