|
@@ -161,19 +161,47 @@ namespace molilian.core
|
|
|
if (response.ResponseMessage != null)
|
|
if (response.ResponseMessage != null)
|
|
|
{
|
|
{
|
|
|
content = response.ResponseMessage.Headers.Location.ToString();
|
|
content = response.ResponseMessage.Headers.Location.ToString();
|
|
|
- content = content.UrlDecode();
|
|
|
|
|
|
|
+ //content = content.UrlDecode();
|
|
|
}
|
|
}
|
|
|
|
|
+ if (string.IsNullOrEmpty(content)) return null;
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case UrlAction.Body:
|
|
case UrlAction.Body:
|
|
|
{
|
|
{
|
|
|
- var response = await new WebClientUtility
|
|
|
|
|
|
|
+ var client = new WebClientUtility
|
|
|
{
|
|
{
|
|
|
Proxy = ProxyNodesCore.RandomOne(),
|
|
Proxy = ProxyNodesCore.RandomOne(),
|
|
|
UserAgent = ProviderFakeUserAgent.RandomMobile,
|
|
UserAgent = ProviderFakeUserAgent.RandomMobile,
|
|
|
AllowAutoRedirect = true
|
|
AllowAutoRedirect = true
|
|
|
- }.RequestAsync(url);
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+ if (!string.IsNullOrEmpty(rule.post))
|
|
|
|
|
+ {
|
|
|
|
|
+ string postData = rule.post;
|
|
|
|
|
+ // 使用现有占位符处理逻辑
|
|
|
|
|
+ if (!string.IsNullOrEmpty(rule.url_pattern))
|
|
|
|
|
+ {
|
|
|
|
|
+ var urlRegex = new Regex(rule.url_pattern);
|
|
|
|
|
+ var urlMatch = urlRegex.Match(text);
|
|
|
|
|
+ if (urlMatch.Success)
|
|
|
|
|
+ {
|
|
|
|
|
+ for (var i = 1; i < urlMatch.Groups.Count; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ string val = urlMatch.Groups[i].Value;
|
|
|
|
|
+ string tempPrompt = string.Empty;
|
|
|
|
|
+ ReplaceProcessing(val, i, rule.replacements, ref postData, ref tempPrompt);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ client.Post(postData);
|
|
|
|
|
+ }
|
|
|
|
|
+ //https://weitoutiao.zjurl.cn/tt_living/?app=news_article&module_name=Android_tt_url&room_id=MDUEDEq2rcgYaV8/SarVCgQTTv3vQwSt/yRnpWHHMzSd1LxjfgQQXTdEOrBDTfdJCzQ+vyO1aQ==&share_did=MS4wLjACAAAASvJER5nlmrwCRfsC2t661YpMGJbq2HtGQS31wppWCCm_j6e1qZ7w9bp94n9T6Ouq&share_token=99222dee-be68-4f79-af9e-c32eff162ea8&share_uid=MS4wLjABAAAA9PBhcsrMuvXb3-0VPXN47TT4TKDHqiZR-LCS4B2BodaRdd7OHm7rl1Xx3SxlLrbn×tamp=1756194703&tt_from=copy_link&upstream_biz=client_share&utm_campaign=client_share&utm_medium=toutiao_android&utm_source=copy_link
|
|
|
|
|
+ //https://weitoutiao.zjurl.cn/tt_living/?app=news_article&module_name=Android_tt_url&room_id=MDUEDEq2rcgYaV8%2FSarVCgQTTv3vQwSt%2FyRnpWHHMzSd1LxjfgQQXTdEOrBDTfdJCzQ%2BvyO1aQ%3D%3D&share_did=MS4wLjACAAAASvJER5nlmrwCRfsC2t661YpMGJbq2HtGQS31wppWCCm_j6e1qZ7w9bp94n9T6Ouq&share_token=99222dee-be68-4f79-af9e-c32eff162ea8&share_uid=MS4wLjABAAAA9PBhcsrMuvXb3-0VPXN47TT4TKDHqiZR-LCS4B2BodaRdd7OHm7rl1Xx3SxlLrbn×tamp=1756194703&tt_from=copy_link&upstream_biz=client_share&utm_campaign=client_share&utm_medium=toutiao_android&utm_source=copy_link
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ var response = await client.RequestAsync(url);
|
|
|
|
|
+
|
|
|
content = response.Body();
|
|
content = response.Body();
|
|
|
|
|
+ if (string.IsNullOrEmpty(content)) return null;
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case UrlAction.None:
|
|
case UrlAction.None:
|
|
@@ -472,12 +500,31 @@ namespace molilian.core
|
|
|
case UrlAction.Body:
|
|
case UrlAction.Body:
|
|
|
case UrlAction.JsonBody:
|
|
case UrlAction.JsonBody:
|
|
|
{
|
|
{
|
|
|
- var response = await new WebClientUtility
|
|
|
|
|
|
|
+ //var response = await new WebClientUtility
|
|
|
|
|
+ //{
|
|
|
|
|
+ // Proxy = ProxyNodesCore.RandomOne(),
|
|
|
|
|
+ // UserAgent = ProviderFakeUserAgent.RandomMobile,
|
|
|
|
|
+ // AllowAutoRedirect = true
|
|
|
|
|
+ //}.RequestAsync(url);
|
|
|
|
|
+
|
|
|
|
|
+ var client = new WebClientUtility
|
|
|
{
|
|
{
|
|
|
Proxy = ProxyNodesCore.RandomOne(),
|
|
Proxy = ProxyNodesCore.RandomOne(),
|
|
|
UserAgent = ProviderFakeUserAgent.RandomMobile,
|
|
UserAgent = ProviderFakeUserAgent.RandomMobile,
|
|
|
AllowAutoRedirect = true
|
|
AllowAutoRedirect = true
|
|
|
- }.RequestAsync(url);
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+ if (!string.IsNullOrEmpty(resource.post))
|
|
|
|
|
+ {
|
|
|
|
|
+ string postData = resource.post;
|
|
|
|
|
+ // 处理POST数据中的占位符
|
|
|
|
|
+ for (var i = 1; i < baseMatch.Groups.Count; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ string val = baseMatch.Groups[i].Value;
|
|
|
|
|
+ ReplaceProcessing(val, i, replacements, ref postData, ref prompt_text);
|
|
|
|
|
+ }
|
|
|
|
|
+ client.Post(postData);
|
|
|
|
|
+ }
|
|
|
|
|
+ var response = await client.RequestAsync(url);
|
|
|
content = response.Body();
|
|
content = response.Body();
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
@@ -613,5 +660,4 @@ namespace molilian.core
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|