-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ZuoBro
committed
Jul 31, 2021
1 parent
7ce4d3a
commit 7397703
Showing
40 changed files
with
2,029 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
target/ | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# MediaQuickServer | ||
## 介绍 | ||
```text | ||
本项目采用SpringBoot框架开发 | ||
支持解析内容: | ||
抖音:单个视频、相册 | ||
快手:单个视频、相册 | ||
``` | ||
接口文档:[api-doc](./api-doc/AllInOne-V202107311753.md) | ||
|
||
## 环境要求 | ||
```text | ||
maven3 | ||
java版本不小于1.8 | ||
``` | ||
|
||
## 编译 | ||
```text | ||
项目根目录下运行: | ||
# 安装依赖 | ||
mvn install | ||
# 打包 | ||
mvn package | ||
``` | ||
|
||
## 运行 | ||
```text | ||
java -jar media-quick-server-1.1.jar | ||
``` | ||
## 解析示例 | ||
```text | ||
0.07 RXM:/ “浪漫至死不渝,我比你想象中更加深情”%你的名字 https://v.douyin.com/ec7LVXv/ 复製此鏈接,达开Dou姻搜索,直接觀kan视频! | ||
``` | ||
![示例](./images/example.png) | ||
控制台输出 | ||
![控制台输出](./images/console-out.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Media-Quick | ||
Version | Update Time | Status | Author | Description | ||
---|---|---|---|--- | ||
v2021-07-31 17:53:06|2021-07-31 17:53:06|auto|@ZuoBro|Created by smart-doc | ||
|
||
|
||
|
||
## 媒体接口 | ||
### 解析短视频链接 | ||
**URL:** http://127.0.0.1:7899/media/quick/v1/media/parse | ||
|
||
**Type:** POST | ||
|
||
**Author:** ZuoBro | ||
date: 2021/5/20 | ||
time: 16:34 | ||
|
||
**Content-Type:** application/json; charset=utf-8 | ||
|
||
**Description:** 解析短视频链接 | ||
|
||
**Body-parameters:** | ||
|
||
Parameter | Type|Description|Required|Since | ||
---|---|---|---|--- | ||
flag|string|短视频链接(可携带描述信息)|false|- | ||
|
||
**Request-example:** | ||
``` | ||
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -i http://127.0.0.1:7899/media/quick/v1/media/parse --data '{ | ||
"flag": "cw53td" | ||
}' | ||
``` | ||
**Response-fields:** | ||
|
||
Field | Type|Description|Since | ||
---|---|---|--- | ||
user|object|用户信息|- | ||
└─name|string|用户昵称|- | ||
└─avatar|string|用户头像地址|- | ||
└─description|string|用户签名、介绍|- | ||
media|object|媒体信息|- | ||
└─mediaType|string|媒体类型|- | ||
mediaApiType|string|媒体Api类型(Douyin、kuaishou等)|- | ||
|
||
**Response-example:** | ||
``` | ||
{ | ||
"user": { | ||
"name": "伟泽.徐", | ||
"avatar": "i10j3q", | ||
"description": "dhrjj7" | ||
}, | ||
"media": { | ||
"mediaType": "8f6tnd" | ||
}, | ||
"mediaApiType": "e25c2o" | ||
} | ||
``` | ||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="smart-doc"><title>Media-Quick</title><link rel="stylesheet" href="https://fonts.googleapis.cnpmjs.org/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"><link rel="stylesheet" href="AllInOne.css?v=1627726570608"/><link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/highlight.js/10.3.2/styles/null.min.css"><style>.literalblock pre, .listingblock pre:not(.highlight), .listingblock pre[class="highlight"], .listingblock pre[class^="highlight "], .listingblock pre.CodeRay, .listingblock pre.prettyprint { background: #f7f7f8 } .hljs { padding: 0em }</style><script src="https://cdn.bootcdn.net/ajax/libs/highlight.js/10.3.2/highlight.min.js"></script><script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script></head><body class="book toc2 toc-left"><div id="header"><h1>Media-Quick</h1><div id="toc" class="toc2"><div id="book-search-input"><input id="search" type="text" placeholder="Type to search"></div><div id="toctitle"><span>API Reference</span></div><ul id="accordion" class="sectlevel1"><li class="open"><a class="dd" href="#_媒体接口">1. 媒体接口</a><ul class="sectlevel2" style="display: block"><li><a href="#_1_1_解析短视频链接">1.1. 解析短视频链接</a></li></ul></li></ul></div></div><div id="content"><div id="preamble"><div class="sectionbody"><table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 20%;"><col style="width: 20%;"><col style="width: 20%;"><col style="width: 20%;"><col style="width: 20%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">Version</th><th class="tableblock halign-left valign-top">Update Time</th><th class="tableblock halign-left valign-top">Status</th><th class="tableblock halign-left valign-top">Author</th><th class="tableblock halign-left valign-top">Description</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><p class="tableblock">v2021-07-31 18:16:10</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">2021-07-31 18:16:10</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">auto</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">@ZuoBro</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">Created by smart-doc</p></td></tr></tbody></table></div></div><div class="sect1"><h2 id="_媒体接口"><a class="anchor" href="#_媒体接口"></a><a class="link" href="#_媒体接口">1. 媒体接口</a></h2><div class="sectionbody"><div class="sect2"><h3 id="_1_1_解析短视频链接"><a class="anchor" href="#_1_1_解析短视频链接"></a><a class="link" href="#_1_1_解析短视频链接">1.1. 解析短视频链接</a></h3><div class="paragraph"><p><strong>URL:</strong><a href="http://127.0.0.1:7899/media/quick/v1/media/parse" class="bare"> http://127.0.0.1:7899/media/quick/v1/media/parse</a></p></div><div class="paragraph"><p><strong>Type:</strong> POST</p></div><div class="paragraph"><p><strong>Author:</strong> ZuoBro | ||
date: 2021/5/20 | ||
time: 16:34</p></div><div class="paragraph"><p><strong>Content-Type:</strong> application/json; charset=utf-8</p></div><div class="paragraph"><p><strong>Description:</strong> 解析短视频链接</p></div><div class="paragraph"><p><strong>Body-parameters:</strong></p></div><table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 20%;"><col style="width: 20%;"><col style="width: 20%;"><col style="width: 20%;"><col style="width: 20%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">Parameter</th><th class="tableblock halign-left valign-top">Type</th><th class="tableblock halign-left valign-top">Description</th><th class="tableblock halign-left valign-top">Required</th><th class="tableblock halign-left valign-top">Since</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><p class="tableblock">flag</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">短视频链接(可携带描述信息)</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td></tr></tbody></table><div class="paragraph"><p><strong>Request-example:</strong></p></div><div class="listingblock"><div class="content"><pre><code class="bash">curl -X POST -H 'Content-Type: application/json; charset=utf-8' -i http://127.0.0.1:7899/media/quick/v1/media/parse --data '{ | ||
"flag": "ki31ps" | ||
}'</code></pre></div></div><div class="paragraph"><p><strong>Response-fields:</strong></p></div><table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 25%;"><col style="width: 25%;"><col style="width: 25%;"><col style="width: 25%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">Field</th><th class="tableblock halign-left valign-top">Type</th><th class="tableblock halign-left valign-top">Description</th><th class="tableblock halign-left valign-top">Since</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><p class="tableblock">user</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">object</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">用户信息</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td></tr><tr><td class="tableblock halign-left valign-top"><p class="tableblock">└─name</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">用户昵称</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td></tr><tr><td class="tableblock halign-left valign-top"><p class="tableblock">└─avatar</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">用户头像地址</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td></tr><tr><td class="tableblock halign-left valign-top"><p class="tableblock">└─description</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">用户签名、介绍</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td></tr><tr><td class="tableblock halign-left valign-top"><p class="tableblock">media</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">object</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">媒体信息</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td></tr><tr><td class="tableblock halign-left valign-top"><p class="tableblock">└─mediaType</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">媒体类型</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td></tr><tr><td class="tableblock halign-left valign-top"><p class="tableblock">mediaApiType</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">媒体Api类型(Douyin、kuaishou等)</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td></tr></tbody></table><div class="paragraph"><p><strong>Response-example:</strong></p></div><div class="listingblock"><div class="content"><pre><code class="json">{ | ||
"user": { | ||
"name": "伟宸.陆", | ||
"avatar": "oohdsh", | ||
"description": "3xlrt4" | ||
}, | ||
"media": { | ||
"mediaType": "e4xepn" | ||
}, | ||
"mediaApiType": "giqptj" | ||
}</code></pre></div></div></div></div></div><footer class="page-footer"><span class="copyright">Generated by smart-doc at 2021-07-31 18:16:10</span><span class="footer-modification">Suggestions,contact,support and error reporting on<a href="https://gitee.com/smart-doc-team/smart-doc" target="_blank"> Gitee</a> or<a href="https://github.com/smart-doc-group/smart-doc.git" target="_blank"> Github</a></span></footer></div> | ||
<script src="search.js?v=1627726570608"></script> | ||
<script> | ||
$(function () { | ||
const Accordion = function (el, multiple) { | ||
this.el = el || {}; | ||
this.multiple = multiple || false; | ||
const links = this.el.find('.dd'); | ||
links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown); | ||
}; | ||
Accordion.prototype.dropdown = function (e) { | ||
const $el = e.data.el; | ||
const $this = $(this), $next = $this.next(); | ||
$next.slideToggle(); | ||
$this.parent().toggleClass('open'); | ||
if (!e.data.multiple) { | ||
$el.find('.submenu').not($next).slideUp("20").parent().removeClass('open'); | ||
} | ||
}; | ||
new Accordion($('#accordion'), false); | ||
hljs.initHighlightingOnLoad() | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
let api = []; | ||
api.push({ | ||
alias: 'MediaController', | ||
order: '1', | ||
link: '媒体接口', | ||
desc: '媒体接口', | ||
list: [] | ||
}) | ||
api[0].list.push({ | ||
order: '1', | ||
desc: '解析短视频链接', | ||
}); | ||
api.push({ | ||
alias: 'dict', | ||
order: '2', | ||
link: 'dict_list', | ||
desc: '数据字典', | ||
list: [] | ||
}) | ||
document.onkeydown = keyDownSearch; | ||
function keyDownSearch(e) { | ||
const theEvent = e; | ||
const code = theEvent.keyCode || theEvent.which || theEvent.charCode; | ||
if (code == 13) { | ||
const search = document.getElementById('search'); | ||
const searchValue = search.value; | ||
let searchArr = []; | ||
for (let i = 0; i < api.length; i++) { | ||
let apiData = api[i]; | ||
const desc = apiData.desc; | ||
if (desc.indexOf(searchValue) > -1) { | ||
searchArr.push({ | ||
order: apiData.order, | ||
desc: apiData.desc, | ||
link: apiData.link, | ||
list: apiData.list | ||
}); | ||
} else { | ||
let methodList = apiData.list || []; | ||
let methodListTemp = []; | ||
for (let j = 0; j < methodList.length; j++) { | ||
const methodData = methodList[j]; | ||
const methodDesc = methodData.desc; | ||
if (methodDesc.indexOf(searchValue) > -1) { | ||
methodListTemp.push(methodData); | ||
break; | ||
} | ||
} | ||
if (methodListTemp.length > 0) { | ||
const data = { | ||
order: apiData.order, | ||
desc: apiData.desc, | ||
link: apiData.link, | ||
list: methodListTemp | ||
}; | ||
searchArr.push(data); | ||
} | ||
} | ||
} | ||
let html; | ||
if (searchValue == '') { | ||
const liClass = ""; | ||
const display = "display: none"; | ||
html = buildAccordion(api,liClass,display); | ||
document.getElementById('accordion').innerHTML = html; | ||
} else { | ||
const liClass = "open"; | ||
const display = "display: block"; | ||
html = buildAccordion(searchArr,liClass,display); | ||
document.getElementById('accordion').innerHTML = html; | ||
} | ||
const Accordion = function (el, multiple) { | ||
this.el = el || {}; | ||
this.multiple = multiple || false; | ||
const links = this.el.find('.dd'); | ||
links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown); | ||
}; | ||
Accordion.prototype.dropdown = function (e) { | ||
const $el = e.data.el; | ||
$this = $(this), $next = $this.next(); | ||
$next.slideToggle(); | ||
$this.parent().toggleClass('open'); | ||
if (!e.data.multiple) { | ||
$el.find('.submenu').not($next).slideUp("20").parent().removeClass('open'); | ||
} | ||
}; | ||
new Accordion($('#accordion'), false); | ||
} | ||
} | ||
|
||
function buildAccordion(apiData, liClass, display) { | ||
let html = ""; | ||
let doc; | ||
if (apiData.length > 0) { | ||
for (let j = 0; j < apiData.length; j++) { | ||
html += '<li class="'+liClass+'">'; | ||
html += '<a class="dd" href="#_' + apiData[j].link + '">' + apiData[j].order + '. ' + apiData[j].desc + '</a>'; | ||
html += '<ul class="sectlevel2" style="'+display+'">'; | ||
doc = apiData[j].list; | ||
for (let m = 0; m < doc.length; m++) { | ||
html += '<li><a href="#_' + apiData[j].order + '_' + doc[m].order + '_' + doc[m].desc + '">' + apiData[j].order + '.' + doc[m].order + '. ' + doc[m].desc + '</a> </li>'; | ||
} | ||
html += '</ul>'; | ||
html += '</li>'; | ||
} | ||
} | ||
return html; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.