Topic: How to Download Ugoira using Developer Tools?

Posted under General

Upon searching the above question online, I was able to find several tutorials, all with similar advice to topic #20599, and all unfortunately appear to be outdated, probably due to a change in Pixiv's design.

Look at the page's HTML source and search for .zip.

0 of 0

Paste the following into the console: javascript:window.location=pixiv.context.ugokuIllustFullscreenData.src;.

Uncaught ReferenceError: pixiv is not defined at <anonymous>

Is there a modern version of this process? Or maybe I am doing something wrong?

Tangentially relevant: The tutorials I was able to find for downloading .m3u8 files from Twitter still work, which is nice

aobird said:
There are multiple ways, I use the public API eg https://www.pixiv.net/ajax/illust/55366285/ugoira_meta
You need pixiv.net as referrer in the request, clicking on the link for zip with browser won't work.

curl -e 'https://www.pixiv.net' https://i.pximg.net/img-zip-ugoira/img/2016/02/19/04/17/55/55366285_ugoira1920x1080.zip

https://reqbin.com/c-ciinti1q

I tried to follow your method, but using a randomly chosen post, the original resolution returns an "Aborted: Error code 10042" and i cannot seem to find what that means anywhere.

The downscaled resolution works like the example given, but neither the example nor the post I chose give me anything to download.

aobird said:
Give me the post id and I'll check.

Thank you for your time, I really appreciate it.

I tested 7 examples. The first 6 are SFW and the last one is NSFW. The original example used in https://reqbin.com/c-ciinti1q (https://i.pximg.net/img-zip-ugoira/img/2016/02/19/04/17/55/55366285_ugoira1920x1080.zip) shows me a wall of nonsense text after running, which I assume represents the information contained in the zip file, though I don't seem to have a way of downloading it.

I tried replacing the example URL with the URLs I obtained from the public API. The first 6 examples show similar results to the original in both resolutions. The last one returns Aborted. Error code: 10042 in both resolutions.

https://www.pixiv.net/en/artworks/94431213
https://www.pixiv.net/ajax/illust/94431213/ugoira_meta
https://i.pximg.net/img-zip-ugoira/img/2021/11/28/16/57/39/94431213_ugoira600x600.zip
https://i.pximg.net/img-zip-ugoira/img/2021/11/28/16/57/39/94431213_ugoira1920x1080.zip

https://www.pixiv.net/en/artworks/94411395
https://www.pixiv.net/ajax/illust/94411395/ugoira_meta
https://i.pximg.net/img-zip-ugoira/img/2021/11/27/20/57/52/94411395_ugoira600x600.zip
https://i.pximg.net/img-zip-ugoira/img/2021/11/27/20/57/52/94411395_ugoira1920x1080.zip

https://www.pixiv.net/en/artworks/94047636
https://www.pixiv.net/ajax/illust/94047636/ugoira_meta
https://i.pximg.net/img-zip-ugoira/img/2021/11/10/22/31/06/94047636_ugoira600x600.zip
https://i.pximg.net/img-zip-ugoira/img/2021/11/10/22/31/06/94047636_ugoira1920x1080.zip

https://www.pixiv.net/en/artworks/93738571
https://www.pixiv.net/ajax/illust/93738571/ugoira_meta
https://i.pximg.net/img-zip-ugoira/img/2021/10/28/18/59/22/93738571_ugoira600x600.zip
https://i.pximg.net/img-zip-ugoira/img/2021/10/28/18/59/22/93738571_ugoira1920x1080.zip

https://www.pixiv.net/en/artworks/93493164
https://www.pixiv.net/ajax/illust/93493164/ugoira_meta
https://i.pximg.net/img-zip-ugoira/img/2021/10/17/01/18/55/93493164_ugoira600x600.zip
https://i.pximg.net/img-zip-ugoira/img/2021/10/17/01/18/55/93493164_ugoira1920x1080.zip

https://www.pixiv.net/en/artworks/94307597
https://www.pixiv.net/ajax/illust/94307597/ugoira_meta
https://i.pximg.net/img-zip-ugoira/img/2021/11/22/23/03/11/94307597_ugoira600x600.zip
https://i.pximg.net/img-zip-ugoira/img/2021/11/22/23/03/11/94307597_ugoira1920x1080.zip

https://www.pixiv.net/en/artworks/93576936
https://www.pixiv.net/ajax/illust/93576936/ugoira_meta
https://i.pximg.net/img-zip-ugoira/img/2021/10/21/00/00/06/93576936_ugoira600x600.zip
https://i.pximg.net/img-zip-ugoira/img/2021/10/21/00/00/06/93576936_ugoira1920x1080.zip

Updated

gattonero2001 said:
I tested 7 examples. The first 6 are SFW and the last one is NSFW. The original example used in https://reqbin.com/c-ciinti1q (https://i.pximg.net/img-zip-ugoira/img/2016/02/19/04/17/55/55366285_ugoira1920x1080.zip) shows me a wall of nonsense text after running, which I assume represents the information contained in the zip file, though I don't seem to have a way of downloading it.

That'll be because curl is one of those annoying tools that defaults to outputting to stdout, even though that is rarely useful. To actually obtain a zip file, append -o output.zip (or whatever filename you want) to the command.

gattonero2001 said:
I tried replacing the example URL with the URLs I obtained from the public API. The first 6 examples show similar results to the original in both resolutions. The last one returns Aborted. Error code: 10042 in both resolutions.

And that'll be because pixiv requires you to present a login cookie to view NSFW content. No idea how to work around that one.

The curl example is just an example to show that it works, the wall of nonsense are just bytes being shown as some text. If you remove the header it will show 403.

I tried the last one and it works fine, this is all of the test code:

using (WebClient WebClientTemp = new WebClient())
{
WebClientTemp.Headers["Referer"] = "https://www.pixiv.net/";
WebClientTemp.DownloadFile("https://i.pximg.net/img-zip-ugoira/img/2021/10/21/00/00/06/93576936_ugoira1920x1080.zip", "test.zip");
}
MessageBox.Show("Done!");

I use something different but it also works just fine.

Do you just want to download the file to your pc, you are not programming anything?

---

wat8548 said:
And that'll be because pixiv requires you to present a login cookie to view NSFW content.

Nah. You already got the links.

---

I wrote an app with a few lines of code for you that will download them, no error handling at all and it only check that part of "ugoira1920x1080.zip" string exists in textbox.
https://easyupload.io/6iui3o

Updated

aobird said:
Do you just want to download the file to your pc, you are not programming anything?

I would like to understand how to do that by myself, without automatic tools and if possible avoiding very technical means (like writing curl code, for example)... I already have an extension installed that allows me to obtain zip files from Pixiv posts.

Ideally, something like the Youtube/Twitter tricks that require little more than looking at the page's HTML sources and/or network to access the files... though I assume Pixiv should be more complex to deal with, given the way it handles referrals. I wonder if anything similar to the outdated tutorials could still work?

I wrote an app with a few lines of code for you that will download them, no error handling at all and it only check that part of "ugoira1920x1080.zip" string exists in textbox.
https://easyupload.io/6iui3o

Thank you, that is amazing! As I said, I could already download the zips with a browser extension, but I appreciate the work you put into this and I am impressed at how quickly it was made.

If you open the dev console > network and edit the request by adding "Referer: https://www.pixiv.net/" then send it, it responds with data but it doesn't open the FileDownloadDialog. There's probably some other parameter that it needs for browser to recognize it but i haven't played around with it. That's what the plugin does basically, it intercepts the header and inserts the referer or makes a new request (depending on which one you are using). It's the same as this app, just 2-3 minutes / few lines of code.

You have to have something that adds the parameters so the backend accepts it, it can't get any simpler than this.
So your options are browser plugins scripts or standalone apps.

---

If you are on win10, you can shift+right click on desktop then open powershell and paste

Invoke-WebRequest -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox -Headers @{'Referer' = 'https://www.pixiv.net/';} -Uri 'https://i.pximg.net/img-zip-ugoira/img/2016/02/19/04/17/55/55366285_ugoira1920x1080.zip' -OutFile 'test.zip'

Ppl say web request is slow and to remove progress bar on it or use webclient but I'm downloading something rn that can't be stopped so can't test.

Updated

aobird said:
If you open the dev console > network and edit the request (...)

That's pretty interesting, I'll have to look deeper into HTTP requests in the future. For now, the extension and your app will do nicely, thanks!

If you are on win10, you can shift+right click on desktop then open powershell and paste (...)

It's good to know that this is an option, but I think interacting with the powershell may be a bit above my skill level...

gattonero2001 said:
That's pretty interesting, I'll have to look deeper into HTTP requests in the future. For now, the extension and your app will do nicely, thanks!

It's good to know that this is an option, but I think interacting with the powershell may be a bit above my skill level...

You just have to change url and file name when pasting, that's all.

aobird said:
You just have to change url and file name when pasting, that's all.

It works like a charm! Thank you very much for the help and sorry for any inconvenience. I can be somewhat clueless when it comes to technology... Powershell commands are also in my to-study list now.

Hopefully the information in this thread will be useful to other people in the future as well.

  • 1