[Userscript] semi-Automated Derpibooru Uploader

stsyn
Lunar Supporter - Helped forge New Lunar Republic's freedom in the face of the Solar Empire's oppressive tyrannical regime (April Fools 2023).
Elements of Harmony - Had an OC in the 2022 Community Collab
Non-Fungible Trixie -
Twinkling Balloon - Took part in the 2021 community collab.
Notoriously Divine Tagger - Consistently uploads images above and beyond the minimum tag requirements. And/or additionally, bringing over the original description from the source if the image has one. Does NOT apply to the uploader adding several to a dozen tags after originally uploading with minimum to bare tagging.
Best Artist - Providing quality, Derpibooru-exclusive artwork
Fine Arts - Two hundred uploads with a score of over a hundred (Safe/Suggestive)
Economist -
Cool Crow - "Caw!" An awesome tagger
The Power of Love - Given to a publicly verified artist with an image under their artist’s tag that has reached 1000 upvotes

Moderator
@Background Pony #0E61
Yeup, provided as fallbacks.
Wix has history for cutting out some ways of getting full versions (like, intermediary does not work for modern images, and there was possible to recreate working old download link without knowing original file name)
Background Pony #0E61
0) In YDB-ADUp-DeviantArt.user.js, if I’m not mistaken, const leak and const o are not used for anything?
1) In YDB-ADUp-DeviantArt.user.js, target3 = document.createElement('div' + SPAD); looks like it was meant to be target3 = createElement('div' + SPAD); - it’s just creating a <div._2rl2o> instead of <div class="._2rl2o">, not using the function from your library
2) In libs/ADUp-mini.js you filter descriptions with .replace(/\n\s*\n/g, '\n').replace(/^\s*/mg, ''); - double line breaks if the line contains only whitespace are condensed to a single line break, and removes stretches of whitespace characters at the start of lines. Those can be part of the formatting - I’d say either do not filter the message, or filter only trailing whitepsace: .replace(/[^\S\n]+\n/mg, '\n')
(I am making my own modification to the dA script to get descriptions and had to also modify ADUp-mini to change only that line)
3) In YDB-ADUp-DeviantArt.user.js, I don’t think you have to re-fetch the dA page when it’s the initial load (haven’t navigated to a different image) - you can just do the match on document.body.innerHTML or on the script tags within the body, which is slightly more performant (eg. [...document.body.getElementsByTagName('script')].map(s => s.innerHTML).join())
3.5) You can get the artist from that JSON too, instead of querySelector: content['@@entities'].user[deviation.author].username.toLowerCase()
4) I wish there were lighter-weight substitutes for ADUp and YouBooru:Settings that only had what’s needed to auto-fill upload fields, not the rest like diffs (when is that even used?) and everything else.
stsyn
Lunar Supporter - Helped forge New Lunar Republic's freedom in the face of the Solar Empire's oppressive tyrannical regime (April Fools 2023).
Elements of Harmony - Had an OC in the 2022 Community Collab
Non-Fungible Trixie -
Twinkling Balloon - Took part in the 2021 community collab.
Notoriously Divine Tagger - Consistently uploads images above and beyond the minimum tag requirements. And/or additionally, bringing over the original description from the source if the image has one. Does NOT apply to the uploader adding several to a dozen tags after originally uploading with minimum to bare tagging.
Best Artist - Providing quality, Derpibooru-exclusive artwork
Fine Arts - Two hundred uploads with a score of over a hundred (Safe/Suggestive)
Economist -
Cool Crow - "Caw!" An awesome tagger
The Power of Love - Given to a publicly verified artist with an image under their artist’s tag that has reached 1000 upvotes

Moderator
I wish there were lighter-weight substitutes for ADUp and YouBooru:Settings that only had what’s needed to auto-fill upload fields, not the rest like diffs (when is that even used?) and everything else.
I want to rewrite YDB:S and rest of the old stuff for… probably 3 or 4 years, but I either don’t have enough time/ideas to make proper realization :c
Common part of ADUp should be rather small, it’s just used to have ability of selecting already uploaded image (not only reverse search, but “upload copy” on the image itself) and prefill fields with its content. So here diff could be used to actually see a difference between uploaded and new version. It was also used with old personal script for reuploading thread, while suggested format was still in use (it just crafts link to upload image page with additional “replace” button, where you could see difference in files, dimensions and even fix tags), but it’s just not actual now.
Will fix rest asap, thanks for reporting.
Interested in advertising on Derpibooru? Click here for information!
Bring the Dawn - A new Fantasy novel, now available!

Derpibooru costs over $25 a day to operate - help support us financially!

Syntax quick reference: **bold** *italic* ||hide text|| `code` __underline__ ~~strike~~ ^sup^ %sub%

Detailed syntax guide