[Userscript] Derpibooru Image Importer

Marker
Boot badge - It's Bootiful
Fried Chicken - Attended an April Fools event
Liberty Belle - Sings the song of the unchained

Misanthrope
Image Importer

Userscript for importing images and associated tags, source, descriptions from the upload page.

Requires Violentmonkey or compatible userscript manager.
Click here to install from Github

Usage:
Image Import
- Go to the upload page
- Paste in link in the fetch field. (e.g. https://derpibooru.org/images/0)
- Click on "Import" and wait until it's downloaded.
- Review and edit the tags, description as needed.
- Upload.

Tag Import
- Open image tag editor
- Paste in link in the fetch field.
- Click on "Import tag" to merge fetched tags with existing ones.

Settings:

Add import message to description — Off by default. This will prefix the image description with a link to the original derpibooru post:
"[Imported from Derpibooru]":https://derpibooru.org/images/[image id]


Link correction — Turned on by default. The script will try to rewrite on-site links and embeds like
>>1234
>>1234p
"link":/relative/path/

into
">>1234":https://derpibooru.org/images/1234
">>1234p":https://derpibooru.org/images/1234
"link":https://derpibooru.org/relative/path/


Use origin as source — Off by default. Use original site as source link if the imported image lacks one.

Setting screenshot:


Quick upload:


Demo:
Marker
Boot badge - It's Bootiful
Fried Chicken - Attended an April Fools event
Liberty Belle - Sings the song of the unchained

Misanthrope
Changelog:
Added a setting to indicate the image was imported from Derpibooru in the uploader description.
Anonymous #8583
Not to say that this is useless, but I don't think that this is useful. A bulk import by the site admin is much more likely than the users painstakingly merging two and a half million images by hand.
Marker
Boot badge - It's Bootiful
Fried Chicken - Attended an April Fools event
Liberty Belle - Sings the song of the unchained

Misanthrope
@Anonymous #8583
Oh definitely. But since there are already people manually batch uploading stuff to the site, mostly artists uploading their own stuff, I figured having a tool like this will make things easier for them.
It will also remain useful after the admin performs the bulk import, it will then be up to the users to upload any new images from Derpi.
Luzion
Rampant Alicorn - The majestic steed of a blessed crusade
A toast - Incredibly based
Fried Chicken - Attended an april fools event
Donor | Lyra -
Squirrel of Legend - A squirrel that was there in a time of great need
Liberty Belle - Sings the song of the unchained

Senior Moderator
pingus
Seems to hang up either because firefox, or because grease monkey.

I'll do a little testing to see if I can narrow that down.
Marker
Boot badge - It's Bootiful
Fried Chicken - Attended an April Fools event
Liberty Belle - Sings the song of the unchained

Misanthrope
It was brought up that it wouldn't make sense to keep certain tags when importing from Derpibooru, mainly things like "drama in the comments". I'll work on a feature to auto remove those tags during import in the next update. Can you guys suggest which tags should be included in this list?


@Telefe
@marredpink
Ooops, fixed.

@Luzion
Both Violentmonkey and Tampermonkey(Probably not with the coming update) should work with the script.
Marker
Boot badge - It's Bootiful
Fried Chicken - Attended an April Fools event
Liberty Belle - Sings the song of the unchained

Misanthrope
Updated to version 1.2.0:
Added tag filtering, link correction, and Derpi source links. See the OP for details.
ArchiveAnon
Rampant Squirrel - A ferocious friend
Boot badge - It's Bootiful
Donor | Gabby - Best Birbcat, don't @ me
Liberty Belle - Sings the song of the unchained (unintended savior)

Senior Moderator
Everything Stays
That tag filter is fantastic, thank you very much. I do have one tag to tack on to that list: featured image

Added it already to my own of course, but if its possible for you to tweak that through updates it might help out still in the future.
Anonymous #F161
Heads up, I forked it for ponerpics, the main change I made was changing the hardcoded derpibooru.org stuff and allowing it to support any number of philomena boorus: https://gitlab.com/emndc8549phnxel/philomena-importer

I don't have (and can't be bothered to make) a github account for a pull request, hence I'm notifying you here in case you'd like to pull my changes. I have never looked into Greasemonkey script configuration so maybe the list of sources can be made configurable instead of a hardcoded object.
Marker
Boot badge - It's Bootiful
Fried Chicken - Attended an April Fools event
Liberty Belle - Sings the song of the unchained

Misanthrope
@Anonymous #F161
Thanks for the contribution! Unfortunately, I pushed a new update right before I saw your post. Thanks for laying out the groundwork for generalizing the script for me, I'll try to get the feature done by the next update.

@the rest of the thread
Changelog for version 1.2.5:
- Changed the order of execution to restore the fancy tag editor before the full image is fetched.
- Shortened the button name to "Import", and swapped its position with the fetch button. This should make it easier to click, or access with the tab key.
- The import button will now show the download status of the full image as a percentage.


MOD EDIT: Nuked the accidental anon posts, and merged the original.
Candel
Artist -
Liberty Belle - Sings the song of the unchained

sleepyhoers
I think it'd be cool if it also included an "original post date" in the description. When I uploaded all my stuff here, I made sure to put down the date the images were originally posted on Derpi, so that there'd be a way to see when the art was created even if they were all posted here on the same day.
Marker
Boot badge - It's Bootiful
Fried Chicken - Attended an April Fools event
Liberty Belle - Sings the song of the unchained

Misanthrope
Changelog for version 1.3.0:
You can now use the script to import images from the following sites to each other:
- Derpibooru
- Ponybooru
- Ponerpics

Script name is still kept as "Derpibooru Image Importer" so as to not break the existing installs.


@Candel
I personally don't think adding that information would be too helpful. As it can be found by following the link to the original image.
Edit: Feature added
Anonymous #F161
@Marker
But the original image could always get deleted (which is part of the reason this site exists in the first place). It may not always be necessary, but in some cases it would be useful to immortalise that information without relying on the original staying up.
Syntax quick reference: *bold* _italic_ [spoiler]hide text[/spoiler] @code@ +underline+ -strike- ^sup^ ~sub~