[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.
Background Pony #0E61
ADUp-mini broke from the changes that came with multi-sources.
objects.imageSource = document.getElementById('image_source_url'); could become objects.imageSource = document.getElementById('image_sources_0_source'); unless you want to do something more with handling multi-sources (but I don’t know what)

Also, I realize now that my suggestion to remove trailing whitespace with .replace(/[^\S\n]+\n/mg, '\n') prevents passing in empty quoted lines which are >  sooooo, IDK, maybe not that after all
Background Pony #0E61
Passing the upload info as a query string (? separator) means Derpibooru’s servers have to accept it. If passing extraordinarily long information (like an enormous description), this can run afoul of URL length limits (eg. Derpibooru was giving me an error 414). A workaround might be to pass it as a fragment instead (# separator and then convert it back with something like a.href = url.replace('#', '?');)
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
Probably I really should update this part, but this requires also updating several scripts (or handling both ways). Maybe I’ll fix work with fixing sourcing, but descriptions over 8K symbols (derpi breaks somewhere around this value) is… really not a primary usecase, lol
Background Pony #0E61
@stsyn
Ya, that’s fair, lol. It was someone who’d used a lot of user-created icons and so there were like 16 image links each with dA token strings.
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
I guess we can stick for /i/, as these were around for a long time I just forgot about them (maybe because these are usually uncompressed already, so there was no point to preserve functionality or just nobody knows how to get full version, so blah). Anyway, should work now.
Also I finally managed to make this thing work even on upload page, so you can now fetch DeviantArt from your derpi upload tab again and already in full quality (kinda does the same as the rest scripts from this thread and does not fetch smart stuff, but I used it for a different purposes before, so why not also it can bypass 8K url limit potentially, since it doesn’t even need this overcomplicated connection layer who made this thing inline-block, wtf).
Markiz93
Lunar Supporter - Helped forge New Lunar Republic's freedom in the face of the Solar Empire's oppressive tyrannical regime (April Fools 2023).
Perfect Pony Plot Provider - Uploader of 10+ images with 350 upvotes or more (Questionable/Explicit)
Non-Fungible Trixie -
Preenhub - We all know what you were up to this evening~
Wallet After Summer Sale -
Cool Crow - "Caw!" An awesome tagger
Fine Arts - Two hundred uploads with a score of over a hundred (Safe/Suggestive)
Not a Llama - Happy April Fools Day!
Magnificent Metadata Maniac - #1 Assistant

Proud of being Polish
I’m tried to upload https://www.deviantart.com/lennondash/art/Humbleshy-983494105 in full resolution using both token kek and this new script and it doesn’t work. There is “token validation failed” and “no image found in that adress”.
When I tried to download a picture which I downloaded earlier, like https://www.deviantart.com/revergard/art/Apple-Bloom-mlp-fanart-982197546 (>>3200547), it doesn’t work anymore. Did Deviantart do something to prevent downloading?
Background Pony #D597
Is the script working again? I see mdashlw can upload full-sized images from DeviantArt again…
Background Pony #C64D
I see mdashlw’s recent upload is from DA, in full size without download button. I script working again that the uploader can now downkoad full sized images?
Interested in advertising on Derpibooru? Click here for information!
Pony Arts & Prints!

Help fund the $15 daily operational cost of Derpibooru - support us financially!

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

Detailed syntax guide