#Help Please.

65 messages · Page 1 of 1 (latest)

ashen widget
#

i got this error when i try to run script ,, ( i downloaded that script from github )

slate cedar
#

it is command line tool it require arguments to be run so you can't run it from IDE using button (you can but that require some changes simpler is to run in terminal), you need type in terminal python script_name.py arg1 arg2 in a folder where this script is located

ashen widget
#

or its incorrect

slate cedar
#

minimum required is filename and linecount

ashen widget
#

so python3 updateAvatars.py filename linecount < like this? im noob at run commands

slate cedar
#

not literally file name but name of a file you want to process it needs to be in same folder or you need to give full or relative path to it and line count is some number check readme what it does

#

or try python3 updateAvatars.py -h maybe you get enough help, suspect -h is for help

ashen widget
#

and got this with -h

#

sorry

#

this

slate cedar
#

main project is csharp application, this updateAvatars is only helper script to work on db built by main program, so no point in running it if you didn't build db

ashen widget
#

so this script not collecting db as i understand

#

what i need to run to collect db? i created database with name and putted db info in app.config

#

so its not python project? i need to run that script with another app or ?

slate cedar
#

no its not python project is csharp project

#

and if you don't know what your doing you shouldn't touch it, you need steam API key for this

ashen widget
#

yes im attached api keys , i know for what this script

#

so i need to compile that project in .exe

#

right?

ashen widget
slate cedar
#

if you have .net sdks installed

ashen widget
slate cedar
#

you can do without but if you never work with c# it will be simpler from vs

ashen widget
slate cedar
#

It needs data base its written to use PostgreSQL so you need to install it locally (and configure) or give connection detail to one running somewhere else and set this project configuration giving it connection details

ashen widget
#

in that errors i see some npgsql

#

i searched it and this wat net data provider or somethink like that

#

i trying to install it just now

slate cedar
#

thats the name of csharp driver like psycopg2 for python

#

it is installed you have authentications failed error not library not found

#

you need edit app.config and give proper connection string

ashen widget
#

i trying to run directly from visual studio maybe from there he didnot get info from app.config? and i need to make .exe?

ashen widget
#

i think it was last error whan i need to fix , do you know what this errors mean?

slate cedar
#

Probably you get error response from steam API, or API was changed meantime this project was written. This is old and archived project.

ashen widget
#

its debug output

#

im using database collector ( another project ) and that seccond project is created in 2017 he is working fine

slate cedar
#

it couldn't parse JSON means server response didn't had JSON

ashen widget
#

and this project was created in 2020 as i see

ashen widget
slate cedar
#

you send request to steam and steam send back response, if its correct request you get some JSON back if its not you get error message from steam and as its not in JSON format JSON parser will throw error

#

you can have invalid API keys (or you didn't configure them), API could change and current request is send to wrong endpoint, this API could be blocked for those who have not enough privileges now, etc. pepeshrug

ashen widget
#

yeap i know i created api keys in steam i make it first in first step 🥹 but nothing.

#

i have seccond project but he is fully in python , and have some errors (python errors) when i run it , he adding users in db but spaming errors in command shell

#

i will be chose full python project because there i have 1gb/s ethernet but i have only that problem , maybe fix of this is easy than that shit project wait i will give screenshot

ashen widget
#

its seccond project writted 100% in python

slate cedar
#

same problem with parsing something that is not JSON as JSON

#

print what you get before you try to parse JSON

ashen widget
#
import threading
import time
from queue import Queue
import argparse
import traceback
from helpers import Database, Listing, get_player_summaries


# set range for steamids to fetch (you can create new account to find last id)
try:
    with open('.steamidcount', 'r', encoding='utf-8') as f:
        STEAMIDS_START = int(f.read())
except Exception:
    STEAMIDS_START = 76561199138448097
STEAMIDS_END = 76561199386314316


def worker(queue):
    global request_count
    db = Database()
    while True:
        steamids = queue.get()
        try:
            summaries = get_player_summaries(steamids, timeout=30)
            db.insert_profiles(summaries)
            request_count += 1
        except:
            traceback.print_exc()

def feed(queue):
    for i in range(STEAMIDS_START, STEAMIDS_END, 100):
        queue.put([k for k in range(i, i+100)])
        with open('.steamidcount', 'w+') as f:
            f.write(str(i))
        while queue.qsize() > 10000:
            time.sleep(0.001)


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("-t", "--threadCount", type=int, default=5)

    args = parser.parse_args()

    queue = Queue()
    request_count = 0
    threading.Thread(target=feed, args=(queue,)).start()

    for _ in range(args.threadCount):
        threading.Thread(target=worker, args=(queue,)).start()

    while True:
        print(f"{request_count} request")
        request_count = 0
        time.sleep(60)
#

here is full py script

ashen widget
slate cedar
#

you try get JSON from response without checking if you get JSON in response, you don't get JSON so you get error, first check if response from steam is not error response

ashen widget
#

and anomaly thinks is this script working where i have 500-700kb/s internet , and didnot working where i have 10mb/s and 1gb/s

slate cedar
#

probably you get temp banned cos of sending too much requests on faster connection

ashen widget
#

no account is alive also i can use that api in 500-700kbs internet , i think it too and checked instantly

#

i tried with another vm too i have vm in digitalocean