AlexxEG/YouTube-Downloader

Sign-in video login bug

Closed this issue ยท 22 comments

YTDAuthentication username and password accepts null or empty

But the LoginWindow closes after OK btn is clicked.

It doesn't for me. It only closes when username and password fields is not empty.

Maybe you're thinking about Two Factor? That is optional, so it can be empty.

It throws the error properly for me but the loginwindow exits

Does it throw this error:
throw new Exception($"{this.GetType().Name}: {nameof(username)} and {nameof(password)} can't be empty or null.");

Or the red line of text above the buttons?

the exception windows appears but when i click continue button the loginwindow disappears

Hmm, an exception window shouldn't appear. What does it say?

This is what it should look like when you try to click OK with empty fields:
image

No this windows appears
screenshot 4

but when hit continue the login windows disappears

Can you check if your local LoginDialog.cs file is up to date?

It should have a private void btnOK_Click(object sender, EventArgs e) which does a null check. You shouldn't be seeing that window.

It should have this part:
image

yup its there!

but i have problem here

`if (videoInfo.RequiresAuthentication)
{
var auth = Dialogs.LoginDialog.Show(this);

            if (auth != null)
            {
                _auth = auth;
                btnGetVideo_Click(bwGetVideo, EventArgs.Empty);
                return;
            }
        }
        else if (videoInfo.Failure)
        {
            MessageBox.Show(this, "Couldn't retrieve video. Reason:\n\n" + videoInfo.FailureReason);
        }`

the login windows does not appear but when i make it this way the login windows appears

`if (videoInfo.RequiresAuthentication||videoInfo.Failure)
{
var auth = Dialogs.LoginDialog.Show(this);

            if (auth != null)
            {
                _auth = auth;
                btnGetVideo_Click(bwGetVideo, EventArgs.Empty);
                return;
            }
        }
        else if (videoInfo.Failure)
        {
            MessageBox.Show(this, "Couldn't retrieve video. Reason:\n\n" + videoInfo.FailureReason);
        }`

Hmm, this makes no sense.

Can you also check if you have this line in your local LoginDialog.Designer.cs
Line 97: this.btnOK.Click += new System.EventHandler(this.btnOK_Click);

to make sure the event handler is actually being used.

yes i have it

I don't know why you're getting an error then. The exception gets thrown here, since it's given empty username/password:

image

But there is a null check in btnOK_Click here:

image

So that error should never get thrown. This has to be something on your side I believe.

i get this window with this text YouTube said: This video contains content from contained in it

so i changed the error filter in YoutubeDlHelper.cs class

after this the login window appears but still i get this
screenshot 4

the blocked video requires sign-in to confirm age

yes i solved the whole thing ๐Ÿ‘

just changed btnOK.DialogResult to None by default

Good ๐Ÿ‘

I added a check for age gated content, so login should prompt for that also now. I didn't notice it since the error just says it's blocked, nothing about being age gated.

are you working on the feature max no. of queues to download at a time?

Yeah I am. I have a branch on my computer where I'm working on it. It just takes a while since I have to rework quite a lot of stuff.

hmmmm. ๐Ÿ‘