Lost-MSth / Arcaea-server

一个微型的 Arcaea 本地服务器 A small local server for Arcaea
MIT License
358 stars 53 forks source link

Downloading files from server #128

Closed MrTerr1riym closed 1 year ago

MrTerr1riym commented 1 year ago

I have a question can you make it possible to download files not only base.ogg and 3.ogg , but also files 0.ogg , 1.ogg , 2.ogg ?

Also I have encountered a little inconvenience in the form of downloading all the packs For example, I bought only the pack "example" and I click on Download all in the main menu and for some reason I have downloaded all the packs at once, even those that I did not buy and this is strange because if you do not buy packs and click on Download all then download only open beyond charts

I also have a problem that after downloading songs through Download all I crash the game Also if I download all files and try to click Download all again crash In theory it could be because the apk doesn't contain all the song folders how on the server, but it's still unpleasant. Here's what the console shows [2023-09-06 19:17:30,348] INFO in _internal: 0.0.0.0 - - [06/Sep/2023 19:17:30] "GET /join/23/serve/download/me/song?url=true HTTP/1.1" 200 -

Lost-MSth commented 1 year ago
  1. Nope. Only 3.ogg and base.ogg can be downloaded, which is controlled by the client.
  2. (Maybe I misunderstand your question.) At present, the server cannot get the detailed information of packs. So all files can be downloaded whether the user has bought packs or not.
  3. The server cannot know what the client has. So you can put the songlist file in songs folder to restrict which songs should be served.
MrTerr1riym commented 1 year ago
  1. Is it possible to make an add-on for the server? For example, that in songlist it is possible to specify also packs at will and that when clicking on Download all in .db it is checked what packs the player has and what songs can be downloaded
Lost-MSth commented 1 year ago

Emmmm... Yes, it is possible.

MrTerr1riym commented 1 year ago

I updated the files and now it constantly writes that the db version is wrong It creates an empty db with no data After rolling back the files the error disappeared

Console: root@61352:~/v2.11.2# python3 main.py [2023-09-10 14:42:32,712] INFO in init: Start to initialize song data... [2023-09-10 14:42:34,241] INFO in init: Complete! [2023-09-10 14:42:34,242] WARNING in init: Maybe the file ./database/arcaea_database.db is an old version. [2023-09-10 14:42:34,242] INFO in init: Try to update the file ./database/arcaea_database.db. [2023-09-10 14:42:34,429] ERROR in sql: ['Traceback (most recent call last):\n', ' File "/root/v2.11.2/core/init.py", line 151, in init\n self.item_init()\n', ' File "/root/v2.11.2/core/init.py", line 97, in item_init\n self.insert_purchase_item(load(f))\n', ' File "/usr/lib/python3.10/json/init.py", line 293, in load\n return loads(fp.read(),\n', ' File "/usr/lib/python3.10/json/init.py", line 346, in loads\n return _default_decoder.decode(s)\n', ' File "/usr/lib/python3.10/json/decoder.py", line 340, in decode\n raise JSONDecodeError("Extra data", s, end)\n', 'json.decoder.JSONDecodeError: Extra data: line 722 column 3 (char 12172)\n'] [2023-09-10 14:42:34,439] INFO in init: Success to update the file ./database/arcaea_database.db.

Lost-MSth commented 1 year ago

When updating the database, it will import the pack info.

Your packs.json has incorrect format. Please check it by any JSON checker.

MrTerr1riym commented 1 year ago

I tried downloading the files from 2.11.2 and uploading to myself, but alas, still an error

[2023-09-10 17:28:53,750] INFO in init: Start to initialize song data... [2023-09-10 17:28:53,750] ERROR in init: Traceback (most recent call last): File "/root/v2.11.2/core/init.py", line 313, in check_song_file DownloadList.initialize_cache() File "/root/v2.11.2/core/download.py", line 235, in initialize_cache SonglistParser() File "/root/v2.11.2/core/download.py", line 49, in init self.parse() File "/root/v2.11.2/core/download.py", line 130, in parse self.data = loads(f.read()).get('songs', []) File "/usr/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.10/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 28 column 1 (char 597) [2023-09-10 17:28:53,751] WARNING in init: Initialization error! [2023-09-10 17:28:53,752] ERROR in main: Some errors occurred. The server will not run. Press ENTER key to exit.

Lost-MSth commented 1 year ago

It is due to songlist file this time, which format is not correct.

MrTerr1riym commented 1 year ago

Got it, thanks u:) I had to remove { "ratingClass": 0, "rating": 3 }, { { "ratingClass": 1, "rating": 6 }, { "ratingClass": 2, "rating": 7 },

MrTerr1riym commented 1 year ago

For some reason only beyond is downloaded ignoring base.ogg , 3.ogg and 0-2.aff I don't know how to specify ogg, but I specified ratingclass 0,1,2

Lost-MSth commented 1 year ago

Well, the songs in free pack can only have the beyond chart downloaded.

Is this your mean?

MrTerr1riym commented 1 year ago

I'm trying to download a different song from outside the base pack

Lost-MSth commented 1 year ago

So... I don't know what the problem is. Just using the songlist from the client is ok. Is there anything that doesn't meet expectations?

MrTerr1riym commented 1 year ago

It's best not to take songlist from the arcaea

[2023-09-11 14:40:02,610] INFO in init: Start to initialize song data... [2023-09-11 14:40:02,614] ERROR in init: Traceback (most recent call last): File "/root/v2.11.2/core/init.py", line 313, in check_song_file DownloadList.initialize_cache() File "/root/v2.11.2/core/download.py", line 235, in initialize_cache SonglistParser() File "/root/v2.11.2/core/download.py", line 49, in init self.parse() File "/root/v2.11.2/core/download.py", line 130, in parse self.data = loads(f.read()).get('songs', []) File "/usr/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.10/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 22 column 8 (char 514)

[2023-09-11 14:40:02,614] WARNING in init: Initialization error! [2023-09-11 14:40:02,615] ERROR in main: Some errors occurred. The server will not run. Press ENTER key to exit.

Lost-MSth commented 1 year ago

As I said before, songlist has an improper format. Check the line 22 in terms of the error message.

If the client can parse this file, maybe the encoding of the file is not utf-8.

MrTerr1riym commented 1 year ago

Uh, okay, it's hard to figure out, so I guess I won't be using this function Thank you for listening to me