Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

Commit

Permalink
story/highlight update 2
Browse files Browse the repository at this point in the history
  • Loading branch information
AppleGamer22 committed Dec 27, 2020
1 parent b763657 commit a463632
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/commands/highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ export async function detectFiles(browser: Browser, page: Page, highlight: strin
await page.click("svg[aria-label='Pause']");
var urls: string[] = [];
await page.waitForSelector("div.qbCDp", {visible: true});
const imageURL = (await page.$$eval("img.y-yJ5", images => images.map(image => image.getAttribute("src"))))[0];
if (imageURL) urls.push(imageURL);
const imageURL = (await page.$$eval("img.y-yJ5", images => images.map(image => image.getAttribute("srcset"))))[0];
if (imageURL) urls.push(imageURL.split(" ")[0]);
const videoURL = (await page.$$eval("video > source", sources => sources.map(source => source.getAttribute("src"))))[0];
if (videoURL) urls.push(videoURL);
return { urls, username };
Expand Down
4 changes: 2 additions & 2 deletions src/commands/story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ export async function detectFiles(browser: Browser, page: Page, user: string, it
await page.click("svg[aria-label='Pause']");
var urls: string[] = [];
await page.waitForSelector("div.qbCDp", {visible: true});
const imageURL = (await page.$$eval("img.y-yJ5", images => images.map(image => image.getAttribute("src"))))[0];
if (imageURL) urls.push(imageURL);
const imageURL = (await page.$$eval("img.y-yJ5", images => images.map(image => image.getAttribute("srcset"))))[0];
if (imageURL) urls.push(imageURL.split(" ")[0]);
const videoURL = (await page.$$eval("video > source", sources => sources.map(source => source.getAttribute("src"))))[0];
if (videoURL) urls.push(videoURL);
return { username: user, urls };
Expand Down

0 comments on commit a463632

Please sign in to comment.