We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在 multi_download 中设置settings 的save_path字段不起作用,文件还是被存放到默认路径。经过查看源代码,发现 std::string multi_download::file_name() 函数有点小问题。下面是修改后的: std::string multi_download::file_name() const { // 如果文件名为空, 则生成默认文件名. if (m_file_name.empty()) { // 构造默认文件名. 如果url中的文件名为空, 那么就默认为index.html, 否则 // 使用url中指定的文件名, 除非settings指定了保存文件路径及文件名. m_file_name = fs::path(detail::utf8_ansi(m_final_url.path())).leaf().string(); if (m_file_name == "/" || m_file_name == "") m_file_name = fs::path(m_final_url.query()).leaf().string(); if (m_file_name == "/" || m_file_name == "" || m_file_name == ".") m_file_name = "index.html"; }
if (!m_settings.save_path.empty()) { if (fs::is_directory(m_settings.save_path)) { fs::path p = m_settings.save_path / m_file_name; if (m_file_name != p.string()) { m_file_name = p.string(); } } else { m_file_name = m_settings.save_path.string(); } } return m_file_name;
} 这样设置save_path就起作用了,修改后还没发现别的问题,希望作者审核下。
The text was updated successfully, but these errors were encountered:
能否提交个pull request或patch?
Sorry, something went wrong.
No branches or pull requests
在 multi_download 中设置settings 的save_path字段不起作用,文件还是被存放到默认路径。经过查看源代码,发现 std::string multi_download::file_name() 函数有点小问题。下面是修改后的:
std::string multi_download::file_name() const
{
// 如果文件名为空, 则生成默认文件名.
if (m_file_name.empty())
{
// 构造默认文件名. 如果url中的文件名为空, 那么就默认为index.html, 否则
// 使用url中指定的文件名, 除非settings指定了保存文件路径及文件名.
m_file_name = fs::path(detail::utf8_ansi(m_final_url.path())).leaf().string();
if (m_file_name == "/" || m_file_name == "")
m_file_name = fs::path(m_final_url.query()).leaf().string();
if (m_file_name == "/" || m_file_name == "" || m_file_name == ".")
m_file_name = "index.html";
}
}
这样设置save_path就起作用了,修改后还没发现别的问题,希望作者审核下。
The text was updated successfully, but these errors were encountered: