PoE-TradeMacro / POE-TradeMacro

Price checking script for Path of Exile.
https://poe-trademacro.github.io/
GNU General Public License v3.0
936 stars 188 forks source link

Missing Cookie cf_clearance [fixing the reading cookie data failed error] #407

Closed Dirkmuthmann closed 7 years ago

Dirkmuthmann commented 7 years ago

I Tried to follow this guide here https://github.com/PoE-TradeMacro/POE-TradeMacro/issues/149#issuecomment-268639184 for fixing the reading cookie data failed error.

but only have the cfduid cooke and league harbringer cookie missing the cf_clearance cookie, what should i do?

I try´d run cmd in /lib with curl.exe -I poe.trade

and this: The problem does only if the path to the macro folder contains spaces. After I copied the macro folder to the root directory (c:\ in my case) and made sure the macro folder itself doesnt have any spaces, the script started working correctly without any errors.

Eruyome commented 7 years ago

I heard about this (spaces), I probably forgot to wrap some path in quotation marks somewhere. Aside from that, you don't really have any cookie issues, you don't need them, you don't get a cloudflare page that would/could genereate the clearance, but not getting this page means you don't need to bypass it.

Edit: The spaces issue is fixed in 2.3.8

Dirkmuthmann commented 7 years ago

okay thank you sir :)

Dirkmuthmann commented 7 years ago

So this is the error i get

don´t know what i do wrong or whats wrong. any help?

Eruyome commented 7 years ago

https://github.com/PoE-TradeMacro/POE-TradeMacro/issues/428#issuecomment-322209874 Please read my comment and follow my instructions.

Dirkmuthmann commented 7 years ago

I tried the curl_test and the file in the folder was emty. Running RunCurlTestPowershellScript.bat but no tempoutput folder will be created.

Eruyome commented 7 years ago

Hm, even weirder... Are you able to open a powershell window and execute .\curl_test.ps1 after navigating to that folder? Meaning do you need further instructions? I just updated the dev version, it now also prints errors to the console (which it probably does anyway) but I made sure of that, not just piping them to the outfile.

Edit: I just updated the dev version to run the curl_test.ps1 as admin, does that create the folder?

Dirkmuthmann commented 7 years ago

When i open the powershell in the resources\test folder it says script deactivated from system.

CategoryInfo : Sicherheitsfehler: (:) [], PSSecurityException

does that mean my powershell blocks your script?

Eruyome commented 7 years ago

Edit from above comment. I just updated the dev version to run the curl_test.ps1 as admin, does that create the folder? Also added set-executionpolicy remotesigned https://superuser.com/questions/106360/how-to-enable-execution-of-powershell-scripts

Dirkmuthmann commented 7 years ago

yea now a word doc will open after the RunCurlTestPowershellScript.bat It says "ÿþH#T#T#P#/#1#.#1# #2#0#0# #O#K#" does that help?

Eruyome commented 7 years ago

A Word document? Is that your default for .txt files?

Dirkmuthmann commented 7 years ago

yep, but i can easy change it if you want

Dirkmuthmann commented 7 years ago

HTTP/1.1 200 OK Date: Mon, 14 Aug 2017 17:53:41 GMT Content-Type: text/html; charset=utf-8 Connection: keep-alive X-Frame-Options: DENY Content-Encoding: gzip Server: cloudflare-nginx CF-RAY: 38e5c66770ba27b0-FRA

looks better ^^

Eruyome commented 7 years ago

Seems fine, are you still getting those errors/no search results?

Dirkmuthmann commented 7 years ago

yep, checked with and without firewall/antivirus

Eruyome commented 7 years ago

After launching there should be a file temp\cookieData.exe. Could you open a windows console and execute that file? Double clicking also works but it may be easier to see any errors that way since the window stays open. Your issue shouldn't be cookie related but I'm still intrigued why reading temp\cookie_data.txt fails.

Dirkmuthmann commented 7 years ago

there is a exe getCookieData.exe, I started it, new txt file is created called cookie_data with this inside:

useragent=Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729) cfduid=d10f0dadc2e1f4aeadfe9ce9503f600671502735988

Eruyome commented 7 years ago

Weird, your error message claims it failed. Shouldn't be the case. Anyway this shouldn't matter anyway. The curl request from the test script works. So in theory all requests made by the macro should also work.

Dirkmuthmann commented 7 years ago

Weird is the right word :D

Eruyome commented 7 years ago

Here's a dropbox link to a version with added messageboxes. Every curl request to poe.trade shows a box with the used curl command and the response headers. Show me such a messagebox.

Dirkmuthmann commented 7 years ago

this one?

http://fs5.directupload.net/images/170814/5jccpo7m.png

Eruyome commented 7 years ago

So, the test script returns response headers while the macro returns nothing? Interesting. Can you copy the command from the messagebox (just ctrl + c while the window is focused) and execute it in a windows console?

Dirkmuthmann commented 7 years ago

Yeah seams so, I have no idea what to do, if you have an idea im gladly here for you to help :)

Eruyome commented 7 years ago

I asked you to copy the command and execute it in a terminal, don't forget it ;-)

Dirkmuthmann commented 7 years ago

i did but didn´t get anything real from it. I ctrl +c this in the cmd:

curl response

cURL request:

"C:\Users\Kekser\Desktop\poe-testing\lib\curl.exe" -ILks -H "User-Agent:Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8" -H "Accept-Encoding:gzip, deflate" -H "Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4" -H "Connection:keep-alive" -H "Host:poe.trade" -H "Upgrade-Insecure-Requests:1" "http://poe.trade"

Response headers:


OK

Eruyome commented 7 years ago

You pasted the entire thing in? Should I have been more clear that you only paste this part in?

"C:\Users\Kekser\Desktop\poe-testing\lib\curl.exe" -ILks -H "User-Agent:Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8" -H "Accept-Encoding:gzip, deflate" -H "Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4" -H "Connection:keep-alive" -H "Host:poe.trade" -H "Upgrade-Insecure-Requests:1" "http://poe.trade"
Dirkmuthmann commented 7 years ago

yep you should have :) I passed it in, system cant find this path

Eruyome commented 7 years ago

Can you show the exact error message? Can you find the pat manually, does it exist?

Dirkmuthmann commented 7 years ago

I overlooked a " now it worked. heres a picture of the cmd (changed the location of the folder).

Eruyome commented 7 years ago

So you're telling me that this command also works in your console, but not when used from the macro? Or did anything change and it works? I find all of this very weird. That response that you got should also be in the messagebox...

EDIT: Are you using 64 or 32 bit AHK? If you have no idea you could execute this as a .ahk file:

bit := ""
If (A_PtrSize=4) {
    bit := "32"
} Else If (A_PtrSize=8) {
    bit := "64"
}

MsgBox % bit 
Dirkmuthmann commented 7 years ago

The poe-trade marco still doesn´t work. I meant the command.

the massage I get from the box is still:


curl response

cURL request:

"D:\poe-testing\lib\curl.exe" -ILks -H "User-Agent:Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8" -H "Accept-Encoding:gzip, deflate" -H "Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4" -H "Connection:keep-alive" -H "Host:poe.trade" -H "Upgrade-Insecure-Requests:1" "http://poe.trade"

Response headers:


OK

and after that a window opens like 10 times saying this:


_TradeMacroMain.ahk

Exception thrown (download)!

what: file: line: message: extra:

OK

I am not a programmer I don´t know how to execute a .ahk file, if possible i allways install 64bit versions.

I created a txt with your command from the previous post and now, sry i don´t know how to do that.

Eruyome commented 7 years ago

Paste the code into a .ahk file of your choosing, double click it.

Dirkmuthmann commented 7 years ago

Thanks, I have 64 as expected

Dirkmuthmann commented 7 years ago

I have the Problem!

I wrote my the firewall support from Comodo, my firewall, they remotly changed something, seams the firewall was to strict for this macro. Something about the webfilter. Its kinda weard, because I tried to run poe-trade-macro with deactivated firewall and it did't worked. Theams that maybe the firewall changed something, but don't know what.

Dirkmuthmann commented 7 years ago

Thanks to you for your effort and your patience if i get an awnsere form comodo what they changed i will post it here.

Eruyome commented 7 years ago

Hm, any chance you can get to the bottom of this or at least give a slightly better explanation of what happend or may have happend? Could even be in german.

EDIT: That would be nice.

Dirkmuthmann commented 7 years ago

Comodo seems to have a auto-contaiment function, this will execute questionable programms in a sandbox mode.

The changelog form Comodo don't show more information, for more we need to wait for the support form comodo.

Eruyome commented 7 years ago

So basically I can add this to the FAQ, mentioning that some firewalls like Comodo have this and it should be disabled, right? https://help.comodo.com/topic-399-1-790-10323-.html

Dirkmuthmann commented 7 years ago

Yeah, every Firewall that has an active sandbox mode (Comodo called it auto-contaiment mode) will filter the poe-trade-macro.

Thx again for you efford and go on buddy! This macro is gold woth! :*

Eruyome commented 7 years ago

You're welcome, also thanks to you, finding this issue may save a lot of time for others (and especially me, trying to help such these people.