@@ -5,28 +5,20 @@ describe("core/scraper/onetv.js", function () {
5
5
describe ( "extract()" , function ( ) {
6
6
it ( "should return null when there isn't Open Graph" , async function ( ) {
7
7
const url = "https://www.1tv.ru/foo.html" ;
8
- const doc = new DOMParser ( ) . parseFromString ( `
9
- <html>
10
- <head></head>
11
- </html>` , "text/html" ) ;
12
8
const expected = null ;
13
9
14
- const file = await extract ( new URL ( url ) , doc ) ;
10
+ const file = await extract ( new URL ( url ) ) ;
15
11
assert . strictEqual ( file , expected ) ;
16
12
} ) ;
17
13
18
14
it ( "should return video URL" , async function ( ) {
19
- const url = "https://www.1tv.ru/foo.html" ;
20
- const doc = new DOMParser ( ) . parseFromString ( `
21
- <html>
22
- <head>
23
- <meta property="og:video:url"
24
- content="http://bar.com/baz.mp4" />
25
- </head>
26
- </html>` , "text/html" ) ;
27
- const expected = "http://bar.com/baz.mp4" ;
15
+ const url = "https://www.1tv.ru/embed/157535:12" ;
16
+ const expected = "https://balancer-vod.1tv.ru/video/multibitrate" +
17
+ "/video/2019/12/30" +
18
+ "/9186df7c-9677-45e6-8de3-3f8bee109338" +
19
+ "_HD-news-2020_01_01-23_28_05_3800.mp4" ;
28
20
29
- const file = await extract ( new URL ( url ) , doc ) ;
21
+ const file = await extract ( new URL ( url ) ) ;
30
22
assert . strictEqual ( file , expected ) ;
31
23
} ) ;
32
24
} ) ;
0 commit comments