Danbooru

ArtStation Integration

Posted under Bugs & Features

Quoting BrokenEagle98's important ArtStation related posts because they contains relevant original research (forum #126368 and forum #126375):

BrokenEagle98 said:

After doing some preliminary work on Artstation, I noticed that they use gzip encoding for their pictures. I was using the Content-Length attribute in the header to match the filesize, but became supicious when the very first picture I encountered which was uploaded only 2 days ago was an MD5 mismatch. I learned that the header was reporting one size (863466), while the size of the image itself was another (939777, which did match Danbooru).

Image tested:

post #2616867 (http://danbooru.donmai.us/posts/2616867.json)
https://cdna.artstation.com/p/assets/images/images/004/750/650/original/matt-waggle-1920x1080x2-shot-1.jpg

response header
'Server': 'nginx/1.10.2'
'Content-Encoding': 'gzip'
'Last-Modified': 'Fri, 03 Feb 2017 21:46:28 GMT'
'ETag': '"5894fa34-d2cea"'
'Date': 'Fri, 03 Feb 2017 22:41:05 GMT'
'Cache-Control': 'max-age=315360000'
'Connection': 'keep-alive',
'Expires': 'Thu, 31 Dec 2037 23:55:55 GMT'
'Content-Length': '863466'
'Access-Control-Allow-Origin': '*'
'Access-Control-Expose-Headers': 'Accept-Ranges, Content-Length, Range'
'Content-Type': 'image/jpeg'

I also learned that most browser image info viewers use the header size instead of the content size, and so would report the incorrect size in the above scenario. The only way to check the real size then would be to download the image and check its size. I'm sharing the above just in case anyone was using only their browser to validate an image's attributes.

BrokenEagle98 said:

After finishing Artstation, it's surprising just how much cleaning up is necessary.

Total Artstation pictures: 1023
Total Artstation samples: 481

That's 481/1023, or 47%. That's a huge percentage. Given that, it's more of an imperative that issue #2769 be fixed. Will comment on that issue so that this hopefully gets more of a precedence.

Bad ArtStation ID caution

More ArtStation fuckery. For example post #2109181 was detected as having a bad ID wile it's actually active.

Here's the current source URL:

The post has not been taken down from ArtStation. It's still active at

This appears to match the ***.artstation.com URL to the www.artstation.com/artwork ID

It should also be remembered, ArtStation users can edit their subdomains.

There are cases of bad artstation id's where the user appears to have entirely deleted their account or an individual post, however many others are just a result of ArtStation changing how it structures URLs.

sweetpeɐ said:

There are cases of bad artstation id's where the user appears to have entirely deleted their account or an individual post, however many others are just a result of ArtStation changing how it structures URLs.

Yeah, when I was going through Artstation, I kept going through the "portfolio" links trying to find a valid link without any success. I debated on whether to mark them bad id or bad source, but in the end went with bad id since the original links are indexed.

Just gave the Testbooru implementation a test, and noticed a couple of things.

1. When using just the image links, it does swap out /large/, but not /medium/ or /small/.

2. Post links don't grab the image, i.e....

  • www.artwork.com/artwork/*
  • *.artwork.com/projects/*

3. Not all /original/ links work. This needs to be somehow detected.

Edit:

Added #3 above

Updated

That JSON endpoint is interesting.

So an artwork (seems to be the same as a project) represents a single page, but an artwork can have multiple media assets associated with it.

A media asset has an id associated with (distinct from the artwork id) and this matches the nested three part three digit subdirectory structure of the image URL.

The zKbD6 is labeled a hash_id in the JSON. In this case it somehow is mapped from the integer id of 1101731. It has a single media asset with id 3237339.

Given that an artwork page can have multiple images, I'm not sure how the bookmarklet should work. It would have to go through the batch bookmarklet which generates a unique upload page for each media asset. But this does solve the problem of initializing with the correct source.

We know that some of the links don't have "original" function and when you write that in the link instead of "large" then all you get in return is "file not found" page. So do we get to still upload those files on danbooru? For example this post: post #2636656 or post #2636654

I was looking to alternative sources for these two image but I failed to find anything since some artist tend to only use either their facebook page or artstation account. So in this case since original link is not working and I don't think the links will change anytime soon then what I'm trying to ask is that can we still get to upload these kind of files even if the "original" image is missing on the fanart page?

like https://cdnb.artstation.com/p/assets/images/images/004/979/803/large/shanghui-lau-college-mercy.jpg?1487627719
https://cdnb.artstation.com/p/assets/images/images/004/979/803/original/shanghui-lau-college-mercy.jpg?1487627719 (not working - 404)

Sorry if I missed anything or have any solution for that but if the image page gets updated I'd love to change the sample page with the actual image but as I said when the "original" page is missing then these kind of images tend to stay forever.

The original link does not always work. This is not anything bad, it just means that an original size does not exist. In these cases, uploading the large size is appropriate.

If you upload using the Bookmarklet, it will check if there is an "original", and if not, will use the "large" size image. Additionally, it will change the "source:" to the post page instead of the image link.

BrokenEagle98 said:

The original link does not always work. This is not anything bad, it just means that an original size does not exist. In these cases, uploading the large size is appropriate.

If you upload using the Bookmarklet, it will check if there is an "original", and if not, will use the "large" size image. Additionally, it will change the "source:" to the post page instead of the image link.

Great! Thanks for the response mate <3!

BrokenEagle98 said:

The original link does not always work. This is not anything bad, it just means that an original size does not exist. In these cases, uploading the large size is appropriate.

If you upload using the Bookmarklet, it will check if there is an "original", and if not, will use the "large" size image. Additionally, it will change the "source:" to the post page instead of the image link.

Couldn't get that to work on last upload.

Kikimaru said:

Couldn't get that to work on last upload.

Did you use the bookmarklet from the post page... i.e....

... or did you use it from the image page... i.e....

The former will not work... the latter should work.

However, it's best to open the image into a new tab from the post page (the former), and then use the bookmarklet from the image page (the latter). That way, the page still has the Referrer URL, and will automatically change the source to the post page once the image gets uploaded.

@Kikimaru, if you upload using a /large/ image URL from the bookmarklet it will actually fetch the /original/ if available, just like with Twitter the :orig is automatically appended to the end of file extensions.

If you use the bookmarklet for either www.artstation.com posts or direct URLs the smart URL detection will fetch the appropriate image. It may say /large/ while your uploading but after upload you will notice the source URL is for the appropriate image.

Additionally the batch bookmarklet works for multi-image posts. Something else, if you change the source URL to the www.artstation.com post link you can fetch commentary and tags used the fetch data link or add artist commentary link. ( @evazion maybe it should automatically just use the URL? I don't think we have a technical means in site yet for an image > html conversion :\)

You are pretty much fine as long as you don't download and upload the file because of recent updates to Danbooru.

The former will not work... the latter should work.

Both methods work for me, although not with custom subdomains, just www.

However, it's best to open the image into a new tab from the post page (the former), and then use the bookmarklet from the image page (the latter). That way, the page still has the Referrer URL, and will automatically change the source to the post page once the image gets uploaded.

My experience is I need to manually change source after upload using the bookmarklet.

Ah... well, I've never actually uploaded from Artstation... just used the Bookmarklet to verify that it works.

Also, did not know about the 'www' thing... I only tested it out from a custom subdomain...

I wonder what's going on with the source thing though...? I know that it works with images from Twitter, for those few instances that the bookmarklet does not work from the post page... It also works for Tumblr, which has no option to upload from the post page...

sweetpeɐ said:

@Kikimaru, if you upload using a /large/ image URL from the bookmarklet it will actually fetch the /original/ if available, just like with Twitter the :orig is automatically appended to the end of file extensions.

If you use the bookmarklet for either www.artstation.com posts or direct URLs the smart URL detection will fetch the appropriate image. It may say /large/ while your uploading but after upload you will notice the source URL is for the appropriate image.

Additionally the batch bookmarklet works for multi-image posts. Something else, if you change the source URL to the www.artstation.com post link you can fetch commentary and tags used the fetch data link or add artist commentary link. ( @evazion maybe it should automatically just use the URL? I don't think we have a technical means in site yet for an image > html conversion :\)

You are pretty much fine as long as you don't download and upload the file because of recent updates to Danbooru.

Both of these methods give me the URL https://cdnb.artstation.com/p/assets/images/images/004/934/937/large/c-home-dj.jpg?1487314142

  • Right-click on image, "View Image"
  • Click on "Expand" option (2nd hover option on image)

Using Firefox.

1 2 3