API is returning favorites sorted by their ID, not added date (again)Posted on: 02/12/24 12:12AM
Seen this weird behavior before (
gelbooru.com/index.php?page=forum&s=view&id=6614), and it's back again. Quite simply:
curl "
gelbooru.com:443/index.ph...mit=10&pid=2329"{"@attributes":{"limit":10,"offset":23290,"count":23296},"favorite":[{"id":278465889,"user_id":17627,"favorite":9291665,"added":1707675353},{"id":278465890,"user_id":17627,"favorite":9318569,"added":1707675353},{"id":278465891,"user_id":17627,"favorite":9321469,"added":1707675354},{"id":278465893,"user_id":17627,"favorite":9321471,"added":1707675354},{"id":278465896,"user_id":17627,"favorite":9327161,"added":1707675354},{"id":278465972,"user_id":17627,"favorite":9327654,"added":1707675384},{"id":278465973,"user_id":17627,"favorite":9327655,"added":1707675385},{"id":278465974,"user_id":17627,"favorite":9327656,"added":1707675385},{"id":278465975,"user_id":17627,"favorite":9327764,"added":1707675385},{"id":278465976,"user_id":17627,"favorite":9341259,"added":1707675385}]}
Note that these favorite IDs are strictly increasing. Compare this to the last ten ids shown on my "recent favorites" page:
9515291,9521307,9521308,9558893,9565397,9417624,9430335,9454715,9490226,9397010
Which is a clearly different set. FWIW, starting with an offset of zero starts at the "bottom" of my favorites by ID, and not favorited time as shown on my favorites page.
This is an issue, as it prevents gallery-dl (or anything else really) from downloading only the recent additions; if I want to be sure I got everything then I have to check the entire favorites list, which is a few hundred API calls needlessly.