rithik-b / PlaylistManager

Playlist loading and organization mod for Beat Saber.
GNU General Public License v3.0
101 stars 25 forks source link

Fallback to key for changed hashes #62

Closed Beinsezii closed 7 months ago

Beinsezii commented 1 year ago

Download Missing Songs seems to instantly fail if a song's hash doesn't exist anymore. I feel it should try to fetch a new hash via the key before giving up, as BeatSaverUpdater can't update a song that hasn't been downloaded yet.

rithik-b commented 1 year ago

The decision was made before because by specifying a hash you could download an older version of a map on BeatSaver and they would store older maps, is that not allowed anymore

Beinsezii commented 1 year ago

Interestingly I can to retrieve the old versions from cdn.beatsaver.com in my browser without issue, same way playlistmanager seems to https://github.com/rithik-b/PlaylistManager/blob/23ba3e7d811a8c80f4edb50e5f4e52e8ec0e87c2/PlaylistManager/Downloaders/PlaylistSequentialDownloader.cs#L335

Still, 30 or so songs don't download properly in-game. Examples

{
    "key": "a697",
    "hash": "d2b726cf95eade5d1faddc957e1ef954b44f353b",
    "name": "[Noodle Touhou] IOSYS - Queen Of Silence",
    "uploader": "aaltopahwi"
},
{
    "key": "28c66",
    "hash": "94d442202c5cee95ae63515dac7e44bd83801758",
    "name": "[Chroma] David Taylor - Love Like Tequila (LIZOT Remix)",
    "uploader": "Alice"
},

I've manually downloaded a handful from beatsaver and noticed they all had different listed hashes from what was specified in the .bplist files, which led me to believe it was the problem.

Also looks like querying by https://api.beatsaver.com/maps/hash/ always returns the latest version for "downloadURL" regardless of what hash you put in. Not sure if that affects anything.

My beatsaver and c# knowledge is thin so let me know if there's anything else I should test.

Update: ModAssistant's Playlist Downloader fails on the same tracks. Can't find a logfile, UI just says "Fail".

Beinsezii commented 1 year ago

Made a playlist where all but the first song fail to download. borken.txt

rithik-b commented 1 year ago

So I'm pretty sure BeatSaver api always returns the link for the latest but for people who specifically want older versions in the playlist (accsaber tech playlist is one of them) they requested me to modify the url in the api to use the hash in the playlist instead. Pretty weird it doesn't work anymore though, I'll take a look at what you sent