markcerqueira / ff-record-keeper Goto Github PK
View Code? Open in Web Editor NEWTools for Final Fantasy Record Keeper
Tools for Final Fantasy Record Keeper
Hi,
it's a helpful tool you've done, but when trying to make it works under linux ubuntu, I ran into this critical error as soon as it reached a step requiring to decode the JSON data :
/dff/battle/get_battle_init_data called
Traceback (most recent call last):
File "FFRKProxy.py", line 113, in
...
File "FFRKProxy.py", line 70, in handle_response
json_data = json.loads(flow.response.content)
File "/usr/lib/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Problem is, it seems that by default on linux, it doesn't check or default to utf, the data type needs to be explicit.
I used the solution given here for Windows :
https://www.reddit.com/r/FFRecordKeeper/comments/34p36e/how_to_peek_items_drops_in_windows/cqwyroo
by adding a .decode('utf-8-sig') to all json.loads(flow.response.content), and it worked perfectly
Could you add this as default, or in a less static way, reuse in the json.loads the charset data from the http response-headers ?
It would fix both the issue on Windows and on some, if not all, linux distribs
Any particular reason you are using Python 2.7 instead of Python 3? It sucks that I had to download an old version of Python for this :(
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.