ugetdm / uget-integrator

Native messaging host to integrate uGet Download Manager with web browsers
GNU General Public License v3.0
339 stars 38 forks source link

How I can debug or show the command ? #97

Open hamedsbt opened 3 years ago

hamedsbt commented 3 years ago

I'm working on this .py to modify and use it for other application (ida.exe), but the cookie does not pass. so I need to debug as much as simple method because I'm not python developer.

What is data['Cookies'] structure? How I can use it as semicolon separated string? such as: lang=1; __auc=ee93572e1756eba4fd19030b82d; _ga=GA1.2.1558898317.1603880505; _gid=GA1.2.118992954.1603880505;

Antorell commented 3 years ago

It breaks down cookies to Netscape cookies format. It's the javascript in the addon that does it, the py just breaks down and export to a text what the javascript addon fed it.

https://docs.funnelback.com/collections/collection-types/web/web-crawler-settings/cookies_txt.html

function parseCookies(cookies_arr) {
    cookies = '';
    for (var i in cookies_arr) {
        cookies += cookies_arr[i].domain + '\t';
        cookies += (cookies_arr[i].httpOnly ? "FALSE" : "TRUE") + '\t';
        cookies += cookies_arr[i].path + '\t';
        cookies += (cookies_arr[i].secure ? "TRUE" : "FALSE") + '\t';
        cookies += Math.round(cookies_arr[i].expirationDate) + '\t';
        cookies += cookies_arr[i].name + '\t';
        cookies += cookies_arr[i].value;
        cookies += '\n';
    }
    message.Cookies = cookies;
    sendMessageToHost(message);
}

https://github.com/ugetdm/uget-extension/blob/b60810f63eed118f71db190f60bd90aea9633f6b/extension/background.js#L623

hamedsbt commented 3 years ago

Thank you for your reply. I don't have google account and I'm not interested to enable extension debug mode on my chromium-edge browser. Can you deploy a version with cookies as semicolon separated string for IDA application please?

example: ida.exe URL [REFERER] [urloption=value] ... [urloption=value] ida.exe example.host/file.zip "example.host/host" cookies="lang=1; __auc=ee931756eb; _ga=GA198317"