Interesting. Do I need to login before I upload? Or could I upload as a temporary user?
For the post request, does the filename need to be anything in particular? Or does it not matter. I noticed your js on the site creates a random string for the upload.
Will try writting in python requests.
Hmm, having trouble getting this to work in python..
So I'm not sure what my policy is going to be with temp users and large data users. It probably would be better to use an actual account. So it's pretty easy to script. The only slightly tricky part is keeping cookies between requests.
I almost regret posting that code because it can be summed up so easily.
Login with post form names..{username,password}
Upload image with post form name..{file}
Post to '/ppkey/fset/{identifier}'
Get image at '/ppkey/fget/{username}/{identifier}'
By convention that identifier usually leads with an app name so a user can use multiple apps without a problem.
You might not need to do that but it's your call.
ppkey means public
pkey means for other logged in users
skey means only you can see it.
fset means set a file associated with a key
fget means get a file associated with a key
set means set a string associated with a key
get means get a string associated with a key
fhash means get the sha1 hash of a file.
For pkey and ppkey a user is a part of the get url because we need to know which user's content we are getting.
Totally fine with logging in. Just need to get this all to work using python requests.
Keeping track of cookies won't be an issue.
SO I need to POST a username/password to https://js.lifelist.pw, then I have to POST a file to https://js.lifelist.pw/ppkey/fset/upload/randomname.jpg ?
Edit: Just saw your updated, comment.
Yes. And "upload/randomname.jpg" is the key.
Setting the contentType of the file will help the server deliver the same mime-type.
I know how to do that with node-requests and jquery, but I'm not sure on python.
I'm sure most browsers could figure it out without it but it would be better to include it.
(post is archived)