temu客户端程序
This commit is contained in:
commit
4aaf264e89
694 files changed
+263780
No files matched your search
@@ -0,0 +1,216 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Helper
|
||||
{
|
||||
public class CommonSimRequest
|
||||
{
|
||||
public string Accept { get; set; } = "application/json, text/plain, */*";
|
||||
public string ContentType { get; set; } = "application/x-www-form-urlencoded";
|
||||
public string UserAgent { get; set; } = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36";
|
||||
public Encoding Encoding { get; set; } = Encoding.UTF8;
|
||||
|
||||
public string Request_Get(string url, string referer, Dictionary<string, string> headers, string cookies)
|
||||
{
|
||||
HttpWebResponse response = null;
|
||||
string responseText = "";
|
||||
if (headers == null)
|
||||
headers = new Dictionary<string, string>();
|
||||
|
||||
try
|
||||
{
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
|
||||
request.KeepAlive = true;
|
||||
request.Accept = Accept;
|
||||
request.UserAgent = UserAgent;
|
||||
request.ContentType = ContentType;
|
||||
foreach (var key in headers.Keys)
|
||||
{
|
||||
request.Headers.Add(key, headers[key]);
|
||||
}
|
||||
request.Referer = referer;
|
||||
request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
|
||||
request.Headers.Set(HttpRequestHeader.AcceptLanguage, "en-US,en;q=0.9");
|
||||
request.Headers.Set(HttpRequestHeader.Cookie, cookies);
|
||||
|
||||
response = (HttpWebResponse)request.GetResponse();
|
||||
}
|
||||
catch (WebException e)
|
||||
{
|
||||
if (e.Status == WebExceptionStatus.ProtocolError) response = (HttpWebResponse)e.Response;
|
||||
else responseText = "error," + e.Message;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responseText = "error," + ex.Message;
|
||||
}
|
||||
if (response != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(responseText))
|
||||
responseText = ReadResponse(response, this.Encoding);
|
||||
response.Close();
|
||||
}
|
||||
|
||||
return responseText;
|
||||
}
|
||||
|
||||
public string Request_Post(string url, string referer, Dictionary<string, string> headers, string cookies, string data, bool isSetCommonHeaders = true)
|
||||
{
|
||||
HttpWebResponse response = null;
|
||||
string responseText = "";
|
||||
if (headers == null)
|
||||
headers = new Dictionary<string, string>();
|
||||
|
||||
try
|
||||
{
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
|
||||
request.KeepAlive = true;
|
||||
request.Accept = Accept;
|
||||
request.UserAgent = UserAgent;
|
||||
request.ContentType = ContentType;
|
||||
if (isSetCommonHeaders)
|
||||
{
|
||||
if (!headers.Keys.Contains("Origin"))
|
||||
request.Headers.Add("Origin", @"https://fxg.jinritemai.com/");
|
||||
}
|
||||
foreach (var key in headers.Keys)
|
||||
{
|
||||
request.Headers.Add(key, headers[key]);
|
||||
}
|
||||
request.Referer = referer;
|
||||
request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
|
||||
request.Headers.Set(HttpRequestHeader.AcceptLanguage, "en-US,en;q=0.9");
|
||||
request.Headers.Set(HttpRequestHeader.Cookie, cookies);
|
||||
|
||||
request.Method = "POST";
|
||||
request.ServicePoint.Expect100Continue = false;
|
||||
|
||||
string body = data;
|
||||
byte[] postBytes = Encoding.UTF8.GetBytes(body);
|
||||
request.ContentLength = postBytes.Length;
|
||||
Stream stream = request.GetRequestStream();
|
||||
stream.Write(postBytes, 0, postBytes.Length);
|
||||
stream.Close();
|
||||
|
||||
response = (HttpWebResponse)request.GetResponse();
|
||||
}
|
||||
catch (WebException e)
|
||||
{
|
||||
if (e.Status == WebExceptionStatus.ProtocolError) response = (HttpWebResponse)e.Response;
|
||||
else responseText = "error," + e.Message;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responseText = "error," + ex.Message;
|
||||
}
|
||||
if (response != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(responseText))
|
||||
responseText = ReadResponse(response, this.Encoding);
|
||||
response.Close();
|
||||
}
|
||||
|
||||
return responseText;
|
||||
}
|
||||
|
||||
public string Request_PostByBigLength(string url, string referer, Dictionary<string, string> headers, string cookies, string data, bool AcceptEncoding = true, bool isSetCommonHeaders = true)
|
||||
{
|
||||
HttpWebResponse response = null;
|
||||
string responseText = "";
|
||||
if (headers == null)
|
||||
headers = new Dictionary<string, string>();
|
||||
|
||||
try
|
||||
{
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
|
||||
request.KeepAlive = true;
|
||||
request.Accept = Accept;
|
||||
request.UserAgent = UserAgent;
|
||||
request.UserAgent = AllBase.BaseClass.ChromeUserAgent;
|
||||
request.ContentType = ContentType;
|
||||
if (isSetCommonHeaders)
|
||||
{
|
||||
if (!headers.Keys.Contains("Origin"))
|
||||
request.Headers.Add("Origin", @"https://fxg.jinritemai.com");
|
||||
}
|
||||
foreach (var key in headers.Keys)
|
||||
{
|
||||
request.Headers.Add(key, headers[key]);
|
||||
}
|
||||
request.Referer = referer;
|
||||
if (AcceptEncoding)
|
||||
request.Headers.Set(HttpRequestHeader.AcceptEncoding, "deflate");
|
||||
else
|
||||
request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
|
||||
request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
|
||||
request.Headers.Set(HttpRequestHeader.Cookie, cookies);
|
||||
|
||||
request.Method = "POST";
|
||||
request.ServicePoint.Expect100Continue = false;
|
||||
|
||||
string body = data;
|
||||
byte[] postBytes = Encoding.UTF8.GetBytes(body);
|
||||
request.ContentLength = postBytes.Length;
|
||||
Stream stream = request.GetRequestStream();
|
||||
stream.Write(postBytes, 0, postBytes.Length);
|
||||
stream.Close();
|
||||
|
||||
response = (HttpWebResponse)request.GetResponse();
|
||||
}
|
||||
catch (WebException e)
|
||||
{
|
||||
if (e.Status == WebExceptionStatus.ProtocolError) response = (HttpWebResponse)e.Response;
|
||||
else responseText = "error," + e.Message;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responseText = "error," + ex.Message;
|
||||
}
|
||||
if (response != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(responseText))
|
||||
responseText = ReadResponse(response, this.Encoding);
|
||||
response.Close();
|
||||
}
|
||||
|
||||
return responseText;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取返回值
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <returns></returns>
|
||||
public static string ReadResponse(HttpWebResponse response, Encoding encoding = null)
|
||||
{
|
||||
if (encoding == null)
|
||||
encoding = Encoding.UTF8;
|
||||
using (Stream responseStream = response.GetResponseStream())
|
||||
{
|
||||
Stream streamToRead = responseStream;
|
||||
if (response.ContentEncoding.ToLower().Contains("gzip"))
|
||||
{
|
||||
streamToRead = new GZipStream(streamToRead, CompressionMode.Decompress);
|
||||
}
|
||||
else if (response.ContentEncoding.ToLower().Contains("deflate"))
|
||||
{
|
||||
streamToRead = new DeflateStream(streamToRead, CompressionMode.Decompress);
|
||||
}
|
||||
|
||||
using (StreamReader streamReader = new StreamReader(streamToRead, encoding))
|
||||
{
|
||||
return streamReader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Helper
|
||||
{
|
||||
|
||||
public class DataOpenSSL
|
||||
{
|
||||
public static byte[] key = new byte[32] { 145, 232, 156, 201, 201, 0, 42, 184, 222, 111, 109, 49, 226, 169, 9, 44, 151, 148, 143, 120, 62, 84, 30, 170, 127, 242, 20, 141, 231, 33, 230, 6 };
|
||||
public static byte[] iv = new byte[16] { 113, 6, 75, 177, 160, 112, 73, 39, 178, 147, 82, 107, 186, 58, 144, 187 };
|
||||
|
||||
public static string EncryptString(string plainText)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
// Instantiate a new Aes object to perform string symmetric encryption
|
||||
Aes encryptor = Aes.Create();
|
||||
|
||||
encryptor.Mode = CipherMode.CBC;
|
||||
|
||||
// Set key and IV
|
||||
byte[] aesKey = new byte[32];
|
||||
Array.Copy(key, 0, aesKey, 0, 32);
|
||||
encryptor.Key = aesKey;
|
||||
encryptor.IV = iv;
|
||||
|
||||
// Instantiate a new MemoryStream object to contain the encrypted bytes
|
||||
MemoryStream memoryStream = new MemoryStream();
|
||||
|
||||
// Instantiate a new encryptor from our Aes object
|
||||
ICryptoTransform aesEncryptor = encryptor.CreateEncryptor();
|
||||
|
||||
// Instantiate a new CryptoStream object to process the data and write it to the
|
||||
// memory stream
|
||||
CryptoStream cryptoStream = new CryptoStream(memoryStream, aesEncryptor, CryptoStreamMode.Write);
|
||||
|
||||
// Convert the plainText string into a byte array
|
||||
byte[] plainBytes = Encoding.UTF8.GetBytes(plainText);
|
||||
|
||||
// Encrypt the input plaintext string
|
||||
cryptoStream.Write(plainBytes, 0, plainBytes.Length);
|
||||
|
||||
// Complete the encryption process
|
||||
cryptoStream.FlushFinalBlock();
|
||||
|
||||
// Convert the encrypted data from a MemoryStream to a byte array
|
||||
byte[] cipherBytes = memoryStream.ToArray();
|
||||
|
||||
// Close both the MemoryStream and the CryptoStream
|
||||
memoryStream.Close();
|
||||
cryptoStream.Close();
|
||||
|
||||
// Convert the encrypted byte array to a base64 encoded string
|
||||
string cipherText = Convert.ToBase64String(cipherBytes, 0, cipherBytes.Length);
|
||||
|
||||
|
||||
cipherText = cipherText.Replace("+", "-").Replace("/", "_").Replace("=", "");
|
||||
|
||||
// Return the encrypted data as a string
|
||||
return cipherText;
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
//throw;
|
||||
}
|
||||
return plainText;
|
||||
}
|
||||
|
||||
public static string DecryptString(string cipherText)
|
||||
{
|
||||
cipherText = cipherText.Replace("-", "+").Replace("_", "/");
|
||||
var x1 = cipherText.Length % 4;
|
||||
if (x1 > 0)
|
||||
{
|
||||
cipherText = cipherText + "====".Substring(x1);
|
||||
}
|
||||
// Instantiate a new Aes object to perform string symmetric encryption
|
||||
Aes encryptor = Aes.Create();
|
||||
|
||||
encryptor.Mode = CipherMode.CBC;
|
||||
|
||||
// Set key and IV
|
||||
byte[] aesKey = new byte[32];
|
||||
Array.Copy(key, 0, aesKey, 0, 32);
|
||||
encryptor.Key = aesKey;
|
||||
encryptor.IV = iv;
|
||||
|
||||
// Instantiate a new MemoryStream object to contain the encrypted bytes
|
||||
MemoryStream memoryStream = new MemoryStream();
|
||||
|
||||
// Instantiate a new encryptor from our Aes object
|
||||
ICryptoTransform aesDecryptor = encryptor.CreateDecryptor();
|
||||
|
||||
// Instantiate a new CryptoStream object to process the data and write it to the
|
||||
// memory stream
|
||||
CryptoStream cryptoStream = new CryptoStream(memoryStream, aesDecryptor, CryptoStreamMode.Write);
|
||||
|
||||
// Will contain decrypted plaintext
|
||||
string plainText = String.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
// Convert the ciphertext string into a byte array
|
||||
byte[] cipherBytes = Convert.FromBase64String(cipherText);
|
||||
|
||||
// Decrypt the input ciphertext string
|
||||
cryptoStream.Write(cipherBytes, 0, cipherBytes.Length);
|
||||
|
||||
// Complete the decryption process
|
||||
cryptoStream.FlushFinalBlock();
|
||||
|
||||
// Convert the decrypted data from a MemoryStream to a byte array
|
||||
byte[] plainBytes = memoryStream.ToArray();
|
||||
|
||||
// Convert the decrypted byte array to string
|
||||
plainText = Encoding.UTF8.GetString(plainBytes, 0, plainBytes.Length);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
//throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Close both the MemoryStream and the CryptoStream
|
||||
memoryStream.Close();
|
||||
cryptoStream.Close();
|
||||
}
|
||||
|
||||
// Return the decrypted data as a string
|
||||
return plainText;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Helper
|
||||
{
|
||||
public class FissionDataBaseConfig
|
||||
{
|
||||
public static List<string> CateList = new List<string>(); // 产品数据库分组名称列表
|
||||
public static List<string> MainCateList = new List<string>(); // 主类目列表
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using AllBase.Model.Param.CollectManage;
|
||||
using AllBase.Model.Param.ProductManage;
|
||||
using AllBase.Model.Param.ShopManage;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Helper
|
||||
{
|
||||
public class GlobalConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 店铺列表
|
||||
/// </summary>
|
||||
public static ConcurrentList<DouShopLoginInfo> DouShopLoginList { get; set; } = new ConcurrentList<DouShopLoginInfo>();
|
||||
/// <summary>
|
||||
/// 非当前账户下的店铺列表
|
||||
/// </summary>
|
||||
public static ConcurrentList<DouShopLoginInfo> DouShopLoginOtherAccountList { get; set; }
|
||||
/// <summary>
|
||||
/// 店铺设置参数
|
||||
/// </summary>
|
||||
public static DouShopSettingParam DouShopSettingParam { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 抖音号cookie
|
||||
/// </summary>
|
||||
public static string DouUserCookies { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 巨量百应cookies
|
||||
/// </summary>
|
||||
public static string DouBuyinCookies { get; set; }
|
||||
|
||||
public static IDictionary<string, object> dicLocalStorage { get; set; }
|
||||
|
||||
public static IDictionary<string, object> dicLocalDetailStorage { get; set; }
|
||||
|
||||
public static FissionSettingParam FissionSettingParam { get; set; }
|
||||
|
||||
public static string cAgentIpCode { get; } = "AFZ94w3a";
|
||||
|
||||
public static List<SameProductCheckParam> SameProductCheckParamList { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user