Is there any way I can programmatically authorize to upload multiple files to Dreamwidth by a script
I have about 100 files that I want to upload to Dreamwidth. I want to do it with a script, if it's possible. I checked what happens in my browser when I'm logged in and uploading a file at https://www.dreamwidth.org/file/new , and it was pretty much the following request:
POST https://www.dreamwidth.org/api/v1/file/new
Content-Type: multipart/form-data
Cookies: ljuniq=THISTOKENCHANGESWITHEVERYREQUEST;
BMLschemepref=celerity-local;
__utma=SOMETOKEN;ljmastersession=YETANOTHERTOKEN;
ljloggedin=FINALTOKEN
FILE BODY
My problem now is: how do I get the whole cookies/authorization stuff, or at least THISTOKENCHANGESWITHEVERYREQUEST token (other stuff seems to be reused? can I hijack my current session and simply use cookies from it in my script?) Is there any way to do it programmatically?
no subject
That said, the file upload page allows you to select multiple files at once - I don't know if there's an upper limit, actually.
no subject
no subject
Glad it worked! Yeah, I think that maybe needs to be better documented somewhere - I think I found it by just seeing if it worked (because it's a UX pattern that's becoming pretty common). Glad I could save you some work!