update tiktok.js
This commit is contained in:
parent
c0d78f2b01
commit
c69e6cf2ea
1 changed files with 4 additions and 5 deletions
|
@ -1,7 +1,6 @@
|
||||||
import got from "got";
|
import got from "got";
|
||||||
import loc from "../../localization/manager.js";
|
import loc from "../../localization/manager.js";
|
||||||
import { genericUserAgent } from "../config.js";
|
import { genericUserAgent } from "../config.js";
|
||||||
import { unicodeDecode } from "../sub/utils.js";
|
|
||||||
|
|
||||||
let userAgent = genericUserAgent.split(' Chrome/1')[0]
|
let userAgent = genericUserAgent.split(' Chrome/1')[0]
|
||||||
let config = {
|
let config = {
|
||||||
|
@ -52,7 +51,7 @@ export default async function(obj) {
|
||||||
} else {
|
} else {
|
||||||
return { error: loc(obj.lang, 'ErrorCouldntFetch') }
|
return { error: loc(obj.lang, 'ErrorCouldntFetch') }
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (err) {
|
||||||
return { error: loc(obj.lang, 'ErrorCouldntFetch') }
|
return { error: loc(obj.lang, 'ErrorCouldntFetch') }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,9 +105,9 @@ export default async function(obj) {
|
||||||
if (images) {
|
if (images) {
|
||||||
let imageLinks = [];
|
let imageLinks = [];
|
||||||
for (let i in images) {
|
for (let i in images) {
|
||||||
let selector = obj.host == "tiktok" ? images[i]["display_image"]["url_list"] : images[i]["url_list"];
|
let sel = obj.host == "tiktok" ? images[i]["display_image"]["url_list"] : images[i]["url_list"];
|
||||||
selector = selector.filter((i) => { if (i.includes(".jpeg?")) return true; })
|
sel = sel.filter((p) => { if (p.includes(".jpeg?")) return true; })
|
||||||
imageLinks.push({url: selector[0]})
|
imageLinks.push({url: sel[0]})
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
picker: imageLinks,
|
picker: imageLinks,
|
||||||
|
|
Loading…
Reference in a new issue