修复短视频解析工具

This commit is contained in:
net909
2025-09-20 17:10:47 +08:00
parent ad228a550b
commit f5a6c11dda
19 changed files with 1766 additions and 18 deletions
+19
View File
@@ -143,6 +143,25 @@ function get_curl($url, $post=0, $referer=0, $cookie=0, $header=0, $ua=0, $nobod
return $ret;
}
function get_location_url($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$httpheader[] = "Accept: */*";
$httpheader[] = "Accept-Encoding: gzip,deflate,sdch";
$httpheader[] = "Accept-Language: zh-CN,zh;q=0.8";
$httpheader[] = "Connection: close";
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36");
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
$location = curl_getinfo($ch, CURLINFO_REDIRECT_URL);
curl_close($ch);
return $location;
}
function jsonp_decode($jsonp, $assoc = false)
{
$jsonp = trim($jsonp);
Generated
+1015
View File
@@ -0,0 +1,1015 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "90b52d33a495d2606004dc98c6c983ae",
"packages": [
{
"name": "cccyun/think-captcha",
"version": "3.0.11",
"source": {
"type": "git",
"url": "https://github.com/netcccyun/think-captcha.git",
"reference": "40012811bf27b41011b1b60bcfadf16ad339931c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/netcccyun/think-captcha/zipball/40012811bf27b41011b1b60bcfadf16ad339931c",
"reference": "40012811bf27b41011b1b60bcfadf16ad339931c",
"shasum": ""
},
"require": {
"topthink/framework": "^6.0|^8.0"
},
"type": "library",
"extra": {
"think": {
"config": {
"captcha": "src/config.php"
},
"services": [
"think\\captcha\\CaptchaService"
]
}
},
"autoload": {
"files": [
"src/helper.php"
],
"psr-4": {
"think\\captcha\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "yunwuxin",
"email": "[email protected]"
}
],
"description": "captcha package for thinkphp",
"support": {
"source": "https://github.com/netcccyun/think-captcha/tree/3.0.11"
},
"time": "2025-04-26T08:37:18+00:00"
},
{
"name": "khanamiryan/qrcode-detector-decoder",
"version": "1.0.5.2",
"source": {
"type": "git",
"url": "https://github.com/khanamiryan/php-qrcode-detector-decoder.git",
"reference": "04fdd58d86a387065f707dc6d3cc304c719910c1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/khanamiryan/php-qrcode-detector-decoder/zipball/04fdd58d86a387065f707dc6d3cc304c719910c1",
"reference": "04fdd58d86a387065f707dc6d3cc304c719910c1",
"shasum": ""
},
"require": {
"php": ">=5.6"
},
"require-dev": {
"phpunit/phpunit": "^5.7 | ^7.5 | ^8.0 | ^9.0"
},
"type": "library",
"autoload": {
"files": [
"lib/Common/customFunctions.php"
],
"psr-4": {
"Zxing\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT",
"Apache-2.0"
],
"authors": [
{
"name": "Ashot Khanamiryan",
"email": "[email protected]",
"homepage": "https://github.com/khanamiryan",
"role": "Developer"
}
],
"description": "QR code decoder / reader",
"homepage": "https://github.com/khanamiryan/php-qrcode-detector-decoder/",
"keywords": [
"barcode",
"qr",
"zxing"
],
"support": {
"issues": "https://github.com/khanamiryan/php-qrcode-detector-decoder/issues",
"source": "https://github.com/khanamiryan/php-qrcode-detector-decoder/tree/1.0.5.2"
},
"time": "2021-07-13T18:46:38+00:00"
},
{
"name": "psr/container",
"version": "1.1.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
"shasum": ""
},
"require": {
"php": ">=7.4.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
"homepage": "https://github.com/php-fig/container",
"keywords": [
"PSR-11",
"container",
"container-interface",
"container-interop",
"psr"
],
"support": {
"issues": "https://github.com/php-fig/container/issues",
"source": "https://github.com/php-fig/container/tree/1.1.2"
},
"time": "2021-11-05T16:50:12+00:00"
},
{
"name": "psr/http-message",
"version": "1.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-message/tree/1.1"
},
"time": "2023-04-04T09:50:52+00:00"
},
{
"name": "psr/log",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "d49695b909c3b7628b6289db5479a1c204601f11"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"support": {
"source": "https://github.com/php-fig/log/tree/1.1.4"
},
"time": "2021-05-03T11:20:27+00:00"
},
{
"name": "psr/simple-cache",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/simple-cache.git",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\SimpleCache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interfaces for simple caching",
"keywords": [
"cache",
"caching",
"psr",
"psr-16",
"simple-cache"
],
"support": {
"source": "https://github.com/php-fig/simple-cache/tree/master"
},
"time": "2017-10-23T01:57:42+00:00"
},
{
"name": "topthink/framework",
"version": "v6.1.5",
"source": {
"type": "git",
"url": "https://github.com/top-think/framework.git",
"reference": "57d1950a1844ef8d3098ea290032aeb92e2e32c3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/framework/zipball/57d1950a1844ef8d3098ea290032aeb92e2e32c3",
"reference": "57d1950a1844ef8d3098ea290032aeb92e2e32c3",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-mbstring": "*",
"php": ">=7.2.5",
"psr/container": "~1.0",
"psr/http-message": "^1.0",
"psr/log": "~1.0",
"psr/simple-cache": "^1.0",
"topthink/think-helper": "^3.1.1",
"topthink/think-orm": "^2.0|^3.0"
},
"require-dev": {
"guzzlehttp/psr7": "^2.1.0",
"mikey179/vfsstream": "^1.6",
"mockery/mockery": "^1.2",
"phpunit/phpunit": "^7.0"
},
"type": "library",
"autoload": {
"files": [],
"psr-4": {
"think\\": "src/think/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "liu21st",
"email": "[email protected]"
},
{
"name": "yunwuxin",
"email": "[email protected]"
}
],
"description": "The ThinkPHP Framework.",
"homepage": "http://thinkphp.cn/",
"keywords": [
"framework",
"orm",
"thinkphp"
],
"support": {
"issues": "https://github.com/top-think/framework/issues",
"source": "https://github.com/top-think/framework/tree/v6.1.5"
},
"time": "2024-04-16T02:01:19+00:00"
},
{
"name": "topthink/think-helper",
"version": "v3.1.11",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-helper.git",
"reference": "1d6ada9b9f3130046bf6922fe1bd159c8d88a33c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-helper/zipball/1d6ada9b9f3130046bf6922fe1bd159c8d88a33c",
"reference": "1d6ada9b9f3130046bf6922fe1bd159c8d88a33c",
"shasum": ""
},
"require": {
"php": ">=7.1.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
},
"type": "library",
"autoload": {
"files": [
"src/helper.php"
],
"psr-4": {
"think\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "yunwuxin",
"email": "[email protected]"
}
],
"description": "The ThinkPHP6 Helper Package",
"support": {
"issues": "https://github.com/top-think/think-helper/issues",
"source": "https://github.com/top-think/think-helper/tree/v3.1.11"
},
"time": "2025-04-07T06:55:59+00:00"
},
{
"name": "topthink/think-migration",
"version": "v3.1.1",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-migration.git",
"reference": "22c44058e1454f3af1d346e7f6524fbe654de7fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-migration/zipball/22c44058e1454f3af1d346e7f6524fbe654de7fb",
"reference": "22c44058e1454f3af1d346e7f6524fbe654de7fb",
"shasum": ""
},
"require": {
"php": ">=7.2",
"topthink/framework": "^6.0 || ^8.0",
"topthink/think-helper": "^3.0.3"
},
"require-dev": {
"composer/composer": "^2.5.8",
"fzaninotto/faker": "^1.8",
"robmorgan/phinx": "^0.13.4"
},
"suggest": {
"fzaninotto/faker": "Required to use the factory builder (^1.8)."
},
"type": "library",
"extra": {
"think": {
"services": [
"think\\migration\\Service"
]
}
},
"autoload": {
"psr-4": {
"Phinx\\": "phinx",
"think\\migration\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "yunwuxin",
"email": "[email protected]"
}
],
"support": {
"issues": "https://github.com/top-think/think-migration/issues",
"source": "https://github.com/top-think/think-migration/tree/v3.1.1"
},
"time": "2023-09-14T05:51:31+00:00"
},
{
"name": "topthink/think-orm",
"version": "v2.0.62",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-orm.git",
"reference": "e53bfea572a133039ad687077120de5521af617f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-orm/zipball/e53bfea572a133039ad687077120de5521af617f",
"reference": "e53bfea572a133039ad687077120de5521af617f",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-pdo": "*",
"php": ">=7.1.0",
"psr/log": "^1.0|^2.0",
"psr/simple-cache": "^1.0|^2.0",
"topthink/think-helper": "^3.1"
},
"require-dev": {
"phpunit/phpunit": "^7|^8|^9.5"
},
"type": "library",
"autoload": {
"files": [
"stubs/load_stubs.php"
],
"psr-4": {
"think\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "liu21st",
"email": "[email protected]"
}
],
"description": "think orm",
"keywords": [
"database",
"orm"
],
"support": {
"issues": "https://github.com/top-think/think-orm/issues",
"source": "https://github.com/top-think/think-orm/tree/v2.0.62"
},
"time": "2024-09-22T06:17:47+00:00"
},
{
"name": "topthink/think-template",
"version": "v2.0.10",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-template.git",
"reference": "2b28c9f787c94f6c22312c9fe97dd3d926c03e1c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-template/zipball/2b28c9f787c94f6c22312c9fe97dd3d926c03e1c",
"reference": "2b28c9f787c94f6c22312c9fe97dd3d926c03e1c",
"shasum": ""
},
"require": {
"php": ">=7.1.0",
"psr/simple-cache": "^1.0"
},
"type": "library",
"autoload": {
"psr-4": {
"think\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "liu21st",
"email": "[email protected]"
}
],
"description": "the php template engine",
"support": {
"issues": "https://github.com/top-think/think-template/issues",
"source": "https://github.com/top-think/think-template/tree/v2.0.10"
},
"time": "2024-08-12T05:48:57+00:00"
},
{
"name": "topthink/think-view",
"version": "v1.0.14",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-view.git",
"reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-view/zipball/edce0ae2c9551ab65f9e94a222604b0dead3576d",
"reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d",
"shasum": ""
},
"require": {
"php": ">=7.1.0",
"topthink/think-template": "^2.0"
},
"type": "library",
"autoload": {
"psr-4": {
"think\\view\\driver\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "liu21st",
"email": "[email protected]"
}
],
"description": "thinkphp template driver",
"support": {
"issues": "https://github.com/top-think/think-view/issues",
"source": "https://github.com/top-think/think-view/tree/v1.0.14"
},
"time": "2019-11-06T11:40:13+00:00"
}
],
"packages-dev": [
{
"name": "symfony/polyfill-mbstring",
"version": "v1.33.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493",
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493",
"shasum": ""
},
"require": {
"ext-iconv": "*",
"php": ">=7.2"
},
"provide": {
"ext-mbstring": "*"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "[email protected]"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-12-23T08:48:59+00:00"
},
{
"name": "symfony/polyfill-php72",
"version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
"reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce",
"reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"type": "metapackage",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "[email protected]"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php72/tree/v1.31.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-php80",
"version": "v1.33.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Php80\\": ""
},
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ion Bazan",
"email": "[email protected]"
},
{
"name": "Nicolas Grekas",
"email": "[email protected]"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2025-01-02T08:10:11+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v4.4.47",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "1069c7a3fca74578022fab6f81643248d02f8e63"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/1069c7a3fca74578022fab6f81643248d02f8e63",
"reference": "1069c7a3fca74578022fab6f81643248d02f8e63",
"shasum": ""
},
"require": {
"php": ">=7.1.3",
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php72": "~1.5",
"symfony/polyfill-php80": "^1.16"
},
"conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
"symfony/console": "<3.4"
},
"require-dev": {
"ext-iconv": "*",
"symfony/console": "^3.4|^4.0|^5.0",
"symfony/process": "^4.4|^5.0",
"twig/twig": "^1.43|^2.13|^3.0.4"
},
"suggest": {
"ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
"ext-intl": "To show region name in time zone dump",
"symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
},
"bin": [
"Resources/bin/var-dump-server"
],
"type": "library",
"autoload": {
"files": [
"Resources/functions/dump.php"
],
"psr-4": {
"Symfony\\Component\\VarDumper\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "[email protected]"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Provides mechanisms for walking through any arbitrary PHP variable",
"homepage": "https://symfony.com",
"keywords": [
"debug",
"dump"
],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/v4.4.47"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2022-10-03T15:15:11+00:00"
},
{
"name": "topthink/think-trace",
"version": "v1.6",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-trace.git",
"reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-trace/zipball/136cd5d97e8bdb780e4b5c1637c588ed7ca3e142",
"reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142",
"shasum": ""
},
"require": {
"php": ">=7.1.0",
"topthink/framework": "^6.0|^8.0"
},
"type": "library",
"extra": {
"think": {
"config": {
"trace": "src/config.php"
},
"services": [
"think\\trace\\Service"
]
}
},
"autoload": {
"psr-4": {
"think\\trace\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "liu21st",
"email": "[email protected]"
}
],
"description": "thinkphp debug trace",
"support": {
"issues": "https://github.com/top-think/think-trace/issues",
"source": "https://github.com/top-think/think-trace/tree/v1.6"
},
"time": "2023-02-07T08:36:32+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=7.3.5",
"ext-curl": "*",
"ext-json": "*",
"ext-zip": "*",
"ext-pdo": "*",
"ext-iconv": "*"
},
"platform-dev": [],
"plugin-api-version": "2.6.0"
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace plugin\utility\imghosting\api;
use Exception;
use plugin\utility\imghosting\api;
use think\helper\Str;
class pngcm implements api
{
public function upload($filepath, $filename){
$url = 'https://img.wnflb2023.com/application/upload.php';
$file = new \CURLFile($filepath);
$file->setPostFilename($filename);
$param = [
'name' => $filename,
'uuid' => 'o_'.Str::random(27),
'sign' => time(),
'file' => $file,
];
$data = get_curl($url,$param,'https://img.wnflb2023.com/');
$arr = json_decode($data,true);
if(isset($arr['code']) && $arr['code']==200){
return ['url'=>$arr['url']];
}elseif(isset($arr['message'])){
throw new Exception('上传失败请重试('.$arr['message'].'');
}else{
throw new Exception('上传失败!接口错误');
}
}
}
+4
View File
@@ -104,6 +104,10 @@ textarea.form-control{min-height: auto;}
title: '百度文库',
key: 'baidu'
},
{
title: 'fuliba',
key: 'pngcm'
},
{
title: 'IMGDD',
key: 'imgdd'
+70
View File
@@ -0,0 +1,70 @@
<?php
namespace plugin\utility\videoparse\api;
use Exception;
use plugin\utility\videoparse\api;
class acfun implements api
{
public function parse($url){
if(preg_match('!/ac(\d+)!', $url, $match)){ //UGC视频
$id = $match[1];
$requrl = 'https://www.acfun.cn/player/ac' . $id;
$res = get_curl($requrl);
if(preg_match('/window.videoInfo = (.*?);\n/', $res, $match)){
//echo $match[1];exit;
$arr = json_decode(trim($match[1]), true);
$videoinfo = json_decode($arr['currentVideoInfo']['ksPlayJson'], true);
if($videoinfo){
$video_list = $videoinfo['adaptationSet'][0]['representation'];
if(empty($video_list))throw new Exception('视频列表解析失败');
$url = $video_list[0]['url'];
return [
'title' => $arr['title'],
'cover' => $arr['coverUrl'],
'url' => $url,
'time' => date('Y-m-d H:i:s', $arr['createTimeMillis']/1000),
'like' => $arr['likeCount'],
'author' => $arr['user']['name'],
'avatar' => $arr['user']['headUrl'],
];
}else{
throw new Exception('视频信息解析失败');
}
}else{
throw new Exception('视频页面解析失败');
}
}elseif(preg_match('!/aa([0-9\_]+)!', $url, $match)){ //番剧
$id = $match[1];
$requrl = 'https://www.acfun.cn/bangumi/aa' . $id;
$res = get_curl($requrl);
if(preg_match('/window.bangumiData = (.*?);\n/', $res, $match)){
//echo $match[1];exit;
$arr = json_decode(trim($match[1]), true);
$videoinfo = json_decode($arr['currentVideoInfo']['ksPlayJson'], true);
if($videoinfo){
$video_list = $videoinfo['adaptationSet'][0]['representation'];
if(empty($video_list))throw new Exception('视频列表解析失败');
$url = $video_list[0]['url'];
return [
'title' => $arr['showTitle'],
'cover' => $arr['bangumiCoverImageH'],
'url' => $url,
'time' => date('Y-m-d H:i:s', $arr['onlineTime']/1000),
'like' => $arr['bangumiLikeCount'],
'author' => $arr['bangumiTitle'],
];
}else{
throw new Exception('视频信息解析失败');
}
}else{
throw new Exception('视频页面解析失败');
}
}else{
throw new Exception('视频id获取失败');
}
}
}
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace plugin\utility\videoparse\api;
use Exception;
use plugin\utility\videoparse\api;
class douyin implements api
{
public function parse($url){
$url = 'https://api.makuo.cc/api/get.video.douyin?url='.urlencode($url);
$header = ['Authorization: '.config_get('yapi_token')];
$data = get_curl($url, 0, 0, 0, 0, 0, 0, $header);
$arr = json_decode($data, true);
if(isset($arr['code']) && $arr['code']==200){
if(isset($arr['data']['video_url'])){
return [
'title' => $arr['data']['title'],
'author' => $arr['data']['author'],
'time' => date('Y-m-d H:i:s', $arr['data']['time']),
'cover' => $arr['data']['cover'],
'url' => $arr['data']['video_url'],
];
}elseif(isset($arr['data']['images'])){
return [
'title' => $arr['data']['title'],
'author' => $arr['data']['author'],
'time' => date('Y-m-d H:i:s', $arr['data']['time']),
'cover' => $arr['data']['cover'],
'images' => $arr['data']['images'],
];
}else{
throw new Exception('解析url返回异常');
}
}elseif(isset($arr['msg'])){
throw new Exception('视频解析失败,'.$arr['msg']);
}else{
throw new Exception('视频解析失败');
}
}
}
+129
View File
@@ -0,0 +1,129 @@
<?php
namespace plugin\utility\videoparse\api;
use Exception;
use plugin\utility\videoparse\api;
class douyu implements api
{
private static $version = '220320250920';
public function parse($url){
if(preg_match('!\/show\/([a-zA-Z0-9]+)!', $url, $match)){
$vid = $match[1];
$requrl = 'https://v.douyu.com/show/' . $vid;
$res = get_curl($requrl);
if(preg_match('/DATA:\{content: (.*?),videoTag:/', $res, $match)){
$arr = json_decode($match[1], true);
if(isset($arr['point_id'])){
$result = [
'title' => $arr['title'],
'desc' => $arr['contents'],
'cover' => $arr['video_pic'],
'time' => date('Y-m-d H:i:s', $arr['create_time']),
'author' => $arr['author'],
'avatar' => $arr['authorIcon']
];
$requrl = 'https://v.douyu.com/wgapi/vodnc/front/stream/getStreamUrlWeb';
$dy_did = md5(microtime(true).rand(1000,9999));
$time = time();
$sign = $this->getsign($arr['point_id'], $dy_did, $time);
$data = [
'v' => self::$version,
'did' => $dy_did,
'tt' => $time,
'sign' => $sign,
'vid' => $arr['hash_id']
];
$cookie = 'dy_did='.$dy_did.';';
$res = get_curl($requrl, http_build_query($data), $url, $cookie);
$arr = json_decode($res, true);
if(isset($arr['error']) && $arr['error'] == 0 && isset($arr['data']['thumb_video'])){
if(isset($arr['data']['thumb_video']['super'])) $info = $arr['data']['thumb_video']['super'];
elseif(isset($arr['data']['thumb_video']['high'])) $info = $arr['data']['thumb_video']['high'];
elseif(isset($arr['data']['thumb_video']['normal'])) $info = $arr['data']['thumb_video']['normal'];
else throw new Exception('视频解析失败,无可用视频地址');
$result['url'] = $info['url'];
return $result;
}else{
throw new Exception('视频解析失败,'.($arr['msg'] ?? ''));
}
}
}
throw new Exception('视频解析失败');
}else{
throw new Exception('视频id获取失败');
}
}
private function getsign($xx0, $xx1, $xx2)
{
$k2 = [0x551983fb, 0x63c94be2, 0x0054dfe2, 0x3ba6bd08];
$MASK = 0xFFFFFFFF;
$add = fn(int $a, int $b) => ($a + $b) & $MASK;
$rotr = fn(int $x, int $n) => ((($x & $MASK) >> ($n & 31)) | (($x << (32 - ($n & 31))) & $MASK)) & $MASK;
$rotl = fn(int $x, int $n) => (((($x << ($n & 31)) & $MASK) | (($x & $MASK) >> (32 - ($n & 31))))) & $MASK;
$cb = $xx0 . $xx1 . $xx2 . self::$version;
$md = hash('md5', $cb, true);
$re = array_values(unpack('V4', $md));
for ($I = 0; $I < 2; $I++) {
$v0 = $re[$I * 2]; $v1 = $re[$I * 2 + 1];
$sum = 0; $delta = 0x9e3779b9;
for ($i = 0; $i < 32; $i++) {
$sum = $add($sum, $delta);
$v0 = $add($v0, ((($v1 << 4) + $k2[0]) ^ ($v1 + $sum) ^ (((($v1) & $MASK) >> 5) + $k2[1])) & $MASK);
$v1 = $add($v1, ((($v0 << 4) + $k2[2]) ^ ($v0 + $sum) ^ (((($v0) & $MASK) >> 5) + $k2[3])) & $MASK);
}
$re[$I * 2] = $v0 & $MASK;
$re[$I * 2 + 1] = $v1 & $MASK;
}
$re[0] = $rotr($re[0], $k2[0] % 16);
$re[0] = $rotl($re[0], $k2[2] % 16);
$re[0] = $rotl($re[0], $k2[0] % 16);
$re[0] = $rotr($re[0], $k2[2] % 16);
$re[0] = $rotl($re[0], $k2[2] % 16);
$re[1] = ($re[1] ^ $k2[1]) & $MASK;
$re[1] = $add($re[1], $k2[3]);
$re[1] = $add($re[1], $k2[1]);
$re[1] = ($re[1] ^ $k2[3]) & $MASK;
$re[1] = ($re[1] ^ $k2[3]) & $MASK;
$re[2] = $add($re[2], $k2[0]);
$re[2] = ($re[2] - $k2[2]) & $MASK;
$re[2] = ($re[2] - $k2[0]) & $MASK;
$re[2] = $add($re[2], $k2[2]);
$re[2] = $rotl($re[2], $k2[2] % 16);
$re[3] = $rotl($re[3], $k2[1] % 16);
$re[3] = $rotr($re[3], $k2[3] % 16);
$re[3] = $rotr($re[3], $k2[1] % 16);
$re[3] = ($re[3] - $k2[3]) & $MASK;
$re[0] = $add($re[0], $k2[0]);
$re[0] = $add($re[0], $k2[2]);
$re[0] = $rotl($re[0], $k2[2] % 16);
$re[1] = $rotr($re[1], $k2[1] % 16);
$re[1] = $rotl($re[1], $k2[3] % 16);
$re[1] = ($re[1] ^ $k2[3]) & $MASK;
$re[2] = $add($re[2], $k2[0]);
$re[2] = ($re[2] - $k2[2]) & $MASK;
$re[2] = $add($re[2], $k2[2]);
$re[2] = $rotr($re[2], $k2[2] % 16);
$re[3] = $rotl($re[3], $k2[1] % 16);
$re[3] = ($re[3] - $k2[3]) & $MASK;
$re[3] = $rotl($re[3], $k2[3] % 16);
$sign = bin2hex(pack('V*', $re[0], $re[1], $re[2], $re[3]));
return $sign;
}
}
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace plugin\utility\videoparse\api;
use Exception;
use plugin\utility\videoparse\api;
class huya implements api
{
public function parse($url){
if(!preg_match('/\/(\d+).html/', $url, $match)) throw new Exception('视频id获取失败');
$id = $match[1];
$requrl = 'https://liveapi.huya.com/moment/getMomentContent?videoId=' . $id;
$res = get_curl($requrl, 0, 'https://v.huya.com/');
$arr = json_decode($res, true);
if(isset($arr['status']) && $arr['status'] == 200){
$url = $arr["data"]["moment"]["videoInfo"]["definitions"][0]["url"];
$cover = $arr["data"]["moment"]["videoInfo"]["videoCover"];
$title = $arr["data"]["moment"]["videoInfo"]["videoTitle"];
$avatarUrl = $arr["data"]["moment"]["videoInfo"]["avatarUrl"];
$author = $arr["data"]["moment"]["videoInfo"]["nickName"];
$time = date('Y-m-d H:i:s', $arr["data"]["moment"]["cTime"]);
$like = $arr["data"]["moment"]["favorCount"];
return [
'title' => $title,
'cover' => $cover,
'url' => $url,
'time' => $time,
'like' => $like,
'author' => $author,
'avatar' => $avatarUrl
];
}else{
throw new Exception('视频解析失败');
}
}
}
@@ -0,0 +1,43 @@
<?php
namespace plugin\utility\videoparse\api;
use Exception;
use plugin\utility\videoparse\api;
class kuaishou implements api
{
public function parse($url){
$url = 'https://api.makuo.cc/api/get.video.kuaishou?url='.urlencode($url);
$header = ['Authorization: '.config_get('yapi_token')];
$data = get_curl($url, 0, 0, 0, 0, 0, 0, $header);
$arr = json_decode($data, true);
if(isset($arr['code']) && $arr['code']==200){
if(isset($arr['data']['url'])){
return [
'title' => $arr['data']['title'],
'author' => $arr['data']['author'],
'avatar' => $arr['data']['avatar'],
'time' => date('Y-m-d H:i:s', intval($arr['data']['timestamp']/1000)),
'cover' => $arr['data']['cover'],
'url' => $arr['data']['url'],
];
}elseif(isset($arr['data']['images'])){
return [
'title' => $arr['data']['title'],
'author' => $arr['data']['author'],
'avatar' => $arr['data']['avatar'],
'time' => date('Y-m-d H:i:s', intval($arr['data']['timestamp']/1000)),
'cover' => $arr['data']['cover'],
'images' => $arr['data']['images'],
];
}else{
throw new Exception('解析url返回异常');
}
}elseif(isset($arr['msg'])){
throw new Exception('视频解析失败,'.$arr['msg']);
}else{
throw new Exception('视频解析失败');
}
}
}
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace plugin\utility\videoparse\api;
use Exception;
use plugin\utility\videoparse\api;
class pipixia implements api
{
public function parse($url){
$url = 'https://api.makuo.cc/api/get.video.pipixia?url='.urlencode($url);
$header = ['Authorization: '.config_get('yapi_token')];
$data = get_curl($url, 0, 0, 0, 0, 0, 0, $header);
$arr = json_decode($data, true);
if(isset($arr['code']) && $arr['code']==200){
if(isset($arr['data']['url'])){
return [
'title' => $arr['data']['title'],
'author' => $arr['data']['author'],
'avatar' => $arr['data']['avatar'],
'cover' => $arr['data']['cover'],
'url' => $arr['data']['url'],
];
}elseif(isset($arr['data']['imgurl'])){
return [
'title' => $arr['data']['title'],
'author' => $arr['data']['author'],
'avatar' => $arr['data']['avatar'],
'cover' => $arr['data']['cover'],
'images' => $arr['data']['imgurl'],
];
}else{
throw new Exception('解析url返回异常');
}
}elseif(isset($arr['msg'])){
throw new Exception('视频解析失败,'.$arr['msg']);
}else{
throw new Exception('视频解析失败');
}
}
}
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace plugin\utility\videoparse\api;
use Exception;
use plugin\utility\videoparse\api;
class qmkg implements api
{
public function parse($url){
if(!preg_match('/\?s=(.*)/', $url, $match)) throw new Exception('视频id获取失败');
$id = $match[1];
$requrl = 'https://kg.qq.com/node/play?s=' . $id;
$text = get_curl($requrl);
preg_match('/<title>(.*?)-(.*?)-/', $text, $video_title);
preg_match('/cover\":\"(.*?)\"/', $text, $video_cover);
preg_match('/playurl_video\":\"(.*?)\"/', $text, $video_url);
if(!isset($video_url[1]))preg_match('/playurl\":\"(.*?)\"/', $text, $video_url);
preg_match('/{\"activity_id\":0\,\"avatar\":\"(.*?)\"/', $text, $video_avatar);
preg_match('/<p class=\"singer_more__time\">(.*?)<\/p>/', $text, $video_time);
if (isset($video_url[1])) {
return [
'title' => $video_title[2],
'cover' => $video_cover[1],
'url' => $video_url[1],
'author' => $video_title[1],
'avatar' => $video_avatar[1],
'time' => $video_time[1],
];
}else{
throw new Exception('视频解析失败');
}
}
}
+47
View File
@@ -0,0 +1,47 @@
<?php
namespace plugin\utility\videoparse\api;
use Exception;
use plugin\utility\videoparse\api;
class toutiao implements api
{
public function parse($url){
if(preg_match('!/video\/(\d+)\/!', $url, $match)){
$id = $match[1];
$requrl = 'https://m.toutiao.com/video/' . $id . '/';
$ua = 'Mozilla/5.0 (Linux; Android 12; M2011K2C Build/SKQ1.211006.001) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.74 Mobile Safari/537.36';
$res = get_curl($requrl, 0, 0, 0, 0, $ua);
if(preg_match('/<script id="RENDER_DATA" type="application\/json">(.*?)<\/script>/', $res, $match)){
$json = rawurldecode($match[1]);
$arr = json_decode($json, true);
if(isset($arr['articleInfo']['playAuthTokenV2'])){
$result = [
'title' => $arr['articleInfo']['title'],
'author' => $arr['articleInfo']['mediaUser']['screenName'],
'avatar' => $arr['articleInfo']['mediaUser']['avatarUrl'],
'time' => date('Y-m-d H:i:s', $arr['articleInfo']['publishTime']),
'cover' => $arr['articleInfo']['posterUrl'],
];
$playinfo = base64_decode($arr['articleInfo']['playAuthTokenV2']);
$playinfo = json_decode($playinfo, true);
if(isset($playinfo['GetPlayInfoToken'])){
$requrl = 'https://vod.bytedanceapi.com/?'.$playinfo['GetPlayInfoToken'];
$res = get_curl($requrl, 0, $url, 0, 0, $ua);
$arr = json_decode($res, true);
if(isset($arr['Result']['Data']['PlayInfoList']) && !empty($arr['Result']['Data']['PlayInfoList'])){
$playinfolist = $arr['Result']['Data']['PlayInfoList'];
array_multisort(array_column($playinfolist, 'Bitrate'), SORT_DESC, $playinfolist);
$result['url'] = $playinfolist[0]['MainPlayUrl'];
return $result;
}
}
}
}
throw new Exception('视频解析失败');
}else{
throw new Exception('视频id获取失败');
}
}
}
+70
View File
@@ -0,0 +1,70 @@
<?php
namespace plugin\utility\videoparse\api;
use Exception;
use plugin\utility\videoparse\api;
class weibo implements api
{
public function parse($url, $retry = 0){
if(preg_match('/tv\/show\/([0-9:]+)/', $url, $matches) || preg_match('/fid=([0-9:]+)/', $url, $matches)){
$oid = $matches[1];
$page = '/tv/show/'.$oid;
$url = 'https://weibo.com/tv/api/component?page='.urlencode($page);
$post = 'data={"Component_Play_Playinfo":{"oid":"'.$oid.'"}}';
$referer = 'https://weibo.com/tv/show/'.$oid;
$cookie = cache('weibo_cookie');
if(!$cookie) $cookie = $this->genvisitor();
$data = get_curl($url, $post, $referer, $cookie);
$arr = json_decode($data, true);
if(isset($arr['code']) && $arr['code']=='100000'){
if(isset($arr['data']['Component_Play_Playinfo'])){
$info = $arr['data']['Component_Play_Playinfo'];
if(!empty($info['urls'])){
$hd_keys = ['超清 4K', '超清 2K', '高清 1080P', '高清 720P', '高清 480P'];
$play_url = null;
foreach($hd_keys as $key){
if(isset($info['urls'][$key])){
$play_url = $info['urls'][$key];
break;
}
}
if(!$play_url) $play_url = $info['urls'][array_key_first($info['urls'])];
$result = ['title'=>$info['title'], 'author'=>$info['author'], 'avatar'=>$info['avatar'], 'url'=>$play_url, 'cover'=>$info['cover_image'], 'time'=>date('Y-m-d H:i:s', $info['real_date']), 'duration'=>$info['duration']];
return $result;
}else{
throw new Exception('解析视频失败:视频地址不存在');
}
}else{
throw new Exception('解析视频失败:视频不存在');
}
}elseif(isset($arr['msg'])){
throw new Exception('解析视频失败:'.$arr['msg']);
}elseif(empty($data) && $retry = 0){
$this->genvisitor();
return $this->parse($url, 1);
}else{
throw new Exception('解析视频失败:接口请求失败');
}
}else{
throw new Exception('视频id获取失败');
}
}
private function genvisitor(){
$url = 'https://passport.weibo.com/visitor/genvisitor2';
$post = 'cb=visitor_gray_callback&tid=&from=weibo';
$referer = 'https://passport.weibo.com/visitor/visitor';
$data = get_curl($url, $post, $referer);
if(preg_match('/visitor_gray_callback\((.*?)\)/', $data, $matches)){
$arr = json_decode($matches[1], true);
if(isset($arr['retcode']) && $arr['retcode'] == 20000000){
$cookie = 'SUB='.$arr['data']['sub'].'; SUBP='.$arr['data']['subp'].';';
cache('weibo_cookie', $cookie);
return $cookie;
}
}
throw new Exception('生成访客cookie失败');
}
}
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace plugin\utility\videoparse\api;
use Exception;
use plugin\utility\videoparse\api;
class weishi implements api
{
public function parse($url){
if(strpos($url,'feed/')){
$id = getSubstr($url,'feed/','/');
}else{
$id = getSubstr($url,'id=','&');
}
if(!$id) throw new Exception('视频id获取失败');
$requrl = 'https://h5.weishi.qq.com/webapp/json/weishi/WSH5GetPlayPage?feedid=' . $id;
$res = get_curl($requrl);
$arr = json_decode($res, true);
if(isset($arr['ret']) && $arr['ret'] == 0){
if(isset($arr['data']['feeds'][0]['video_url'])){
return [
'author' => $arr['data']['feeds'][0]['poster']['nick'],
'avatar' => $arr['data']['feeds'][0]['poster']['avatar'],
'time' => date('Y-m-d H:i:s', $arr['data']['feeds'][0]['poster']['createtime']),
'title' => $arr['data']['feeds'][0]['feed_desc_withat'],
'cover' => $arr['data']['feeds'][0]['images'][0]['url'],
'url' => $arr['data']['feeds'][0]['video_url']
];
}else{
throw new Exception('视频解析失败(地址获取失败)');
}
}elseif(isset($arr['msg'])){
throw new Exception('视频解析失败('.$arr['msg'].')');
}else{
throw new Exception('视频解析失败');
}
}
}
@@ -0,0 +1,48 @@
<?php
namespace plugin\utility\videoparse\api;
use Exception;
use think\helper\Str;
use plugin\utility\videoparse\api;
class xiaohongshu implements api
{
public function parse($url){
if(strpos($url, 'xhslink.com/')){
$url = get_location_url($url);
if(!$url || !strpos($url, 'xiaohongshu.com/')){
throw new Exception('短链接解析失败');
}
}
$data = get_curl($url);
if(preg_match('/window\.__INITIAL_STATE__=(.*?)<\/script>/', $data, $matches)){
$data = str_replace('undefined', 'null', $matches[1]);
$arr = json_decode($data, true);
if(isset($arr['note']['noteDetailMap']) && !empty($arr['note']['noteDetailMap'])){
$id = array_key_first($arr['note']['noteDetailMap']);
$info = $arr['note']['noteDetailMap'][$id]['note'];
$result = [
'type' => $info['type'],
'title' => $info['title'],
'desc' => $info['desc'],
'time' => date('Y-m-d H:i:s', intval($info['time']/1000)),
'author' => $info['user']['nickname'],
'avatar' => $info['user']['avatar'],
];
if($info['type'] == 'video'){
$result['cover'] = !empty($info['imageList']) ? $info['imageList'][0]['urlDefault'] : '';
$result['url'] = !empty($info['video']['media']['stream']['h264']) ? $info['video']['media']['stream']['h264'][0]['masterUrl'] : '';
}elseif($info['type'] == 'normal'){
$images = [];
foreach($info['imageList'] as $img){
$images[] = $img['urlDefault'];
}
$result['images'] = $images;
}
return $result;
}
}
throw new Exception('视频解析失败');
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace plugin\utility\videoparse\api;
use Exception;
use plugin\utility\videoparse\api;
class zuiyou implements api
{
public function parse($url){
$url = 'https://api.makuo.cc/api/get.video.zuiyou?url='.urlencode($url);
$header = ['Authorization: '.config_get('yapi_token')];
$data = get_curl($url, 0, 0, 0, 0, 0, 0, $header);
$arr = json_decode($data, true);
if(isset($arr['code']) && $arr['code']==200){
if(isset($arr['data']['url'])){
return [
'title' => $arr['data']['title'],
'author' => $arr['data']['author'],
'avatar' => $arr['data']['avatar'],
'cover' => $arr['data']['cover'],
'url' => $arr['data']['url'],
];
}else{
throw new Exception('解析url返回异常');
}
}elseif(isset($arr['msg'])){
throw new Exception('视频解析失败,'.$arr['msg']);
}else{
throw new Exception('视频解析失败');
}
}
}
+31 -9
View File
@@ -62,16 +62,38 @@ class App extends Plugin
}
private function queryapi($domain){
$url = config_get('qqapi_url').'api.php?act=icpquery';
$post = 'key='.config_get('qqapi_key').'&domain='.$domain;
$data = get_curl($url, $post);
$arr = json_decode($data, true);
if(isset($arr['code']) && $arr['code']==0){
return $arr['data'];
}elseif(isset($arr['msg'])){
throw new Exception($arr['msg']);
if(config_get('qqapi_url')){
$url = config_get('qqapi_url').'api.php?act=icpquery';
$post = 'key='.config_get('qqapi_key').'&domain='.$domain;
$data = get_curl($url, $post);
$arr = json_decode($data, true);
if(isset($arr['code']) && $arr['code']==0){
return $arr['data'];
}elseif(isset($arr['msg'])){
throw new Exception($arr['msg']);
}else{
throw new Exception('接口请求失败');
}
}elseif(config_get('yapi_token')){
$url = 'https://api.makuo.cc/api/get.other.icp?url='.urlencode($domain);
$header = ['Authorization: '.config_get('yapi_token')];
$data = get_curl($url, 0, 0, 0, 0, 0, 0, $header);
$arr = json_decode($data, true);
if(isset($arr['code']) && $arr['code']==200){
return [
'Domain' => $arr['data']['domain'],
'DomainIcpNum' => $arr['data']['icp'],
'CompanyName' => $arr['data']['unitName'],
'CompanyType' => $arr['data']['natureName'],
'AuditTime' => $arr['data']['updateRecordTime'],
];
}elseif(isset($arr['msg'])){
throw new Exception('接口请求失败,'.$arr['msg']);
}else{
throw new Exception('接口请求失败');
}
}else{
throw new Exception('接口请求失败');
throw new Exception('请先配置API接口参数');
}
}
+25 -9
View File
@@ -49,16 +49,32 @@ class App extends Plugin
}
private function queryapi($uin){
$url = config_get('qqapi_url').'api.php?act=getqqlevel';
$post = 'key='.config_get('qqapi_key').'&uin='.$uin;
$data = get_curl($url, $post);
$arr = json_decode($data, true);
if(isset($arr['code']) && $arr['code']==0){
return $arr['data'];
}elseif(isset($arr['msg'])){
throw new Exception($arr['msg']);
if(config_get('qqapi_url')){
$url = config_get('qqapi_url').'api.php?act=getqqlevel';
$post = 'key='.config_get('qqapi_key').'&uin='.$uin;
$data = get_curl($url, $post);
$arr = json_decode($data, true);
if(isset($arr['code']) && $arr['code']==0){
return $arr['data'];
}elseif(isset($arr['msg'])){
throw new Exception($arr['msg']);
}else{
throw new Exception('接口请求失败');
}
}elseif(config_get('yapi_token')){
$url = 'https://api.makuo.cc/api/get.qq.level?qq='.$uin;
$header = ['Authorization: '.config_get('yapi_token')];
$data = get_curl($url, 0, 0, 0, 0, 0, 0, $header);
$arr = json_decode($data, true);
if(isset($arr['code']) && $arr['code']==200){
return $arr['data'];
}elseif(isset($arr['msg'])){
throw new Exception('接口请求失败,'.$arr['msg']);
}else{
throw new Exception('接口请求失败');
}
}else{
throw new Exception('接口请求失败');
throw new Exception('请先配置API接口参数');
}
}
+7
View File
@@ -125,6 +125,13 @@
<input type="text" name="captcha_key" placeholder="请输入极验KEY" class="layui-input">
</div>
</div>
<blockquote class="layui-elem-quote"><a href="https://api.makuo.cc/" target="_blank">Yapi接口</a>配置(配置了此密钥就可不用填写下方QQ-API配置)</blockquote>
<div class="layui-form-item">
<label class="layui-form-label">API Token:</label>
<div class="layui-input-block">
<input type="text" name="yapi_token" placeholder="请输入API Token" class="layui-input">
</div>
</div>
<blockquote class="layui-elem-quote"><a href="https://github.com/netcccyun/qqapi" target="_blank">QQ-API</a>接口配置(ICP备案查询、QQ等级查询等工具使用)</blockquote>
<div class="layui-form-item">
<label class="layui-form-label">接口地址:</label>