Skip to content

Commit e416be3

Browse files
committed
test: Update integration tests.
1 parent c887f0b commit e416be3

File tree

9 files changed

+65
-84
lines changed

9 files changed

+65
-84
lines changed

test/integration/labeler/youtube.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ describe("Labeler: YouTube", function () {
4242
assert.deepEqual(item, {
4343
file,
4444
label:
45-
"Rick Astley - Never Gonna Give You Up (Official Music" +
46-
" Video)",
45+
"Rick Astley - Never Gonna Give You Up (Official Video) (4K" +
46+
" Remaster)",
4747
position: 0,
4848
title: "",
4949
type: "unknown",

test/integration/scraper/aparat.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import { extract } from "../../../src/core/scrapers.js";
88

99
describe("Scraper: آپارات (Aparat)", function () {
1010
it("should return show URL", async function () {
11-
const url = new URL("https://www.aparat.com/v/IWTPf");
11+
const url = new URL("https://www.aparat.com/v/x37o946");
1212
const context = { depth: false, incognito: false };
1313

1414
const file = await extract(url, context);
1515
assert.equal(
1616
file,
17-
"https://www.aparat.com/video/hls/manifest/videohash/IWTPf/f" +
18-
"/IWTPf.m3u8",
17+
"https://www.aparat.com/video/hls/manifest/videohash/x37o946/f" +
18+
"/x37o946.m3u8",
1919
);
2020
});
2121
});

test/integration/scraper/applepodcasts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe("Scraper: Apple Podcasts", function () {
3232

3333
const file = await extract(url, context);
3434
assert.ok(
35-
file?.startsWith("https://rf.proxycast.org/"),
35+
file?.startsWith("https://proxycast.radiofrance.fr/"),
3636
`"${file}"?.startsWith(...) from ${url}`,
3737
);
3838
assert.ok(

test/integration/scraper/bitchute.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ describe("Scraper: BitChute [fr]", function () {
2222
const context = { depth: false, incognito: false };
2323

2424
const file = await extract(url, context);
25-
assert.equal(file, undefined);
25+
// Comparer avec une URL, car les propriétés Open Graph de la page sont
26+
// boguées : elles sont présentes (elles sont surement ajoutées
27+
// automatiquement en préfixant les URL par
28+
// "https://www.bitchute.com/embed/"),
29+
assert.equal(file, "https://www.bitchute.com/embed//category/science/");
2630
});
2731

2832
it("should return video URL", async function () {

test/integration/scraper/francetv.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,17 @@ describe("Scraper: France tv", function () {
1616
});
1717

1818
it("should return video URL", async function () {
19-
const url = new URL(
20-
"https://www.france.tv/france-2/journal-20h00/7100720-edition-du-dimanche-27-avril-2025.html",
19+
// Récupérer l'URL d'une vidéo du Journal 20h00.
20+
const response = await fetch(
21+
"https://www.france.tv/france-2/journal-20h00/",
2122
);
23+
const text = await response.text();
24+
const doc = new DOMParser().parseFromString(text, "text/html");
25+
const a = doc.querySelector(
26+
'a[aria-label^="Journal 20h00 . Édition du"]',
27+
);
28+
29+
const url = new URL(a.getAttribute("href"), "https://www.france.tv/");
2230
const context = { depth: false, incognito: false };
2331

2432
const file = await extract(url, context);

test/integration/scraper/podcastaddict.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
import assert from "node:assert/strict";
77
import { extract } from "../../../src/core/scrapers.js";
88

9-
// Désactiver les tests, car Podcast Addict détecte que la requête provient d'un
10-
// robot et il refuse d'afficher la page : "Enable JavaScript and cookies to
11-
// continue".
12-
describe.skip("Scraper: Podcast Addict", function () {
9+
describe("Scraper: Podcast Addict", function () {
1310
it("should return undefined when it isn't a video", async function () {
1411
const url = new URL("https://podcastaddict.com/app");
1512
const context = { depth: false, incognito: false };

test/integration/scraper/primevideo.js

Lines changed: 40 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,11 @@ describe("Scraper: Prime Video", function () {
2222
const context = { depth: false, incognito: false };
2323

2424
const file = await extract(url, context);
25-
assert.ok(
26-
file?.startsWith(
27-
"plugin://plugin.video.amazon-test/" +
28-
"?mode=PlayVideo" +
29-
"&asin=amzn1.dv.gti.242f5d02-0b3e-4f4d-a89b-22da3f65f0ec" +
30-
"&name=Fallout%20-%20Season%201",
31-
),
32-
`"${file}"?.startsWith(...)`,
25+
assert.equal(
26+
file,
27+
"plugin://plugin.video.amazon-test/?mode=PlayVideo" +
28+
"&asin=amzn1.dv.gti.242f5d02-0b3e-4f4d-a89b-22da3f65f0ec" +
29+
"&name=Fallout%20-%20Season%201",
3330
);
3431
});
3532

@@ -41,14 +38,11 @@ describe("Scraper: Prime Video", function () {
4138
const context = { depth: false, incognito: false };
4239

4340
const file = await extract(url, context);
44-
assert.ok(
45-
file?.startsWith(
46-
"plugin://plugin.video.amazon-test/" +
47-
"?mode=PlayVideo" +
48-
"&asin=amzn1.dv.gti.5eb510bc-7578-d2dd-49d3-484070a96b52" +
49-
"&name=The%20Boys%20-%20Season%201",
50-
),
51-
`"${file}"?.startsWith(...)`,
41+
assert.equal(
42+
file,
43+
"plugin://plugin.video.amazon-test/?mode=PlayVideo" +
44+
"&asin=amzn1.dv.gti.d9a17eaa-1a66-416a-a169-610fc3ec9f17" +
45+
"&name=The%20Boys%20-%20Season%201",
5246
);
5347
});
5448

@@ -59,14 +53,11 @@ describe("Scraper: Prime Video", function () {
5953
const context = { depth: false, incognito: false };
6054

6155
const file = await extract(url, context);
62-
assert.ok(
63-
file?.startsWith(
64-
"plugin://plugin.video.amazon-test/" +
65-
"?mode=PlayVideo" +
66-
"&asin=amzn1.dv.gti.af316d6d-1270-4dba-882f-33fc6a17ea4f" +
67-
"&name=Mr.%20%26%2338%3B%20Mrs.%20Smith%20-%20Season%201",
68-
),
69-
`"${file}"?.startsWith(...)`,
56+
assert.equal(
57+
file,
58+
"plugin://plugin.video.amazon-test/?mode=PlayVideo" +
59+
"&asin=amzn1.dv.gti.af316d6d-1270-4dba-882f-33fc6a17ea4f" +
60+
"&name=Mr.%20%26%2338%3B%20Mrs.%20Smith%20-%20Season%201",
7061
);
7162
});
7263

@@ -77,14 +68,11 @@ describe("Scraper: Prime Video", function () {
7768
const context = { depth: false, incognito: false };
7869

7970
const file = await extract(url, context);
80-
assert.ok(
81-
file?.startsWith(
82-
"plugin://plugin.video.amazon-test/" +
83-
"?mode=PlayVideo" +
84-
"&asin=amzn1.dv.gti.a3f19de4-9ec3-4428-a3ea-a7aa4a0792d8" +
85-
"&name=Tom%20Clancy%26%2339%3Bs%20Jack%20Ryan",
86-
),
87-
`"${file}"?.startsWith(...)`,
71+
assert.equal(
72+
file,
73+
"plugin://plugin.video.amazon-test/?mode=PlayVideo" +
74+
"&asin=amzn1.dv.gti.a3f19de4-9ec3-4428-a3ea-a7aa4a0792d8" +
75+
"&name=Tom%20Clancy%26%2339%3Bs%20Jack%20Ryan",
8876
);
8977
});
9078

@@ -95,14 +83,11 @@ describe("Scraper: Prime Video", function () {
9583
const context = { depth: false, incognito: false };
9684

9785
const file = await extract(url, context);
98-
assert.ok(
99-
file?.startsWith(
100-
"plugin://plugin.video.amazon-test/" +
101-
"?mode=PlayVideo" +
102-
"&asin=amzn1.dv.gti.ff3e6df2-2fa6-4a7c-bab3-43972be660cb" +
103-
"&name=Heirate%20Meinen%20Mann%20S1",
104-
),
105-
`"${file}"?.startsWith(...)`,
86+
assert.equal(
87+
file,
88+
"plugin://plugin.video.amazon-test/?mode=PlayVideo" +
89+
"&asin=amzn1.dv.gti.ff3e6df2-2fa6-4a7c-bab3-43972be660cb" +
90+
"&name=Marry%20My%20Husband%20-%20Season%201",
10691
);
10792
});
10893

@@ -113,14 +98,11 @@ describe("Scraper: Prime Video", function () {
11398
const context = { depth: false, incognito: false };
11499

115100
const file = await extract(url, context);
116-
assert.ok(
117-
file?.startsWith(
118-
"plugin://plugin.video.amazon-test/" +
119-
"?mode=PlayVideo" +
120-
"&asin=amzn1.dv.gti.56ef5162-901b-4277-9bfa-c5166a89620a" +
121-
"&name=The%20Summer%20I%20Turned%20Pretty%20-%20Season%201",
122-
),
123-
`"${file}"?.startsWith(...)`,
101+
assert.equal(
102+
file,
103+
"plugin://plugin.video.amazon-test/?mode=PlayVideo" +
104+
"&asin=amzn1.dv.gti.56ef5162-901b-4277-9bfa-c5166a89620a" +
105+
"&name=The%20Summer%20I%20Turned%20Pretty%20-%20Season%201",
124106
);
125107
});
126108

@@ -131,17 +113,11 @@ describe("Scraper: Prime Video", function () {
131113
const context = { depth: false, incognito: false };
132114

133115
const file = await extract(url, context);
134-
assert.ok(
135-
file?.startsWith(
136-
"plugin://plugin.video.amazon-test/" +
137-
"?mode=PlayVideo" +
138-
"&asin=amzn1.dv.gti.6c51068a-ab0b-416c-a63e-9ef567371a04" +
139-
"&name=%E6%B2%88%E9%BB%99%E3%81%AE%E8%89%A6%E9%9A%8A%20" +
140-
"-%20%E3%82%B7%E3%83%BC%E3%82%BA%E3%83%B3%EF%BC%91%E3%80" +
141-
"%90%E6%9D%B1%E4%BA%AC%E6%B9%BE%E5%A4%A7%E6%B5%B7%E6%88" +
142-
"%A6%E3%80%91",
143-
),
144-
`"${file}"?.startsWith(...)`,
116+
assert.equal(
117+
file,
118+
"plugin://plugin.video.amazon-test/?mode=PlayVideo" +
119+
"&asin=amzn1.dv.gti.6c51068a-ab0b-416c-a63e-9ef567371a04" +
120+
"&name=The%20Silent%20Service%20%E2%80%93%20Season%201",
145121
);
146122
});
147123

@@ -152,14 +128,11 @@ describe("Scraper: Prime Video", function () {
152128
const context = { depth: false, incognito: false };
153129

154130
const file = await extract(url, context);
155-
assert.ok(
156-
file?.startsWith(
157-
"plugin://plugin.video.amazon-test/" +
158-
"?mode=PlayVideo" +
159-
"&asin=amzn1.dv.gti.b552c326-3035-4910-b2d0-72b2943ea778" +
160-
"&name=Reacher%20-%20Season%202",
161-
),
162-
`"${file}"?.startsWith(...)`,
131+
assert.equal(
132+
file,
133+
"plugin://plugin.video.amazon-test/?mode=PlayVideo" +
134+
"&asin=amzn1.dv.gti.b552c326-3035-4910-b2d0-72b2943ea778" +
135+
"&name=Reacher%20-%20Season%202",
163136
);
164137
});
165138
});

test/integration/scraper/vidlii.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
import assert from "node:assert/strict";
77
import { extract } from "../../../src/core/scrapers.js";
88

9-
// Désactiver ces tests, car VidLii est protégé par Cloudflare.
10-
describe.skip("Scraper: VidLii", function () {
9+
describe("Scraper: VidLii", function () {
1110
it("should return undefined when it isn't a video", async function () {
1211
const url = new URL("https://www.vidlii.com/help");
1312
const context = { depth: false, incognito: false };
@@ -25,7 +24,7 @@ describe.skip("Scraper: VidLii", function () {
2524
file,
2625
"https://www.vidlii.com/usfi/v/2Ng8Abj2Fkl.QfHzede4RBuRpC3G8glW4C" +
2726
"EDhFqKump_9NV0-enDJuqAGNLpWGSUVxr6RknIf63c4dOWAKdbBx-MBP__" +
28-
".mp4",
27+
".720.mp4",
2928
);
3029
});
3130
});

test/integration/scraper/vidyard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe("Scraper: Vidyard", function () {
3333
const file = await extract(url, context);
3434
assert.ok(
3535
file?.startsWith(
36-
"https://cdn.vidyard.com/media/hls/ZoUHbEeXnQtGWB_F_LOogQ" +
36+
"https://cdn.vidyard.com/media/hls/61EqSGBKBRZdArlt50MREg" +
3737
"/full_hd.mp4/index.m3u8?",
3838
),
3939
`"${file}"?.startsWith(...)`,

0 commit comments

Comments
 (0)