Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History cannot get LastSales for items with apostrophes #14

Open
Cfomodz opened this issue Jan 23, 2024 · 1 comment
Open

History cannot get LastSales for items with apostrophes #14

Cfomodz opened this issue Jan 23, 2024 · 1 comment

Comments

@Cfomodz
Copy link
Contributor

Cfomodz commented Jan 23, 2024

image

2024-01-22 20:51:50.377 | DEBUG    | modules.skinbase:filter_skins:63 - Game: Games.RUST. Get history for Black Beenie Hat
2024-01-22 20:51:50.377 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=Black+Beenie+Hat
2024-01-22 20:51:50.515 | DEBUG    | modules.skinbase:filter_skins:72 - Avg price: 0.07
2024-01-22 20:51:50.515 | DEBUG    | modules.skinbase:filter_skins:63 - Game: Games.RUST. Get history for Black Hoodie
2024-01-22 20:51:50.516 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=Black+Hoodie
2024-01-22 20:51:50.653 | DEBUG    | modules.skinbase:filter_skins:72 - Avg price: 0.25
2024-01-22 20:51:50.654 | DEBUG    | modules.skinbase:filter_skins:63 - Game: Games.RUST. Get history for Black Mamba
2024-01-22 20:51:50.654 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=Black+Mamba
2024-01-22 20:51:50.815 | DEBUG    | modules.skinbase:filter_skins:63 - Game: Games.RUST. Get history for Blacksmith's Door
2024-01-22 20:51:50.816 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=Blacksmith%27s+Door
2024-01-22 20:51:50.986 | ERROR    | modules.skinbase:filter_skins:89 - Exception in skinbasecan only concatenate str (not "type") to str
2024-01-22 20:51:50.986 | ERROR    | modules.skinbase:filter_skins:89 - Exception in skinbasecan only concatenate str (not "type") to str
2024-01-22 20:51:50.987 | DEBUG    | modules.skinbase:filter_skins:63 - Game: Games.RUST. Get history for Blacksmith's Hatchet
2024-01-22 20:51:50.988 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=Blacksmith%27s+Hatchet
2024-01-22 20:51:51.156 | ERROR    | modules.skinbase:filter_skins:89 - Exception in skinbasecan only concatenate str (not "type") to str
2024-01-22 20:51:51.156 | ERROR    | modules.skinbase:filter_skins:89 - Exception in skinbasecan only concatenate str (not "type") to str

Testing tens of thousands of items and this is the only error among them (as far as history is concerned)

PS The skin DB takes around 1 min per 1k offers you pull from Dmarket, so don't be surprised when the DB takes an hour to create the base the first time if you don't minimize the config params to optimize for testing (a span of a few cents usually does fine).

@ballkicker18
Copy link

Just add this to string_to_sign in generate_headers() - str(furl(string_to_sign).add(params)).replace("%27", "'").replace("%28", "(").replace("%29", ")"). As I understand it, the characters ' () should not be replaced in the signature line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants