Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Fix 400 Bad Request when login with username and password #382

Closed
wants to merge 1 commit into from
Closed

Fix 400 Bad Request when login with username and password #382

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 29, 2019

Issue: #341

Fixed, tested on Python 2.7.16 and 3.7.2

a

@r0oth3x49
Copy link
Owner

r0oth3x49 commented Apr 29, 2019

With few request you will be facing 403 forbidden.this was my old solution if you check earlier versions of udemy-dl i was authenticating the same way and is not a permanent solution so i will stick to the cookie based for now until unless i don't find a permanent solution

@r0oth3x49 r0oth3x49 closed this Apr 29, 2019
@ghost
Copy link
Author

ghost commented Apr 29, 2019

@r0oth3x49 lol, you like close everything . No, it's not the same, feel free to test it. But test like a human, not like a machine, and make requests like crazy.

I tested this method for like a week, make request to login like every 30 seconds and everything is fine. Because it just make 2 requests and it's done its job, no need that request to login anymore.

If you login like 30 times like crazy (i don't know why you do that ?), maybe you will get 403, just wait 10 or 15 minutes and you good to go.

@r0oth3x49
Copy link
Owner

r0oth3x49 commented Apr 29, 2019

I know you are humble to download thing, i might also be but there are many users who just want to download all the courses at once, and if they face 403 error they don't even look if this is discussed or not directly go with new issue creating, for me which is wasting time on explaining them that they have to wait for a while. Just take a look at old issues. Don't mind, I know you are a very active contributor & i love + appreciate your work to keep things upto date. thanks for that bro 👍

@ghost
Copy link
Author

ghost commented Apr 29, 2019

@r0oth3x49 no, i told you, use like a human, not a machine, and think that way, and i know about the old days when you use the same url (kind of) like i use right now, but i told you, it's not the same.

And i tested it for you just now, make 6 tabs terminal at the same time, different accounts, different course. (even human don't do that, you try to rip course and upload illegal or what?) and everything is fine.

And you said if they get an error (if they're not human), just tell them to use cookie, why would tell them to wait, like the situation happen before i commit this fix.

And talking about that, UnicodeError like another post i made, i didn't even know that --unsafe flag even a thing, and now if they didn't use it, they will get a blank txt file, god know what error it is, and we find out what error it is, just tell them to use that flag, easy

@r0oth3x49
Copy link
Owner

r0oth3x49 commented Apr 29, 2019

I have clearly mentioned --unsafe switch in README Features about that switch so please if you are fixing some issues take a look if the fix don't break other functionalities.

in earlier issues many have faced the issue and i have discussed the solution to this unicodeerror by explaining them to use --unsafe switch.

@ghost
Copy link
Author

ghost commented Apr 29, 2019

@r0oth3x49 when @talhashoaib report that issue, did you know that is an Unicode error? You don't, right? Because of that FileNotFoundError, i manage to know about the error, and even that --unsafe flag.

People just looking for what they need, even that cookie thing you already write tag and guide but you see, so many people asking for help and don't even try to login with cookie because they don't care. I have a username and password, so let me in, if you don't, i will find you ........ and ask you.

I thought about that tho, that's why i don't remove that unsafe checker everywhere like i did with that useless 'client_id' in cookie file.

@ghost
Copy link
Author

ghost commented Apr 29, 2019

In your old commits, you often get 403 error because you didn't config HEADERS the right way, i got that issue too (with incorrectly HEADERS like your old commits) and the ban is shorter, like 5 minutes, that why you output "Please wait a few minutes". But with this fix, that doesn't happen, you do get 403 error (but not for a normal use) and the time get longer because you acted like a robot, login like 30 times in just a blink, ban about 10 or 15 minutes.

r0oth3x49 added a commit that referenced this pull request Apr 30, 2019
…his fix) who fixed the issue in #382 PR, updated code quality
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant