Tools [Userscript] CyberDrop/Bunkr - Album Sorting and More [Updated: 2022-02-07]

Marcus

ʕ•ᴥ•ʔ
Mar 11, 2022
257
23,399
1,568
0fya082315al84db03fa9bf467e3.png
Reposting the userscript that I originally developed for CyberDrop, which I've now extended to support Bunkr (it's basically the same filehosting software for now).

Essentially all it does is add a few, relatively minor features to the homepage (where you upload stuff), such as:
  1. Album sorting: Albums are sorted alphabetically instead of "album creation date" (automatically).
  2. Album details: Adds a little "block" that shows you the full album name (for easy copy/paste), how many files are in the album and a link to the album.
    1. The album details section should automatically update whenever you switch albums.
    2. For newly created albums, the album details won't update. The easiest fix is to just click the refresh albums button (#3) and the details should update properly.
    3. Last updated- New as of April 6th, 2021. Adds another info box that displays "Last updated". Any change to the album (uploading new stuff, editing description etc.) will update that date/time.
      1. Keep in mind that it does not update instantly on new uploads, you will have to hit the "Refresh" button after uploading content for it to be reflected.
  3. Refresh albums button: Adds a button that allows you to refresh the details about your album (practically speaking it's like refreshing the page, but with slightly less delay).
Here's a screenshot of how the script modifies the CyberDrop homepage:
2021-04-06_Xo2Gc8.png


While it's developed with CyberDrop in mind, it may (or may not) work with other upload sites that use the same backend (Lolisafe). It seems to work fine with zz.ht too, but can't guarantee it will stay that way.
bunkrr.su has now been added as a default @match rule, therefore I will try my best to keep it compatible with Bunkr as well.

How to get this magic?

First you need to get a userscript manager for your web browser. There are a few alternatives, but I personally use
Please, Log in or Register to see links and images
(on Firefox). If you have something like
Please, Log in or Register to see links and images
instead, that should probably work fine, but I haven't tested.

Next, visit this GitHub Gist:
Please, Log in or Register to see links and images

Read the giant block of text that I've written at the top of the script (or don't, I'm not your mom), which contains a little bit of extra info and a few disclaimers.

If you're ready to install, click the "Raw" button top-right of the script. Or
Please, Log in or Register to see links and images

Your userscript manager should prompt you to install it.

Note: Keep in mind that auto-updates are enabled by default (at least in Violentmonkey).
You can disable that by going into your userscript manager, clicking "Edit" on the CyberDrop script and then unchecking "Allow update".
The settings page of the script will also allow you to add extra "@match" rules. In my case I've added zz.ht as well.
Screenshot:
2020-08-13_4z8aBr.png
 

Marcus

ʕ•ᴥ•ʔ
Mar 11, 2022
257
23,399
1,568
0fya082315al84db03fa9bf467e3.png
Changelog
  • v2.5.2 - 2022-03-12
    • Match rule: Now also works-by-default on bunkrr.su
  • v2.5.1 - 2022-02-07
    • Bugfix: Fixes the file count for newer instances (again - specifically Bunkr).
  • v2.5.0 - 2022-02-07
    • Bugfix: Fixed an issue on non-CyberDrop instances (specifically Bunkr), where only the first 25 albums were retrieved/sorted.
      • This would actually completely overwrite the album list, causing any album past #25 to not be listed.
  • v2.4.1 - 2021-04-10
    • Bugfix: Newly created albums would show "Last updated" as Jan 1st, 1970.
    • Feature: When albums are being fetched from the API via the script (e.g. by refreshing the albums using the button), it will now check for the homeDomain field.
      • The homeDomain field will then be used to point album URLs correctly, in the scenarios where an instance runs the upload page different from the album links (e.g. upload.example.com for uploading, but example.com for album pages).
  • v2.4.0 - 2021-04-06
    • Feature: Added another info box below the album name that displays the "Last updated" date & time.
      • As far as I understand, this covers any change to the album. Title/description editing, but also uploading new content.
      • It uses the browser's locale to generate a date/time text. In my case it looks like
        Please, Log in or Register to see links and images
  • v2.3.1 - 2020-12-15
    • Bugfix: Album privacy checkbox would be wrong if you did the following:
      • Toggle the checkbox (either on => off or the opposite)
      • Switch to a different album in the selection dropdown
      • Switch back to the previous album
      • Result: The previous album privacy status would still display and therefore not be correct.
  • v2.3.0 - 2020-11-06
    • Feature: Add a "Public album link" checkbox that updates the album privacy. Useful for those that initially upload to a private album, then make it public once all files are uploaded.
      • Keep in mind that if you try to "private" an album after it was already public after visiting the album URL, the album might still be cached and visible to the public via the same URL. It will not show up on CyberDrop's "explore" page anymore though.
  • v2.2.5 - 2020-09-22
    • Feature: Add a "Bypass album cache?" checkbox that modifies the "Link to album" URL by appending random numbers (between 1000 and 9999) at the end
      • Useful for when you're updating high-traffic albums and wanna link to a "fresh" album view.
    • Bugfix: The "album info" (file count, album name, album URL) used to "stick around" whenever you selected an invalid album (basically just the "Upload to album" option).
 
Last edited: