api/tiktok: fix url patterns
This commit is contained in:
parent
0d2e300fbe
commit
6ad838b649
3 changed files with 6 additions and 6 deletions
|
@ -127,7 +127,7 @@ export default async function({ host, patternMatch, params }) {
|
|||
case "tiktok":
|
||||
r = await tiktok({
|
||||
postId: patternMatch.postId,
|
||||
id: patternMatch.id,
|
||||
shortLink: patternMatch.shortLink,
|
||||
fullAudio: params.tiktokFullAudio,
|
||||
isAudioOnly,
|
||||
h265: params.tiktokH265,
|
||||
|
|
|
@ -111,10 +111,10 @@ export const services = {
|
|||
tiktok: {
|
||||
patterns: [
|
||||
":user/video/:postId",
|
||||
":id",
|
||||
"t/:id",
|
||||
":shortLink",
|
||||
"t/:shortLink",
|
||||
":user/photo/:postId",
|
||||
"v/:id.html"
|
||||
"v/:postId.html"
|
||||
],
|
||||
subdomains: ["vt", "vm", "m"],
|
||||
},
|
||||
|
|
|
@ -12,7 +12,7 @@ export default async function(obj) {
|
|||
let postId = obj.postId;
|
||||
|
||||
if (!postId) {
|
||||
let html = await fetch(`${shortDomain}${obj.id}`, {
|
||||
let html = await fetch(`${shortDomain}${obj.shortLink}`, {
|
||||
redirect: "manual",
|
||||
headers: {
|
||||
"user-agent": genericUserAgent.split(' Chrome/1')[0]
|
||||
|
@ -24,7 +24,7 @@ export default async function(obj) {
|
|||
if (html.startsWith('<a href="https://')) {
|
||||
const extractedURL = html.split('<a href="')[1].split('?')[0];
|
||||
const { patternMatch } = extract(extractedURL);
|
||||
postId = patternMatch.postId
|
||||
postId = patternMatch.postId;
|
||||
}
|
||||
}
|
||||
if (!postId) return { error: "fetch.short_link" };
|
||||
|
|
Loading…
Reference in a new issue