Maxx53 / SCMBot

Steam Community Market auto-buying bot
http://scmbot.com
GNU General Public License v2.0
237 stars 116 forks source link

Json is not valid error #100

Open Madaosan opened 10 years ago

Madaosan commented 10 years ago

Hi everyone, i recently discovered this amazing project, big props to maxx53.

So, i started using this yesterday and earlier today it was still working perfectly for me. But since an hour ago, i get nothing but "json is not valid" errors, and honestly i'm pretty bad with this stuff. Can someone explain me, what can be the reason for it? I tried logging out and back in, and i only search for 3 items at 2000ms to 3000ms delays each. Thanks in advance!

l4m0r commented 10 years ago

It's not working anymore after yesterdays steam market place update. See: https://github.com/Maxx53/SCMBot/issues/97

We need to wait for a new version.

Madaosan commented 10 years ago

Yeah, i saw that thread, but it was still working fine for me, like an hour ago, that's why it made me confused. do you also get the same error, or another one?

xdmate commented 10 years ago

http://steamcommunity.com/market/recent

Useful-Idiot66 commented 10 years ago

Was working fine for me up until a few hours ago. Odd.

wazerstar commented 10 years ago

I really doubt that it was "working" fine for you, there was as major update in code structure, you perhaps was able to scan with no problems but buying has been the issue all day long.

Where are you from?

Useful-Idiot66 commented 10 years ago

I've been using an older version, it was working just fine; it was scanning the way it should, and it also bought the way it should. I successfully scanned for and bought a cheap Orion USP very recently.

I live in 'murika in Arizona.

wazerstar commented 10 years ago

@Useful-Idiot66 Thing is you dont know what version you used, you used the the same as our at steam market web. I'm not talking about the SCM version I'm talking about the steam market code that was major updated. Which you cannot use an old version of, it changes on the fly, whenever the website gets updated you automatic get the latest changes. And therefor EVEN if you had old cache load of site you would not be able to buy because the moment the code was updated steam was down for around 5 mins while it rolled out, and therefore the old code/cache whatever you had was no longer valid.

Madaosan commented 10 years ago

@wazerstar Turkey, i wish i could provide you with some solid proof man. I don't know how, but it was still able to purchase a couple of things earlier today. A friend of mine said that pages are cached now and that's the reason, and looks like we have to add 3 params to those urls now, which are country, language and currency. Well, at least that's what he said.

Useful-Idiot66 commented 10 years ago

Well, I don't know why, but for whatever reason I was able to use it like I said. I guess it was a few hours more than I originally said, it was around 9-10 am PST. And for a few hours after that I was still able to scan just fine, but hadn't bought anything after the USP.

l4m0r commented 10 years ago

You were able to use it until steam rolled out the server/market place update for the servers in your region.

UgaBugaBoo commented 10 years ago

I got the community market update like about a month ago (Malaysia)

Maxx53 commented 10 years ago

One hint for new url format. Need add: ?country=XX&language=xxxxx&currency=x&count=xx For example: http://steamcommunity.com/market/recent?country=RU&language=russian&currency=5&count=10

UgaBugaBoo commented 10 years ago

^ This was helpful, however, I am no coder, so I do not know how to edit it. :(

dmarcuse commented 10 years ago

@Maxx53 for finding new URLs use Chrome or Chromium, open the JavaScript console (ctrl + shift + J) and then switch to the network tab. Leave it open and whenever the site accesses an external file, it will show up - great for tracking down item URLs, etc.

Madaosan commented 10 years ago

Yes, now it works, thanks for all the info guys! it was pretty simple actually :P

wazerstar commented 10 years ago

@apemanzilla Not really sure what you mean with that?

I compared my links i find manually easy with the method you said theres no difference, can you explain with an screenshot or something

Madaosan commented 10 years ago

@wazerstar i can try to help you, first go to community's market page, then open the js console. now switch to the network tab and check the first path, it should say something like ".../market/popular?country=xx&language=xx&currency=x&count=xx". now copy that phrase starting from "?country...", and then paste it to the end of your link. then voila, it works!

wazerstar commented 10 years ago

@Madaosan So what you are saying is that

if i add this string.

http://steamcommunity.com/market/listings/730/Operation%20Phoenix%20Weapon%20Case?country=EN&language=english&currency=1&count=10

then i should be able to buy?

It does not work for me.

Madaosan commented 10 years ago

@wazerstar Hmm, weird, it works for me. the string i'm using is "country=TR&language=english&currency=1&count=10" here, take a look : http://i.imgur.com/tdENQF6.jpg

wazerstar commented 10 years ago

Would you please try the item i linked and see what you get? please copy your direct line for that one you are searching on now... Did you try buy or are you only searching.

Madaosan commented 10 years ago

I already bought some things with it, and i also did what you said, it works for me. Where are you from, UK?

dmarcuse commented 10 years ago

@wazerstar the method I described allows you to see XHR links as well as hovering over them, so you can see more of the "behind the scenes" parts. Either works, I just find it easiest to use the network monitor.

l4m0r commented 10 years ago

Listing works but can you actually buy things with the right string?

Madaosan commented 10 years ago

@l4m0r Yes, you can. At least in my case.

l4m0r commented 10 years ago

Ok works for me too, I was just getting "Already purchased by another user" a lot - which seems to be normal for cases.

/edit: Any workaround for newly listed yet? Still gettting errors there :/

/edit²: String is now http://steamcommunity.com/market/recent?country=US&language=english&currency=1

But I think it's hardcoded, probably needs a new compile and fix in the source code.

UgaBugaBoo commented 10 years ago

@Madaosan Mate, I am not a software developer, so I can not really compile the source files, even do not know how to edit the links. Any tips for me ?

dmarcuse commented 10 years ago

@sabbir9985 learn C#?

UgaBugaBoo commented 10 years ago

@apemanzilla Legit help. Now can you please guide me where to edit the link ?

SoTD commented 10 years ago

Learn C#

UgaBugaBoo commented 10 years ago

@SoTD Yes yes, I was asking for guidance about the change in link.

SoTD commented 10 years ago

I changed the link myself after i learned C#.

UgaBugaBoo commented 10 years ago

@SoTD any reference for "learning" ?

l4m0r commented 10 years ago

public const string recentMarket = _market + "recent/";

UgaBugaBoo commented 10 years ago

@l4m0r TY very much. So basically I change that to "recent?country=US&language=english&currency=1"

l4m0r commented 10 years ago

Depends on the country and currency, those have to be right ofc. I just compiled and starting testing now.

/edit: Yes, it works =)

/edit²: Only issue I run into, when compiling the bot myself is, that the scaling/design is a bit off: http://s14.directupload.net/images/140614/u4o4a3nq.png

Anyone has an idea why?

UgaBugaBoo commented 10 years ago

@l4m0r I compiled it, I can now sell items from bakcpack, however I am facing this (http://i.imgur.com/g5LkLWX.jpg) problem.

l4m0r commented 10 years ago

Yes im having a similar problem, see above. Works on Windows 8.1, where I compiled it, but not on my server. Probably some compatibility problems/compiler settings that are needed and we are missing.

UgaBugaBoo commented 10 years ago

@l4m0r I can see the button when I maximize the window, how ever can't get it to work.

dmarcuse commented 10 years ago

@sabbir9985 I'm serious about learning C#. If you can't find the URL, download the repo and use the grep command (*nix systems only) or other system to search for strings formatted as URLs.

UgaBugaBoo commented 10 years ago

@apemanzilla Found it, changed it, compiled it. Now testing it

alberaviles commented 10 years ago

I've did all you say, I change the constant recentMarket with "recent?country=ES&language=spanish&currency=3&count=10" but it doesn't work, what can I do? I've used Java, C++, C... Not C# yet but... I think it must work... :/ And... of course, thanks to all who help us here, it's VERY good work maxx53! EDIT: If anyone upload here the files which changes? I think it's better

UgaBugaBoo commented 10 years ago

Getting this problem http://i.imgur.com/hlvvupP.jpg

Items with me wished price marked red and not purchasing.

l4m0r commented 10 years ago

"Even added "?country=US&language=english&currency=1&count=10" at the end of the item links."

That's enough for the Item page. You're using the wrong currency code then, probably.

alberaviles commented 10 years ago

@l4m0r I changed recentMarket, but it doesn't work... What can I do? :/

Useful-Idiot66 commented 10 years ago

I was able to make everything work fine just by adding "?country=US&language=english&currency=1&count=10" to the end of my links. Like l4m0r said, you're probably using the wrong currency code.

alberaviles commented 10 years ago

@Useful-Idiot66 of your links? What links? Only recentMarket or another one? About currency codes there are only 5, I think Spain is 3... "//1 for USD, 2 for GBP, 3 for EUR, 5 for RUB, 7 for BRL" But it doesn't work and I don't know why...

UgaBugaBoo commented 10 years ago

@l4m0r , @Useful-Idiot66 Well after you reply I realized the source code was actually made for RU, I am guessing I need the change the currency string.

I will report in after I test it.

Edit : My Recent string http://i.imgur.com/IitHKcz.jpg "recent?country=MY&language=english&currency=1&count=10", Even added "?country=MY&language=english&currency=1&count=10" at the end of the item links.

EDIT: The string I edited is : //Currency FIX //1 = USD, 2 = GBP, 3 = EUR, 5 = RUB const string buyReq = "sessionid={0}&currency={1}&subtotal={1}&fee={2}&total={3}"; Still getting the same error. http://i.imgur.com/hlvvupP.jpg

l4m0r commented 10 years ago

For Item page you don't need to change the source code at all.

Just use item links like this: http://steamcommunity.com/market/listings/730/Operation%20Phoenix%20Weapon%20Case?country=MY&language=english&currency=1&count=10

UgaBugaBoo commented 10 years ago

@l4m0r Well I tried the Binary provided by OP, It seems to be working, however, I am getting error Cookies may be disabled in your browser

Edit: I guess I will try the Steam Gaurd method and wait 7 days, importing cookies from browser not working.

Madaosan commented 10 years ago

@sabbir9985 Yeah, suddenly i started to get that error too. Geez, now i can't even login, it asks for a captcha everytime.

Edit: Nevermind, a simple reset did the work.