mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 03:08:30 +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)]
|
||||
.map(([, link]) => link)
|
||||
.filter(a => a.endsWith('.mp4') && a.includes('720p'))[0];
|
||||
.find(a => a.endsWith('.mp4') && a.includes('720p'));
|
||||
|
||||
if (videoLink) return {
|
||||
urls: videoLink,
|
||||
@ -32,7 +32,7 @@ export default async function(o) {
|
||||
|
||||
let imageLink = [...html.matchAll(imageRegex)]
|
||||
.map(([, link]) => link)
|
||||
.filter(a => a.endsWith('.jpg') || a.endsWith('.gif'))[0];
|
||||
.find(a => a.endsWith('.jpg') || a.endsWith('.gif'));
|
||||
|
||||
if (imageLink) return {
|
||||
urls: imageLink,
|
||||
|
Loading…
Reference in New Issue
Block a user