GithubHelp home page GithubHelp logo

Comments (7)

vogler avatar vogler commented on May 26, 2024 1

I had that initially: e34a5fe
The problem with storageState instead of launchPersistentContext was that you had to login again much sooner.
I don't know what launchPersistentContext saves besides cookies that's relevant here.
Maybe it refreshes the cookies every time but storageState only stores them when the browser exits successfully.

from free-games-claimer.

vogler avatar vogler commented on May 26, 2024 1

The issue with using userDataDir is that, we can't use more than 1 account. It would be nice to make it so it can collect multiple accounts at once, but it is hard to dockerize.

Could make the directory an option and have a userDataDir for each user.
The storageState was some json file containing the cookies, so it wouldn't be much different.

If the cookies only expire after a month, I think it's fine because we are collecting (and refreshing the token) every week.

I think it was more like on every start. But maybe that had to do with playwright not writing out the refreshed cookies.
I'll make a PR with storageState added back as an additional option, then we can check.

from free-games-claimer.

vogler avatar vogler commented on May 26, 2024 1

I think the problem may have been that storageState just restores cookies, but otherwise it's a fresh browser which probably has some different fingerprint they check and then ask you to login earlier than with launchPersistentContext.

from free-games-claimer.

jackblk avatar jackblk commented on May 26, 2024 1

Hmm interesting. I think if we run it in Docker, the fingerprint should be identical.

I'll try implementing storageState and sessionStorage, maybe it will work - TODO.

Refs:

from free-games-claimer.

vogler avatar vogler commented on May 26, 2024

Currently the script will save userDataDir to reuse next time, this is inefficient and very hard to dockerize

What's hard about it? Can't you define a shared directory?

It's working with no captcha when we disable headless, so I think this is the best approach so far.

Can you open a (draft) PR?

from free-games-claimer.

jackblk avatar jackblk commented on May 26, 2024

Sure, I'll make a draft PR when I finish my approach.

The issue with using userDataDir is that, we can't use more than 1 account. It would be nice to make it so it can collect multiple accounts at once, but it is hard to dockerize. Sorry it was confusing, I edited the issue.

If the cookies only expire after a month, I think it's fine because we are collecting (and refreshing the token) every week.

from free-games-claimer.

vogler avatar vogler commented on May 26, 2024

Closing this. The whole browser profile is ~64MB and needs no extra care for cookie refresh, fingerprinting etc.

from free-games-claimer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.