1
1
import assert from "node:assert" ;
2
+ import sinon from "sinon" ;
3
+ import { kodi } from "../../../src/core/kodi.js" ;
2
4
import { extract } from "../../../src/core/scrapers.js" ;
3
5
4
6
describe ( "Scraper: L'Internaute" , function ( ) {
@@ -13,13 +15,30 @@ describe("Scraper: L'Internaute", function () {
13
15
} ) ;
14
16
15
17
it ( "should return video URL [ldjson]" , async function ( ) {
16
- const url = new URL ( "https://www.linternaute.fr/cinema/tous-les-films" +
17
- "/2424867-les-enfants-du-temps/" ) ;
18
+ const url = new URL ( "https://www.linternaute.com/sport/rugby" +
19
+ "/2617245-rugby-france-angleterre-suivez" +
20
+ "-le-match-des-6-nations-en-direct/" ) ;
18
21
const options = { depth : false , incognito : false } ;
19
22
20
23
const file = await extract ( url , options ) ;
21
- assert . ok ( file ?. startsWith ( "https://media.ccmbg.com/vc/767071118" +
22
- "/852438/mp4/" ) ,
23
- `"${ file } "?.startsWith(...)` ) ;
24
+ assert . strictEqual ( file ,
25
+ "https://media.ccmbg.com/vc/8654741851/960911/mp4/1647588853" ) ;
26
+ } ) ;
27
+
28
+ it ( "should return video URL [iframe-youtube]" , async function ( ) {
29
+ const stub = sinon . stub ( kodi . addons , "getAddons" ) . resolves ( [ ] ) ;
30
+
31
+ const url = new URL ( "https://www.linternaute.fr/cinema/pratique" +
32
+ "/2595113-alerte-rouge-a-partir-de-quel" +
33
+ "-age-voir-le-dernier-film-pixar/" ) ;
34
+ const options = { depth : false , incognito : false } ;
35
+
36
+ const file = await extract ( url , options ) ;
37
+ assert . strictEqual ( file ,
38
+ "plugin://plugin.video.youtube/play/" +
39
+ "?video_id=cMAiO2X12tk&incognito=false" ) ;
40
+
41
+ assert . strictEqual ( stub . callCount , 1 ) ;
42
+ assert . deepStrictEqual ( stub . firstCall . args , [ "video" ] ) ;
24
43
} ) ;
25
44
} ) ;
0 commit comments