mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 19:28:29 +00:00
pinterest: replace filter with find
This commit is contained in:
parent
ee2457be7a
commit
73a1d917b8
@ -22,7 +22,7 @@ export default async function(o) {
|
|||||||
|
|
||||||
let videoLink = [...html.matchAll(videoRegex)]
|
let videoLink = [...html.matchAll(videoRegex)]
|
||||||
.map(([, link]) => link)
|
.map(([, link]) => link)
|
||||||
.filter(a => a.endsWith('.mp4') && a.includes('720p'))[0];
|
.find(a => a.endsWith('.mp4') && a.includes('720p'));
|
||||||
|
|
||||||
if (videoLink) return {
|
if (videoLink) return {
|
||||||
urls: videoLink,
|
urls: videoLink,
|
||||||
@ -32,7 +32,7 @@ export default async function(o) {
|
|||||||
|
|
||||||
let imageLink = [...html.matchAll(imageRegex)]
|
let imageLink = [...html.matchAll(imageRegex)]
|
||||||
.map(([, link]) => link)
|
.map(([, link]) => link)
|
||||||
.filter(a => a.endsWith('.jpg') || a.endsWith('.gif'))[0];
|
.find(a => a.endsWith('.jpg') || a.endsWith('.gif'));
|
||||||
|
|
||||||
if (imageLink) return {
|
if (imageLink) return {
|
||||||
urls: imageLink,
|
urls: imageLink,
|
||||||
|
Loading…
Reference in New Issue
Block a user