Skip to content

Commit

Permalink
Fix: Getting Perplexity non-link sources in the sources list (#252)
Browse files Browse the repository at this point in the history
* docs: notes

* fix: Perplexity content selector

* fix: Perplexity - wait for the Youtube frame to appear to catch the link

* 3.7.6
  • Loading branch information
Hugo-COLLIN authored Feb 3, 2025
1 parent c2e1090 commit cb68fda
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "save-my-chatbot",
"version": "3.7.5",
"version": "3.7.6",
"license": "RMD-C 1.1",
"author": "Hugo COLLIN",
"homepage": "https://save.hugocollin.com",
Expand Down
10 changes: 7 additions & 3 deletions public/files/updateNotes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Update notes
# 3.7.6
🎯 Fix Perplexity sources list export
Some sources were not correctly exported. It's now fixed!

# 3.7.5
🐞 Sorry for the mess
These days, the download was buggy and required extra download permissions.
I really apologize and I hope it didn't bother you too much.
🐞 Fixing the download bugs
These days, the download was a bit buggy for some users.
I hope it didn't bother you too much.
It's now fixed and you can download your files as usual!

# 3.7.4
Expand Down
3 changes: 2 additions & 1 deletion src/core/services/pageExtractor/extractSources.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {safeExecute, sleep} from "../../utils/jsShorteners";
import {resetPagination, selectAndClick} from "../interact/cs/interact";
import {formatLink} from "../format/formatMarkdown";
import {waitAppears} from "../../utils/cs/interactDOM";

const SOURCES_HEADER = "\n\n---\n**Sources:**\n";
let res = "";
Expand Down Expand Up @@ -187,7 +188,7 @@ export async function formatSources(i: string | number, format: (arg0: any) => s
await sleep(500); // needed for youtube player to load

// Get the youtube embed
const link = document.querySelector('.fixed iframe');
const link = await waitAppears('.fixed iframe', 100, 10) as HTMLElement;

if (!link) {
console.warn("link undefined");
Expand Down
2 changes: 1 addition & 1 deletion src/features/scraper/domains/Perplexity.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"wait": 50
}],
"close": [{"selector": "[data-testid=\"close-modal\"], div.w-full.relative button[aria-label].h-8:not([aria-label=\"Submit\"])", "scope": "document", "wait": 50}],
"selector": ".fixed > div > [class] > div > div > div > div > div > .group, div.w-full.relative > .h-full.items-stretch.cursor-pointer.w-full.flex.group",
"selector": ".fixed > div > [class] > div > div > div > div > div > .group, div.w-full.relative > .group",
"extractionType": "list"
},
{
Expand Down

0 comments on commit cb68fda

Please sign in to comment.