techtanic / Discounted-Udemy-Course-Enroller

A script/software for automatically enrolling/joining 100% discounted Udemy courses for free. Get Paid Udemy courses for free with just a few clicks.
https://duce.techtanic.space
MIT License
785 stars 227 forks source link

fix: fixed issue where requesting through s throws an error #156

Open AL-Hareth opened 12 months ago

AL-Hareth commented 12 months ago

the problem previously was that you were passing session as a named variable with the wrong name like this:

s = cloudscraper.create_scraper(session=s)

but if we look at the signature of the create_scraper function we find that it looks like this

def create_scraper(
    sess: Unknown | None = None,
    **kwargs: Unknown
) -> CloudScraper

so to fix this problem we can either pass the session anonymously like what i did in the pull request or we can use the proper name of the argument

s = cloudscraper.create_scraper(s)

or

s = cloudscraper.create_scraper(sess=s)

And I renamed the variable just to keep the old variable because mutating it can be bad in some cases