- Регистрация
- 15.05.2017
- Сообщения
- 437
- Благодарностей
- 104
- Баллы
- 43
Hello, I am downloading images with such code -
In the logs we get an error-
I guess it is happening because the file is named ~c5_1080x1080.jpeg
So the question is, how to choose a different file name when saving the file?
Thank you
C#:
var captcha__get = ZennoPoster.HTTP.Request (
ZennoLab.InterfacesLibrary.Enums.Http.HttpMethod.GET,
url: "https://p77-sign-va.tiktokcdn.com/tos-maliva-avt-0068/8c67814a897e484c91b15421bddc2e50~c5_1080x1080.jpeg?x-expires=1658527200&x-signature=Up7ipaA%2FzsFJRwNWGcPgQKXfDnk%3D",
// proxy: project.Variables["proxy"].Value,
respType: ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.File,
Timeout: 50000,
UserAgent: project.Profile.UserAgent,
// DownloadPath: project.Variables["saveImgPath"].Value);
DownloadPath: project.Directory);
// cookieContainer: Project.Profile.CookieContainer;
var image = System.Drawing.Image.FromFile(@captcha__get);
string base64String = String.Empty;
using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
{
image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
byte[] imageBytes = ms.ToArray();
base64String = Convert.ToBase64String(imageBytes);
}
//отправляем капчу на решение
var result = ZennoPoster.CaptchaRecognition(project.Variables["capchaService"].Value, base64String, "");
I guess it is happening because the file is named ~c5_1080x1080.jpeg
So the question is, how to choose a different file name when saving the file?
Thank you
