tiktok is back! (fix)
- added support for tiktok (images won't work, they're only accessible through the app) - hopefully main input bar is now not rounded on ios, i fucking hate apple - if service is not supported, a correlating error will appear, not generic one - removed duplicates from config that are present in package json already - tiny bit of clean up - fixed weird redirect issue that broke downloads from some tiktok share links
This commit is contained in:
parent
1b4872c1de
commit
1509046680
1 changed files with 5 additions and 1 deletions
|
@ -11,7 +11,11 @@ export default async function(obj) {
|
||||||
return { error: loc(obj.lang, 'ErrorCantConnectToServiceAPI', 'tiktok') };
|
return { error: loc(obj.lang, 'ErrorCantConnectToServiceAPI', 'tiktok') };
|
||||||
});
|
});
|
||||||
html = html.body
|
html = html.body
|
||||||
|
if (!html.includes('<!DOCTYPE html>')) {
|
||||||
obj.postId = html.split('video/')[1].split('?')[0]
|
obj.postId = html.split('video/')[1].split('?')[0]
|
||||||
|
} else {
|
||||||
|
obj.postId = html.split('aweme/detail/')[1].split('?')[0]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let url = `https://tiktok.com/@video/video/${obj.postId}`
|
let url = `https://tiktok.com/@video/video/${obj.postId}`
|
||||||
let html = await got.get(url, { headers: { "user-agent": genericUserAgent } });
|
let html = await got.get(url, { headers: { "user-agent": genericUserAgent } });
|
||||||
|
|
Loading…
Reference in a new issue