Skip to content

Commit fc519b6

Browse files
committed
fix(ouestfrance): Chercher dans le nouvel attribut des IFrames.
1 parent 9025615 commit fc519b6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/core/scraper/ouestfrance.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const action = async function (url, content, options) {
3232
return undefined;
3333
}
3434

35-
for (const iframe of doc.querySelectorAll("iframe[data-ofiframe-src]")) {
36-
const file = await metaExtract(new URL(iframe.dataset.ofiframeSrc, url),
35+
for (const iframe of doc.querySelectorAll("iframe[data-embed-src]")) {
36+
const file = await metaExtract(new URL(iframe.dataset.embedSrc, url),
3737
{ ...options, depth: true });
3838
if (undefined !== file) {
3939
return file;

test/unit/core/scraper/ouestfrance.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ describe("core/scraper/ouestfrance.js", function () {
2727
html: () => Promise.resolve(new DOMParser().parseFromString(`
2828
<html>
2929
<body>
30-
<iframe data-ofiframe-src="https://www.youtube.com` +
31-
`/embed/bar"></iframe>
30+
<iframe data-embed-src="https://www.youtube.com` +
31+
`/embed/bar"></iframe>
3232
</body>
3333
</html>`, "text/html")),
3434
};
@@ -58,7 +58,7 @@ describe("core/scraper/ouestfrance.js", function () {
5858
html: () => Promise.resolve(new DOMParser().parseFromString(`
5959
<html>
6060
<body>
61-
<iframe data-ofiframe-src="//bar.com/"></iframe>
61+
<iframe data-embed-src="//bar.com/"></iframe>
6262
</body>
6363
</html>`, "text/html")),
6464
};
@@ -74,9 +74,9 @@ describe("core/scraper/ouestfrance.js", function () {
7474
html: () => Promise.resolve(new DOMParser().parseFromString(`
7575
<html>
7676
<body>
77-
<iframe data-ofiframe-src="//bar.com/"></iframe>
78-
<iframe data-ofiframe-src="//www.dailymotion.com` +
79-
`/video/baz"></iframe>
77+
<iframe data-embed-src="//bar.com/"></iframe>
78+
<iframe data-embed-src="//www.dailymotion.com/video` +
79+
`/baz"></iframe>
8080
</body>
8181
</html>`, "text/html")),
8282
};

0 commit comments

Comments
 (0)