Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #177 from huankong233/dev
Browse files Browse the repository at this point in the history
[*] 修复错误的将风控提示转换为代理地址
  • Loading branch information
huankong233 authored Jul 26, 2024
2 parents d81e8d0 + 2295229 commit 6305173
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ MAIL_FROM_NAME=Example
MAIL_TO_ADDRESS=hello@example.com
MAIL_TO_NAME=Example

_94LIST_VERSION=1.3.23
_94LIST_VERSION=1.3.24
_94LIST_SLEEP=3
_94LIST_MAX_ONCE=20
_94LIST_PASSWORD=""
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 2024

### 07-25 v1.3.24

- [*] 修复错误的将风控提示转换为代理地址

### 07-25 v1.3.23

- [+] 获取账号封禁信息
Expand Down
33 changes: 9 additions & 24 deletions app/Http/Controllers/ParseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,6 @@ public function _getProvinceFromIP($ip): string|null|false
} catch (GuzzleException $e) {
}

// try {
// $res = $http->get("https://api.vore.top/api/IPdata", ["query" => ["ip" => $ip]]);
// $response = JSON::decode($res->getBody()->getContents());
//
// if (isset($response["ipinfo"]["cnip"]) && isset($response["ipdata"]["info1"])) {
// if (config("94list.limit_cn")) {
// if (!$response["ipinfo"]["cnip"]) {
// return false;
// }
// }
//
// return $response["ipdata"]["info1"] !== "" ? $response["ipdata"]["info1"] : null;
// }
// } catch (GuzzleException $e) {
// }

try {
$res = $http->get("https://qifu.baidu.com/ip/geo/v1/district", ["query" => ["ip" => $ip]]);
$response = JSON::decode($res->getBody()->getContents());
Expand Down Expand Up @@ -686,23 +670,24 @@ public function getDownloadLinks(Request $request)
$server = config("94list.proxy_server");

$data = array_map(function ($responseDatum) use ($ua, $parse_mode, $request, $user_id, $token, $token_id, &$banned, &$limited, $server, $key) {
$url = $responseDatum["url"];
$res = [
"url" => $responseDatum["url"],
"url" => $url,
"filename" => $responseDatum["filename"],
"fs_id" => $responseDatum["fs_id"],
"ua" => $responseDatum["ua"] ?? $ua
];

if ($server !== "") {
$json = JSON::encode(["url" => $responseDatum["url"], "ua" => $ua]);
if ($server !== "" && str_contains($url, "http")) {
$json = JSON::encode(["url" => $url, "ua" => $ua]);
$res["url"] = $server . "?data=" . self::xorEncrypt($json, $key);
}

$ck_id = $responseDatum["cookie_id"];
$account = Account::query()->find($ck_id);

if (isset($responseDatum["msg"]) && $responseDatum["msg"] === "获取成功") {
if (in_array($parse_mode, [5, 10]) && str_contains($responseDatum["url"], "qdall01")) {
if (in_array($parse_mode, [5, 10]) && str_contains($url, "qdall01")) {
$res["url"] = "账号被限速";

$account->update([
Expand Down Expand Up @@ -734,25 +719,25 @@ public function getDownloadLinks(Request $request)
RecordController::addRecord([
"ip" => UtilsController::getIp(),
"fs_id" => $fs_id,
"url" => $responseDatum["url"],
"url" => $url,
"ua" => $ua,
"user_id" => $user_id,
"token_id" => $token_id,
"account_id" => $ck_id
]);

if (str_contains($responseDatum["url"], "http") && isset($responseDatum["urls"])) $res["urls"] = array_map(function ($item) use ($server, $key, $ua) {
if (str_contains($url, "http") && isset($responseDatum["urls"])) $res["urls"] = array_map(function ($item) use ($server, $key, $ua) {
if ($server !== "") {
$json = JSON::encode(["url" => $item, "ua" => $ua]);
$item = $server . "?data=" . self::xorEncrypt($json, $key);
}
return $item;
}, $responseDatum["urls"]);
}
} else if (str_contains($responseDatum["url"], "风控") || str_contains($responseDatum["url"], "invalid")) {
} else if (str_contains($url, "风控") || str_contains($url, "invalid")) {
$account->update([
"switch" => 0,
"reason" => $responseDatum["url"],
"reason" => $url,
]);

$banned[] = $ck_id;
Expand Down
2 changes: 1 addition & 1 deletion config/94list.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"fake_wx_user_agent" => "Mozilla/5.0 (Linux; Android 7.1.1; MI 6 Build/NMF26X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/6.2 TBS/043807 Mobile Safari/537.36 MicroMessenger/6.6.1.1220(0x26060135) NetType/4G Language/zh_CN MicroMessenger/6.6.1.1220(0x26060135) NetType/4G Language/zh_CN miniProgram",
"fake_cookie" => "BAIDUID=A4FDFAE43DDBF7E6956B02F6EF715373:FG=1; BAIDUID_BFESS=A4FDFAE43DDBF7E6956B02F6EF715373:FG=1; newlogin=1",

"version" => "1.3.23",
"version" => "1.3.24",
"sleep" => (int)env("_94LIST_SLEEP", 3),
"max_once" => (int)env("_94LIST_MAX_ONCE", 20),
"password" => env("_94LIST_PASSWORD", ""),
Expand Down

0 comments on commit 6305173

Please sign in to comment.