-
Notifications
You must be signed in to change notification settings - Fork 88
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
ss: cannot parse response: "invalid character 'F' looking for beginning of value #251
Comments
I have a similar problem:
|
The underlying issue is that ScreenScraper's errors are returned with a 200 OK code so I'm attempting to parse the response as json. I wrote several things to try and capture the errors at the time and handle them but as the error messages change or new ones are added, you get these responses. Another issue is the json is typically built using php and string concatenation so there have been several issues of things not being properly escaped or being invalid json.
I won't make any promises but maybe I'll add a flag or something so that these errors print the entire response so you can at least see why it is happening, then we can determine if we need to do something to better handle them. |
I think if there was any way to capture viable error output at least you could bake in an exclusion based on the error ... that being said you may have nailed the caveat ... they would have to either be pretty static or have something/things exactly the same in each return to properly identify it. I waited a day or two and everything completed with no issues so I either got screens of this error, or successful completion. @sselph very much appreciate you taking a look |
For reference, in case someone gets to it before me, the relevant code is here https://github.com/sselph/scraper/blob/master/ss/ss.go#L366 |
Currently the api gives this error after the json string: Do you think this is the cause scraper could not parse the json response? |
Exactly. That would be the issue. It attempts to parse the json and sees '<' which is not valid. But in reality that should not be returning 200 OK and would've been caught earlier in my code. I may print the entire error (or a truncated version) on those unknowns so it is more clear to users what happened. In your case, that looks like an error in the php code that is used to generate the json so there is an error message included with the other json data. |
Is there a simple posibility to cut of the response after the valid json part? |
Same here. |
I am seeing this error today. I see the issue report is still open but wanted to confirm this is still the issue. I've noted that running the scrapper on four ROMS several times today it did complete successfully once. All of the other attempts failed with the reported error. Edit: I've run several test scrapes with the same 4 ROMs today and have not had this error at all. I found some threads reporting this issue might be related to ss server load. |
Same here. It started parsing roms all right, parsed through all MAME roms, but when it started parsing GBA i started receiving this error and got the same with all GBA, NDS, PSX, SNES and PSP roms ive got.
|
www.screenscraper.fr/api/jeuInfos.php appears to returning "File not found" which scraper is trying to parse as json.
I'm not sure you're actually checking the return code currently. I've submitted a PR to fix this: #261 The better question though is why ScreenScraper is returning a 404 |
It looks like maybe api2 is up but api is down. Requests to api2 work, but the response format is different: name and synopsis are arrays for different languages. |
I am also getting: Is there anything we can do about it? I cannot scrape anything for such classics as Mario Bros or Sonic the Hedgehog... |
@michalbilinski -- I've had this issue too last time I tried to use it -- I ended up moving on, because as far as I know this scraper has just been completely broken for like 3+ years. 🤷🏻♂️ |
Getting it for every parsing attempting using this scraper against ScreenScraper. Darn, works fine with SkyScraper. I prefer sselph but preference be ****ed if it hasn't worked for over a year. |
Ok so I've seen a few posts regarding similar messages but can't seem to see how to rectify this. I was running a scrape with ss credentials and it was going fine then all of a sudden I started seeing that error:
ss: cannot parse response: "invalid character 'F' looking for beginning of value
I removed my credentials from the scraper.sh script and tried again and it processed fine ... for a little while then the errors started again. I dropped everything for a bit and tried again with credentials and same thing ... worked for a little while and then started seeing the same error. When there's a "hash not found" it processes really quick but these invalid character errors take forever to get through. I'm wondering if they've implemented something to restrict # of scrapes from even registered accounts and the code isn't understanding the response?
The text was updated successfully, but these errors were encountered: