Working again. Yay!


Has anyone else had success using a bot to construct a POST request using file upload instead of URL? I'm looking for a way to mass reverse search files from my computer. URL works just fine, but it keeps giving me an erroneous page when I try to upload the file.


Given url="http://iqdb.harry.lu/" and using the python requests library, this is what I have so far:

with open("q6vtycjh.jpg", mode="rb") as file:
    res = requests.post(url, data={"url": "http://i.imgur.com/3NEe6.jpg"})

This responds with code 200 and Thumbnail error code - Not an image. Perhaps your file is corrupt? in the webpage.

with open("q6vtycjh.jpg", mode="rb") as file:
    res = requests.post(url, files={"file": ("q6vtycjh.jpg", file, "image/jpeg")})

This responds with code 200 and Database error: param_error Format: query <dbid> <flags> <numres> <filename> in the webpage.

HELP

Assuming "q6vtycjh.jpg" is a valid jpg file in present working directory

parasprite
Former Staff
2 years ago
blue_eyes cutie_mark digital_media_(artwork) duo ear_tuft english_text equine eshredder feathered_wings feathers female feral fluttershy_(mlp) friendship_is_magic fur hair inner_ear_fluff long_hair looking_at_viewer mammal my_little_pony parasprite_(mlp) pegasus pink_hair simple_background smile solo_focus text tongue tongue_out tuft wings yellow_feathers yellow_fur

Rating: Safe
Score: 39
User: Fluttershy
Date: April 15, 2013

comealongpond said:
Given url="http://iqdb.harry.lu/" and using the python requests library, this is what I have so far:

with open("q6vtycjh.jpg", mode="rb") as file:
    res = requests.post(url, data={"url": "http://i.imgur.com/3NEe6.jpg"})

This responds with code 200 and Thumbnail error code - Not an image. Perhaps your file is corrupt? in the webpage.

with open("q6vtycjh.jpg", mode="rb") as file:
    res = requests.post(url, files={"file": ("q6vtycjh.jpg", file, "image/jpeg")})

This responds with code 200 and Database error: param_error Format: query <dbid> <flags> <numres> <filename> in the webpage.

HELP

Assuming "q6vtycjh.jpg" is a valid jpg file in present working directory

The first is just doing http://iqdb.harry.lu/?url=http://i.imgur.com/3NEe6.jpg`, so I don't know why that wouldn't work. However I know if you do that in a normal browser with the cache disabled, hit back, then hit forward you get the same error. It might be that your request is getting redirected somehow (I'm not sure).

The second looks like you aren't giving it the correct form-data. I don't know much about python, but you may have better luck if you grab a cURL/HAR output from the browser to base the request on. http://iqdb.org/code/README might help explain some of the output regarding the error.

Disclaimer: I have very little experience with this sort of thing.


parasprite said:
The first is just doing http://iqdb.harry.lu/?url=http://i.imgur.com/3NEe6.jpg`, so I don't know why that wouldn't work. However I know if you do that in a normal browser with the cache disabled, hit back, then hit forward you get the same error. It might be that your request is getting redirected somehow (I'm not sure).

The second looks like you aren't giving it the correct form-data. I don't know much about python, but you may have better luck if you grab a cURL/HAR output from the browser to base the request on. http://iqdb.org/code/README might help explain some of the output regarding the error.

Disclaimer: I have very little experience with this sort of thing.

Thanks for the insight on the first point, it's quite interesting.

I've tried using Chrome Dev Tools to intercept the post, copy as cURL, and run from the command line, and it gives me the same Thumbnail error code - Not an image. Perhaps your file is corrupt? content. Which makes absolutely no sense to me, I am not modifying it, and I am running the curl command from the directory of the file.


comealongpond said:
Given url="http://iqdb.harry.lu/" and using the python requests library, this is what I have so far:

with open("q6vtycjh.jpg", mode="rb") as file:
    res = requests.post(url, data={"url": "http://i.imgur.com/3NEe6.jpg"})

This responds with code 200 and Thumbnail error code - Not an image. Perhaps your file is corrupt? in the webpage.

with open("q6vtycjh.jpg", mode="rb") as file:
    res = requests.post(url, files={"file": ("q6vtycjh.jpg", file, "image/jpeg")})

This responds with code 200 and Database error: param_error Format: query <dbid> <flags> <numres> <filename> in the webpage.

HELP

Assuming "q6vtycjh.jpg" is a valid jpg file in present working directory

Also, in the second request, if the files parameter dictionary key is anything other than "file" the response contains the same "Thumbnail error code - blah blah", so I'm quite certain it's locking onto the correct form input.


Getting a Host Error when trying to connect, fingers crossed this service isn't dead, i've been using it constantly for the past few years


MrGaoth said:
Getting a Host Error when trying to connect, fingers crossed this service isn't dead, i've been using it constantly for the past few years

Seems to be alright from my side, no problems here.

Also, try to use the most recent thread, forum #256957, than necro-ing an old one.