|
@@ -252,6 +252,14 @@ namespace molilian.core
|
|
|
item.exposeTracks = TracksCore.BuildBrwSimilarPath(TrackType.Expose, result, item, i);
|
|
item.exposeTracks = TracksCore.BuildBrwSimilarPath(TrackType.Expose, result, item, i);
|
|
|
item.pic = NormalizeAlicdnImageUrl(item.pic);
|
|
item.pic = NormalizeAlicdnImageUrl(item.pic);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ DateTime now = DateTime.Now;
|
|
|
|
|
+ if (now < new DateTime(2026, 8, 22))
|
|
|
|
|
+ {
|
|
|
|
|
+ _ = new LoggerLibrary("AlimamaPlus", "PromotionImageCount")
|
|
|
|
|
+ .Info(now.ToString("yyyy-MM-dd HH:mm:ss.fff"), i.ToString())
|
|
|
|
|
+ .SaveAsync();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
result.pic = NormalizeAlicdnImageUrl(result.pic);
|
|
result.pic = NormalizeAlicdnImageUrl(result.pic);
|
|
@@ -306,8 +314,10 @@ namespace molilian.core
|
|
|
{
|
|
{
|
|
|
return items.Count > 0 ? items.Skip(1).ToList() : [];
|
|
return items.Count > 0 ? items.Skip(1).ToList() : [];
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
string requestUrl = "https://similar.molilian.com/api/unsafePromotionQuery";
|
|
string requestUrl = "https://similar.molilian.com/api/unsafePromotionQuery";
|
|
|
- string targetPic = pic.StartsWith("//") ? $"https:{pic}" : pic;
|
|
|
|
|
|
|
+ string targetPic = NormalizeAlicdnImageUrl(pic.StartsWith("//") ? $"https:{pic}" : pic, 1200);
|
|
|
|
|
+
|
|
|
object postData = new
|
|
object postData = new
|
|
|
{
|
|
{
|
|
|
url = targetPic,
|
|
url = targetPic,
|
|
@@ -365,9 +375,13 @@ namespace molilian.core
|
|
|
return [];
|
|
return [];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private static string NormalizeAlicdnImageUrl(string pic)
|
|
|
|
|
|
|
+ private static string NormalizeAlicdnImageUrl(string pic, int size = 400)
|
|
|
{
|
|
{
|
|
|
- const string formatSuffix = "_400x400q90.jpg_.webp";
|
|
|
|
|
|
|
+ string formatSuffix = size switch
|
|
|
|
|
+ {
|
|
|
|
|
+ 1200 => "_1200x1200q90.jpg_.webp",
|
|
|
|
|
+ _ => "_400x400q90.jpg_.webp"
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(pic))
|
|
if (string.IsNullOrWhiteSpace(pic))
|
|
|
{
|
|
{
|
|
@@ -379,7 +393,7 @@ namespace molilian.core
|
|
|
return pic;
|
|
return pic;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (pic.Contains(formatSuffix, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
|
+ if (Regex.IsMatch(pic, @"_\d+x\d+q\d+\.jpg_\.webp(?:[?#].*)?$", RegexOptions.IgnoreCase))
|
|
|
{
|
|
{
|
|
|
return pic;
|
|
return pic;
|
|
|
}
|
|
}
|
|
@@ -793,6 +807,7 @@ namespace molilian.core
|
|
|
case "tbpush":
|
|
case "tbpush":
|
|
|
case "brwsimilar":
|
|
case "brwsimilar":
|
|
|
case "icon":
|
|
case "icon":
|
|
|
|
|
+ case "req":
|
|
|
if (IsDigitsOnly(content))
|
|
if (IsDigitsOnly(content))
|
|
|
{
|
|
{
|
|
|
content = $"https://item.taobao.com/item.htm?id={content}";
|
|
content = $"https://item.taobao.com/item.htm?id={content}";
|