
[Userscript] semi-Automated Derpibooru Uploader

Background Pony #0E61
For deviantArt, does “token kek” presently ever not work? Do “failsafe”, “intermediary”, and “login leak” have any current purpose besides future-proofing just in case?
function reverse(url) {
alert('unsupported');
}

stsyn 














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)
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 library2) 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.
3.5) You can get the artist from that JSON too, instead of querySelector:
[...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 














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.
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!

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