Giter Club home page Giter Club logo

Comments (5)

KoalaBear84 avatar KoalaBear84 commented on June 18, 2024 1

Released: https://github.com/KoalaBear84/OpenDirectoryDownloader/releases/tag/v2.3.0.1

from opendirectorydownloader.

4censord avatar 4censord commented on June 18, 2024

More specific it crashes in this section:

if (string.IsNullOrEmpty(openDirectoryIndexerSettings.Username) && string.IsNullOrEmpty(openDirectoryIndexerSettings.Password))
{
if (Library.GetUriCredentials(new Uri(url), out string username, out string password))
{
Console.WriteLine($"Using username '{username}' and password '{password}'");
openDirectoryIndexerSettings.Username = username;
openDirectoryIndexerSettings.Password = password;
}
}

It tries to extract a username and password from the provided url
(127.0.0.1), and not the sanitized url that is created here

Console.WriteLine($"URL specified: {url}");
string newUrl = Library.FixUrl(url);
if (newUrl != url)
{
Console.WriteLine($"URL fixed : {newUrl}");
}
openDirectoryIndexerSettings.Url = newUrl;

from opendirectorydownloader.

Chaphasilor avatar Chaphasilor commented on June 18, 2024

Hmm, it looks likes this function isn't returning false when it should be:

public static bool GetUriCredentials(Uri uri, out string username, out string password)
{
username = null;
password = null;
if (uri.UserInfo?.Contains(':') == true)
{
string[] splitted = uri.UserInfo.Split(':');
username = WebUtility.UrlDecode(splitted.First());
password = WebUtility.UrlDecode(splitted.Last());
return true;
}
return false;
}

The issue appeared after v2.1.0.0, I'm guessing right after it with this commit: 5f08d02#diff-28bad5a72dee380228016222e2442b1cc7bbd86b59e16653038c9b8fdce2b2be

from opendirectorydownloader.

4censord avatar 4censord commented on June 18, 2024

I think the crash happens in the call to new Uri(url), an not the GetUriCredentials function.

Uri uri = new Uri(url); // <= crash here
if (Library.GetUriCredentials(uri, out string username, out string password))
{
	Console.WriteLine($"Using username '{username}' and password '{password}'");
	openDirectoryIndexerSettings.Username = username;
	openDirectoryIndexerSettings.Password = password;
}

from opendirectorydownloader.

KoalaBear84 avatar KoalaBear84 commented on June 18, 2024

Thanks, I see I was not using the 'fixed' url. 👍

from opendirectorydownloader.

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.