Skip to content

Commit

Permalink
fix(ouestfrance): Chercher dans le nouvel attribut des IFrames.
Browse files Browse the repository at this point in the history
  • Loading branch information
regseb committed Feb 25, 2023
1 parent 9025615 commit fc519b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/core/scraper/ouestfrance.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const action = async function (url, content, options) {
return undefined;
}

for (const iframe of doc.querySelectorAll("iframe[data-ofiframe-src]")) {
const file = await metaExtract(new URL(iframe.dataset.ofiframeSrc, url),
for (const iframe of doc.querySelectorAll("iframe[data-embed-src]")) {
const file = await metaExtract(new URL(iframe.dataset.embedSrc, url),
{ ...options, depth: true });
if (undefined !== file) {
return file;
Expand Down
12 changes: 6 additions & 6 deletions test/unit/core/scraper/ouestfrance.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ describe("core/scraper/ouestfrance.js", function () {
html: () => Promise.resolve(new DOMParser().parseFromString(`
<html>
<body>
<iframe data-ofiframe-src="https://www.youtube.com` +
`/embed/bar"></iframe>
<iframe data-embed-src="https://www.youtube.com` +
`/embed/bar"></iframe>
</body>
</html>`, "text/html")),
};
Expand Down Expand Up @@ -58,7 +58,7 @@ describe("core/scraper/ouestfrance.js", function () {
html: () => Promise.resolve(new DOMParser().parseFromString(`
<html>
<body>
<iframe data-ofiframe-src="//bar.com/"></iframe>
<iframe data-embed-src="//bar.com/"></iframe>
</body>
</html>`, "text/html")),
};
Expand All @@ -74,9 +74,9 @@ describe("core/scraper/ouestfrance.js", function () {
html: () => Promise.resolve(new DOMParser().parseFromString(`
<html>
<body>
<iframe data-ofiframe-src="//bar.com/"></iframe>
<iframe data-ofiframe-src="//www.dailymotion.com` +
`/video/baz"></iframe>
<iframe data-embed-src="//bar.com/"></iframe>
<iframe data-embed-src="//www.dailymotion.com/video` +
`/baz"></iframe>
</body>
</html>`, "text/html")),
};
Expand Down

0 comments on commit fc519b6

Please sign in to comment.