Closed cdytoby closed 3 years ago
I just used this to download from beastsaber as well, and noticed a similar gap in song count from the site (484), and what your code grabs (474). This gap appears to be very close to the page count.
cdytoby has just over 154 songs, and reported 3 missing (154 / 50 = 3.xxx) I have 484 songs and am missing 10. (484 / 50 = 9.xxxx)
I have to wonder if there is a bug in the API where it is only providing 49 songs per page, or if you are miscounting them by 1. My best guess is that you may have misaligned to an array size. It seems like an "off by 1" bug, which implies an array/loop miscount to me. I'd suggest looking at that aspect of the code.
Having an option for better debug logging, would probably quickly identify the cause. (debug doesn't shows more details regarding the beastsaber page scrapes)
The other possibility is that there are somehow duplicates in beastsaber, which doesn't seem likely, but could happen.
@cdytoby This may actually be a bug in BeastSaber's API. The song you listed isn't in the any of the pages in the API requests:
Any chance you can increase the debug logging for that SongFeedReader? (if it dumps out each song/url it sees) That would help. I think I found another missing song. https://bsaber.com/songs/7027/
I did a simple API check. The API seems to keep the results in order with the web view, no matter what (normally anyway). I could be wrong here.
If you compare my users profiles web view ( https://bsaber.com/songs/new/page/3/?bookmarked_by=qucpjeqphxf0chmt9bhc) from the api (as tested below), there is a difference in total results of 484 (web) vs 474 (API).
If you start looking at the specific results, you will uncover an issue with this song (https://bsaber.com/songs/7027/). This song doesn't appear in the API results. This is just an example that I can show. This issue may be totally random - no idea.
If you change the api result count from 50 to 20, my missing song shows up. It is a API bug. Some bad math with the result size. It isn't as simple as use 20 instead of 50, as I think "20" may have dropped a different song.
From the API, using "count by 50", it shorts me 10 songs compared to the web view. This "loss" varies based on the count value.
https://bsaber.com/wp-json/bsaber-api/songs/?bookmarked_by=qucpjeqphxf0chmt9bhc&page=2&count=50
It appears as #8 on this "count by 20" page (which implies overall song #49) https://bsaber.com/wp-json/bsaber-api/songs/?bookmarked_by=qucpjeqphxf0chmt9bhc&page=3&count=20
I want to inform you that I'm changing my playlist right now because I found some new songs. So now the list won't stay this way. For now the bug is not yet solved.
BTW I can't find the place to report beastsaber api issue except Discord channel. I'm very inactive there so I'll leave it to you. Thanks in advance.
There's a BeastSaber Discord server, the bug has already been reported. Hopefully it gets fixed soon.
I heard from the bsaber team, and this appears to be fixed now. @cdytoby You should test and verify, but it fixed my issue with the beatsyncconsole app.
The number matches the count in BeastSaber website, so I believe this is solved.
Thanks. I'll close the Ticket.
BeatSyncConsole 0.9.0
Playlist username: cdytoby
By checking this list: https://bsaber.com/songs/new/page/8/?bookmarked_by=cdytoby
![image](https://user-images.githubusercontent.com/15671368/92323996-a5968d80-f03d-11ea-859e-babfb856a586.png)
I know I have 154 songs (20 per page and 14 in the last page), but the console only read 151 items.
I can't find all the songs are missing, however, I can confirm this song is missing:
https://bsaber.com/songs/1e1/
Here is my BeatSync config: