elvis972602 / Kemono-scraper

A simple downloader to download media from kemono.party
MIT License
185 stars 10 forks source link

Issue with getting cookies to work #14

Closed alanek2002 closed 1 year ago

alanek2002 commented 1 year ago

after some finagling, I've gotten it to latch onto my cookie correctly, as best I can tell;

The relevant bit from the cmd window... \cookies.sqlite --fav-site kemono --fav-creator 1 2023/07/02 10:42:17 searched 11115 files 2023/07/02 10:42:17 found cookie database 2023/07/02 10:42:17 searched 11115 files 2023/07/02 10:42:17 found local state file 2023/07/02 10:42:17 fetching favorite creators from kemono.party 2023/07/02 10:42:19 Error getting favorites: 401

But I have no idea how to move past that 401 error. I'm having it pull the cookie directly from my firefox profile folder (located through firefox, cookies.sqlite shows last updated 1 min ago.)

It's worked wonderful for downloading from a single creator at a time, though I was hoping to set it to run by itself.

Thank you for the program!

elvis972602 commented 1 year ago

Use sqlite file as cookie file is not support so it still try to get cookie from browser The default browser is chrome ,do you have a setting to get cookies from firefox?

alanek2002 commented 1 year ago

I did try just telling it firefox, though it didn't work either.

kemono scraper>kemono-scraper.exe --cookie-browser firefox --fav-site kemono --fav-creator 1 2023/07/02 10:21:25 searched 48007 files 2023/07/02 10:21:25 found cookie database 2023/07/02 10:21:25 cookie is empty

I figured it might have been trying to pull from an old profile folder since this computers been around a few years. That is when I turned to trying to directly path the cookies file.

edit: Tried to tell it just the profile path; got the same response as telling it cookies.sqlite directly. edit2: logged in via chrome, and was able to begin downloading by telling it browser: chrome

elvis972602 commented 1 year ago

When I first tried it I also encountered a 401 problem caused by an expired cookie, I checked the path to the database it was looking for and it is located in ~/Roaming\Mozilla\Firefox\Profiles\gjw173j2.default-release\cookies.sqlite in my computer which is the correct path, then I opened the page with firefox and logged in successfully, but still not work .

I found that cookies.sqlite-wal and cookies.sqlite-shm are also used as databases when the browser is opening and merged with cookies.sqlite when you close it, so I closed the browser and get the correct cookie.

I'm not sure if this is the cause of your error, but it is a problem that should be fixed, if it still doesn't work after closing the browser, feel free to contact me, thank you very much for your feedback!

alanek2002 commented 1 year ago

That may be most of the issue; Firefox has set my profile location to D drive and under program data, for some reason. So it's not under roaming at all; old profile there was last updated in 2018 as far as cookies go,

So it's most likely going to need me to keep going to chrome to refresh the cookie when I try to run the downloader; because my setup is odd. :P Which isn't any trouble, now that I know it works.

(This is probably something I did to it when rebuilding my computer, and explains pretty much everything.)

Thank you for your help!