temu客户端上传功能 2.拼多多商品提取问题修复(25%)

This commit is contained in:
wule committed 2025-12-12 19:34:16 +08:00
1 parent 2bb124e2d7
commit 62465769fe
13 files changed
+402 -210

No files matched your search

@@ -1,5 +1,6 @@
using AllBase;
using AllBase.Helper;
using AllBase.Model.Param.PDDProdParam;
using AllBase.Model.Result;
using AllBase.Model.Result.PDDResult;
using NaiBa.Util.Extension;
@@ -182,7 +183,21 @@ namespace TemuKJD.PDDForms.ShopForms
OnInfoReceived("商品获取失败!商品详情图获取失败!" + ex.Message);
return;
}
if (decoration == null)
//if (decoration != null && decoration_json.ParseToString().Length < 20)
//{
// try
// {
// var prod_detail_decoration_rst = GetPddProdDetail(sourceShop, sourceProdId.ToString(), commitId);
// }
// catch (Exception ex)
// {
// OnInfoReceived("商品获取失败!商品详情图获取失败!" + ex.Message);
// return;
// }
//}
if (decoration == null || decoration_json.ParseToString().Length < 20)
{
OnInfoReceived("商品获取失败!商品详情图获取失败!");
return;
@@ -607,6 +622,68 @@ namespace TemuKJD.PDDForms.ShopForms
}
return result;
}
private string GetPddProdOnShopDetail(ShopLoginInfo shop, string prodId, string commitId)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/glide/v2/mms/query/commit/on_shop/detail"; //获取详情图
//string url = "https://mms.pinduoduo.com/glide/v2/mms/query/commit/detail";
//string body = @"{""goods_id"":" + prodId + "}";
string body = @"{""goods_commit_id"":""" + commitId + @""",""goods_id"":""" + prodId + @"""}";
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
{
shop.AntiContents.Remove(anti);
anti = shop.AntiContents.FirstOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
{
Thread.Sleep(Randomx.GetId(300, 500));
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
}
}
return result;
}
/// <summary>
/// 保存商品详情图装修列表
/// gorse/mms/goods/decoration/commit/save
/// </summary>
/// <param name="shop"></param>
/// <param name="decoration"></param>
/// <param name="goodsId"></param>
/// <param name="commitId"></param>
/// <returns></returns>
private string save_decoration(ShopLoginInfo shop, PDDProdDecorationCommitParam decoration, string goodsId, string commitId)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/gorse/mms/goods/decoration/commit/save";
string body = @"{""goods_id"":" + goodsId + "}";
body = JsonHelper.SerializeObject(decoration);
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + goodsId + "&type=edit";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
{
shop.AntiContents.Remove(anti);
anti = shop.AntiContents.FirstOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
{
Thread.Sleep(Randomx.GetId(300, 500));
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
}
}
return result;
}
private string GetPddProdSizeSpec(ShopLoginInfo shop, string prodId, string commitId, string sizeSpecId)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
@@ -658,6 +735,7 @@ namespace TemuKJD.PDDForms.ShopForms
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/gorse/mms/goods/decoration/commit/query/V2";
url = "https://mms.pinduoduo.com/gorse/mms/goods/decoration/commit/query/V2";
string body = @"{""goods_commit_id"":" + commitId + @",""goods_id"":" + prodId + @"}";
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);