Danbooru

Pixiv preview images

Posted under General

Several images from Pixiv have been uploaded that were from the preview page. To those not aware, you get full versions after you click on the preview image. Small images are usually the same as the preview images though so I'm against mass deletion of them if anyone gets ideas.

Try using this in the search box to find currently uploaded Pixiv preview images.

source:http://img*.pixiv.net/img/*/*_m.*

Updated by h4x0r

I wonder if it's possible to write a script that will take all those images, drop the '_m' (to get the real image), confirm there's a difference in size (no need to reupload if it's the same), upload it, copy the tags over from the old post, and make the new one the parent?

I was going to fix some manually but there's 10 pages of them.

I think I could make such a script in a day. However, my account can't post 190 images and I'm not sure I want to know what will happen if it doesn't work as expected.

I currently have a script that can download files and synchronize my favorites, but I have never tried posting through the danbooru API before...

Copying the tags over would be no problem.

Getting the parent's post ID for the child posts could get ugly if the API doesn't give me the ID. (It might have to query danbooru for the MD5 sum of the parent to get the ID, which means I need the MD5 sum, which means I have to have the image, etc etc)

Well if you have some ideas but don't think your account level will let you implement them, maybe you could send albert the code? Assuming he doesn't already know how, I mean.

Might actually be useful to run the script automatically at regular intervals or something, but only if this issue of upping from preview images is a recurring problem. And only if it doesn't cause undue server load or whatever.

I have a script that posts, but I don't have a pixiv account. More importantly, I tried that search and I wouldn't want most of that stuff in my uploads. If some other mod has a pixiv account and can run python, let me know.

Updated

Do you actually need a pixiv account? Was was able to get to the images without the account. You just need the file name.

If you have a script that can post, can you please e-mail it to me at h4x0rz3r0@gmail.com ?

I have already completed the code required to get the image list from danbooru. Now all thats left is to post! Then fix the parent tags. There are 24 images that already have parents though, so the script won't touch thoes.

Ok. The script has been completed and tested with my latest post. The script should be able to run all 190 images in pseudo interactive mode. The script will stop and ask for directions when an error happens. What mod out there wants to give this thing a test drive?

Features.

  • Queries danbooru for images that match "source:http://img*.pixiv.net/img/*/*_m.*"
  • Strips the _m from images in the image list.
  • removes posts that already have a parent post from the image list.
  • Reposts preserving the original tags.
  • Stops to confirm if there are errors.
  • Makes the new post the parent of the old post
  • Stops to confirm if there are errors.
  • Prints out the ID of all images it changes for later checking.

Script is written in python and uses danbooru API.

Updated

Nifty script. :)

It works but I have a suggestion in handling the posts that already exist but doesn't have any parent. It'd be better if you can just change its source to the one without "_m" since it just means that the preview and the full version is the same image.

Thanks for your help.

Edit: I'd also exclude pending posts. I don't want to inadvertently post images I didn't want to approve.

Updated

The new script now ignores pending posts.

I tried to implement detecting if a preview image is the same as the full image, but I'm unable to download images from pixiv with ether wget or python. I have tried changing the user agent with no success. Web browsers and Danbooru do not seem to have any difficulty downloading images from pixiv, however. Maybe Albert knows how to get pass the pixiv security checks and can give me a few pointers. I should be all set if I knew exactly what http headers need to be sent to make pixiv happy. Or I could get some fanzy proxy server and point my web browser through it and capture the headers...

I'm currently experimenting with the following post.

post #341273

http://img07.pixiv.net/img/haria/1947555.jpg

I don't think you need to download the image to do the checking though. The 'post already exist' response plus the post not having any parent implies that trying to upload the full image either collides with the existing preview image probably because the full version was already uploaded and not set up as a parent. If the current post is the same as the post id of the existing image, they are the same. I don't know if the response 'post already exist' returns the post id of the existing image though.

So where's the new version?

1 2