Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Windows support, Fixed UnicodeDecode error and made some improvements #110

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Af7eR9l0W
Copy link
Contributor

@Af7eR9l0W Af7eR9l0W commented Jun 2, 2023

Made a few improvements. Tested on Windows, Kali and Mint. Hopefully there aren't any oversights. I Started by adding Windows support, which inadvertently ended up fixing a lot of problems for linux and macos as well.
Changes:

  • Windows support
    Because cmd prompt and powershell do env variables differently, this required figuring out which one the user is using. Then changing the console outputs to reflect which cli the user is using. (this includes macos and linux, it always outputs the correct command)

  • Removed pycookiecheat in favor of browser_cookie3
    Initially browser_cookie3 was implemented for windows users since pycookiecheat is macos/linux only. However upon further investigation, the utf decode issues on macos and linux are caused by pycookiecheat. Changing the code to use browser_cookie3 fixed these issues

  • code rewrite
    Since the code needs to check if the user is on windows and whether or not theyre using cmd prompt, it was easier to break the code down the into multiple functions. This allows for much more control and cleaner output. It's also slightly annoying to look at

  • Exclusion Filter
    There is now one variable that controls which field you wish to remove from the final output. Updating this as time goes on will make troubleshooting easier for everyone. Hopefully this solves some of the tuple errors

Made a few improvements. Started by adding Windows support, which inadvertently ended up fixing a lot of problems for linux and macos as well.
Changes:
- Windows support
Because cmd prompt and powershell do env variables differently, this required figuring out which one the user is using. Then changing the console outputs to reflect which cli the user is using. (this includes macos and linux, it always outputs the correct commanad)

-Removed pycookiecheat in favor of browser_cookie3
Initially browser_cookie3 was implemented for windows users since pycookiecheat is macos/linux only. However upon further investigation, the utf decode issues on macos and linux are caused by pycookiecheat. Changing the code to use browser_cookie3 fixed these issues

-code rewrite
Since the code now needs to check if the user in on windows and whether or not theyre using cmd prompt, it was easier to break down the code into multiple functions. This allows for much more control and cleaner output. 

-Exclusion Filter
There is now one variable to control what parts you want to remove from the final printout. Updating this as time goes on will make troubleshooting easier for everyone. Hopefully this solves the majority of "me me cookie no work" posts 

Just in case I forget, browser_cookie3 needs to be added to the requirements and the script in the repo's root directory also need to be changed.
Made a few improvements. Started by adding Windows support, which inadvertently ended up fixing a lot of problems for linux and macos as well.
Changes:
- Windows support
Because cmd prompt and powershell do env variables differently, this required figuring out which one the user is using. Then changing the console outputs to reflect which cli the user is using. (this includes macos and linux, it always outputs the correct commanad)

-Removed pycookiecheat in favor of browser_cookie3
Initially browser_cookie3 was implemented for windows users since pycookiecheat is macos/linux only. However upon further investigation, the utf decode issues on macos and linux are caused by pycookiecheat. Changing the code to use browser_cookie3 fixed these issues

-code rewrite
Since the code now needs to check if the user in on windows and whether or not theyre using cmd prompt, it was easier to break down the code into multiple functions. This allows for much more control and cleaner output. 

-Exclusion Filter
There is now one variable to control what parts you want to remove from the final printout. Updating this as time goes on will make troubleshooting easier for everyone. Hopefully this solves the majority of "me me cookie no work" posts 

Just in case I forget, browser_cookie3 needs to be added to the requirements and the script in the repo's root directory also need to be changed.
@Af7eR9l0W
Copy link
Contributor Author

Forgot to mention that the url used for looking up cookies isn't the same one used in the url variable. Chrome on Windows stores the domain name without the wildcards. So the url used in the variable doesn't work on Windows. For reasons im not entirely sure, just using openai.com works on both linux and windows.

@GreyDGL
Copy link
Owner

GreyDGL commented Jun 3, 2023

The solution looks perfect! Thanks for the contribution. I'll test it with your branch and merge the code if everything works.

@GreyDGL
Copy link
Owner

GreyDGL commented Jun 3, 2023

I just did some local testing, but it does not work on MacOS native terminal + Chrome. I'll debug on Ubuntu and see what is the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants