diff --git a/CHANGELOG.md b/CHANGELOG.md index 158cde08..62ba94d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [4.6.0] - 2026-10-30 ### Added - `mastodon:iframe` setting (off by default). Mastodon oEmbed html (`blockquote.mastodon-embed` with `data-embed-url`) becomes a sandboxed `', + $info->code->html + ); + $this->assertSame(640, $info->code->width); + $this->assertSame(360, $info->code->height); + } + + public function testBilibiliAidBuildsPlayerIframe(): void + { + $info = $this->embed(['/video/av170001' => self::BILIBILI_ERROR]) + ->get('https://www.bilibili.com/video/av170001'); + + $this->assertNotNull($info->code); + $this->assertStringContainsString('player.html?aid=170001&autoplay=0', $info->code->html); + } + + public function testBilibiliErrorPageHasNoMetadata(): void + { + $info = $this->embed(['/video/BV1GJ411x7h7' => self::BILIBILI_ERROR]) + ->get('https://www.bilibili.com/video/BV1GJ411x7h7'); + + $this->assertNull($info->title); + $this->assertNull($info->description); + $this->assertNull($info->image); + } + + public function testBilibiliMissingVideoPageHasNoMetadata(): void + { + $info = $this->embed(['/video/BV1GJ411x7h7' => self::BILIBILI_MISSING]) + ->get('https://www.bilibili.com/video/BV1GJ411x7h7'); + + $this->assertNull($info->title); + $this->assertNull($info->description); + $this->assertNull($info->image); + $this->assertNotNull($info->code); + } + + public function testBilibiliTemplateDescriptionIsDiscarded(): void + { + $info = $this->embed([ + '/video/BV1GJ411x7h7' => $this->page(''), + ])->get('https://www.bilibili.com/video/BV1GJ411x7h7'); + + $this->assertSame('Page title', $info->title); + $this->assertNull($info->description); + } + + public function testBilibiliVideoPageKeepsMetadata(): void + { + $info = $this->embed([ + '/video/BV1GJ411x7h7' => $this->page( + '' + .'' + ), + ])->get('https://www.bilibili.com/video/BV1GJ411x7h7'); + + $this->assertSame('Video title', $info->title); + $this->assertSame('https://i0.hdslb.com/bfs/archive/cover.jpg', (string) $info->image); + } + + public function testBilibiliOtherPageHasNoPlayer(): void + { + $info = $this->embed(['/' => $this->page('')])->get('https://www.bilibili.com/'); + + $this->assertNull($info->code); + } + + public function testYoukuBuildsPlayerIframe(): void + { + $info = $this->embed(['/v_show/id_XNTk1MTU4MDQ0OA==.html' => $this->page('')]) + ->get('https://v.youku.com/v_show/id_XNTk1MTU4MDQ0OA==.html?spm=a2hja.12701474'); + + $this->assertNotNull($info->code); + $this->assertSame( + '', + $info->code->html + ); + $this->assertSame(640, $info->code->width); + $this->assertSame(360, $info->code->height); + } + + public function testYoukuBlockedRequestStillHasPlayer(): void + { + $info = $this->embed([])->get('https://v.youku.com/v_show/id_XNTk1MTU4MDQ0OA==.html'); + + $this->assertNotNull($info->code); + $this->assertStringContainsString('player.youku.com/embed/', $info->code->html); + } + + /** + * @return array + */ + public function netEaseUrlProvider(): array + { + return [ + ['https://music.163.com/song?id=186016', 2, '186016'], + ['https://music.163.com/#/song?id=186016', 2, '186016'], + ['https://music.163.com/#/album?id=18905', 1, '18905'], + ['https://music.163.com/#/playlist?id=3778678', 0, '3778678'], + ['https://music.163.com/#/m/song?id=186016', 2, '186016'], + ]; + } + + /** + * @dataProvider netEaseUrlProvider + */ + public function testNetEaseBuildsPlayerIframe(string $url, int $type, string $id): void + { + $info = $this->embed([ + '/song' => $this->page(''), + '/album' => $this->page(''), + '/playlist' => $this->page(''), + ])->get($url); + + $this->assertNotNull($info->code); + $this->assertSame( + "", + $info->code->html + ); + $this->assertSame(330, $info->code->width); + $this->assertSame(86, $info->code->height); + } + + public function testNetEaseFragmentRouteIsRequestedAsPath(): void + { + $info = $this->embed(['/song' => $this->page('')])->get('https://music.163.com/#/song?id=186016'); + $urls = array_map(static fn (RequestInterface $request): string => (string) $request->getUri(), $this->client->requests); + + $this->assertSame(['https://music.163.com/song?id=186016'], $urls); + $this->assertSame('https://music.163.com/song?id=186016', (string) $info->url); + } + + public function testNetEaseAuthorFromDescription(): void + { + $info = $this->embed([ + '/song' => $this->page(''), + ])->get('https://music.163.com/song?id=186016'); + + $this->assertSame('周杰伦', $info->authorName); + } + + /** + * @return array + */ + public function netEaseMvUrlProvider(): array + { + return [ + ['https://music.163.com/mv?id=5436712'], + ['https://music.163.com/#/mv?id=5436712'], + ]; + } + + /** + * NetEase has no official embeddable MV player, so MV pages only get metadata. + * + * @dataProvider netEaseMvUrlProvider + */ + public function testNetEaseMvGetsMetadataOnly(string $url): void + { + $info = $this->embed([ + '/mv' => $this->page(''), + ])->get($url); + $urls = array_map(static fn (RequestInterface $request): string => (string) $request->getUri(), $this->client->requests); + + $this->assertSame(['https://music.163.com/mv?id=5436712'], $urls); + $this->assertSame('广岛之恋', $info->title); + $this->assertNull($info->code); + } + + public function testNetEaseOtherPageHasNoPlayer(): void + { + $info = $this->embed(['/' => $this->page('')])->get('https://music.163.com/'); + + $this->assertNull($info->code); + } + + private function page(string $head): string + { + return 'Page title'.$head.''; + } + + /** + * @param array $routes path => body + */ + private function embed(array $routes): Embed + { + $this->client = $client = new RecordingClient(static function (RequestInterface $request) use ($routes): ResponseInterface { + $factory = new Psr17Factory(); + $body = $routes[$request->getUri()->getPath()] ?? null; + + if ($body === null) { + return $factory->createResponse(403)->withBody($factory->createStream('')); + } + + return $factory->createResponse(200) + ->withHeader('Content-Type', 'text/html') + ->withBody($factory->createStream($body)); + }); + + $crawler = new Crawler($client); + $crawler->setUrlPolicy(UrlPolicy::default()->withResolver(static function (string $host): array { + return ['1.1.1.1']; + })); + + return new Embed($crawler); + } +} diff --git a/tests/PagesTest.php b/tests/PagesTest.php index be1ccb5d..fb117fb8 100644 --- a/tests/PagesTest.php +++ b/tests/PagesTest.php @@ -53,6 +53,12 @@ public function urlDataProvider(): array ['http://www.wired.com/?p=2064839'], ['https://www.itmedia.co.jp/news/articles/2410/28/news159.html'], ['https://4pda.to/2022/12/04/406834/sostoyalsya_reliz_clown_of_duty_parodii_na_call_of_duty/'], + // Bilibili snapshot comes from a restricted network, where it serves its error + // page. Youku and NetEase were captured from a residential connection in Venezuela. + ['https://www.bilibili.com/video/BV1GJ411x7h7'], + ['https://v.youku.com/v_show/id_XNTk1MTU4MDQ0OA==.html'], + ['https://music.163.com/song?id=186016'], + ['https://music.163.com/#/album?id=18905'], ]; } diff --git a/tests/cache/music.163.com.album.cf922cf6241903d934f045c39fca77d5.php b/tests/cache/music.163.com.album.cf922cf6241903d934f045c39fca77d5.php new file mode 100644 index 00000000..199a8302 --- /dev/null +++ b/tests/cache/music.163.com.album.cf922cf6241903d934f045c39fca77d5.php @@ -0,0 +1,2549 @@ + [ + 'server' => [ + 'nginx' + ], + 'date' => [ + 'Wed, 28 Oct 2026 00:28:55 GMT' + ], + 'content-type' => [ + 'text/html; charset=utf8' + ], + 'vary' => [ + 'Accept-Encoding' + ], + 'content-security-policy' => [ + 'upgrade-insecure-requests' + ], + 'x-custom-music-web' => [ + 'no' + ], + 'x-traceid-v2' => [ + '72daa22b186eba2d3f350d15bb10ad63^1790043134004^-15324424752' + ], + 'mconfig-bucket' => [ + '999999' + ], + 'x-traceid' => [ + '000001a17fe8f18f057c0a7bbde50007' + ], + 'cache-control' => [ + 'no-cache', + 'no-store' + ], + 'expires' => [ + 'Thu, 01 Jan 1970 00:00:00 GMT' + ], + 'gw-thread' => [ + '-837227' + ], + 'gw-time' => [ + '1793147335056' + ], + 'x-via' => [ + 'MusicServer' + ], + 'content-encoding' => [ + 'br' + ], + 'Content-Location' => [ + 'https://music.163.com/album?id=18905' + ], + 'X-Request-Time' => [ + '1.462 ms' + ] + ], + 'statusCode' => 200, + 'reasonPhrase' => 'OK', + 'body' => ' + + + + + + + + + + + + + +网易云音乐 + + + + + + + + + + + +
 
+
 
+ + +
+
+
+
    +
  • + +云村交易所 +
  • +
  • + +X StudioAI歌手 +
  • +
  • + +用户认证 +
  • +
  • + +天音AI写歌 +
  • +
  • + +云推歌 +
  • +
  • + +赞赏 +
  • +
+
+ +

+廉正举报 +不良信息举报邮箱: 51jubao@service.netease.com +

+

+互联网宗教信息服务许可证:浙(2022)0000120 +增值电信业务经营许可证:浙B2-20150198 +粤B2-20090191-18  浙ICP备15006616号-4  工业和信息化部备案管理系统网站 +

+

+网易公司版权所有©1997-2026杭州乐读科技有限公司运营:浙网文[2024] 0900-042号 + + +浙公网安备 33010802013307号 + + +算法服务公示信息 + +

+
+
+
+
+ + + + + + +' +]; diff --git a/tests/cache/music.163.com.song.767df0c775ac55440540e297d3818093.php b/tests/cache/music.163.com.song.767df0c775ac55440540e297d3818093.php new file mode 100644 index 00000000..00114ecc --- /dev/null +++ b/tests/cache/music.163.com.song.767df0c775ac55440540e297d3818093.php @@ -0,0 +1,3191 @@ + [ + 'server' => [ + 'nginx' + ], + 'date' => [ + 'Wed, 28 Oct 2026 00:28:53 GMT' + ], + 'content-type' => [ + 'text/html; charset=utf8' + ], + 'vary' => [ + 'Accept-Encoding' + ], + 'content-security-policy' => [ + 'upgrade-insecure-requests' + ], + 'x-custom-music-web' => [ + 'no' + ], + 'x-traceid-v2' => [ + '5b4511c695449ad4284f5f2b806d77a5^1791444329318^-8184289037' + ], + 'mconfig-bucket' => [ + '999999' + ], + 'x-traceid' => [ + '000001a17fe8e9e209320ab0f83c0007' + ], + 'cache-control' => [ + 'no-cache', + 'no-store' + ], + 'expires' => [ + 'Thu, 01 Jan 1970 00:00:00 GMT' + ], + 'gw-thread' => [ + '888890' + ], + 'gw-time' => [ + '1793147333090' + ], + 'x-via' => [ + 'MusicServer' + ], + 'content-encoding' => [ + 'br' + ], + 'Content-Location' => [ + 'https://music.163.com/song?id=186016' + ], + 'X-Request-Time' => [ + '2.169 ms' + ] + ], + 'statusCode' => 200, + 'reasonPhrase' => 'OK', + 'body' => ' + + + + + + + + + + + + + + + +晴天(Sunny Day) - 周杰伦 - 单曲 - 网易云音乐 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+
 
+ +
+
+
+
+
+
+
+
+晴天_周杰伦_叶惠美 | 在线播放_晴天歌词_晴天下载 | 网易云音乐 + +
+ +
+
点击打开客户端
+
+
+
+
+ +
+晴天 +
+Sunny Day +
+
+
+

歌手:周杰伦

+

所属专辑:叶惠美

+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+

+包含这首歌的歌单 +

+ +
+

+网易云音乐多端下载 +

+ +

同步歌单,随时畅听好音乐

+
+

+用户wiki +

+ + +补充或修改歌曲资料 + + + +用户wiki任务中心 + +
+
+
+
+
+
+
    +
  • + +云村交易所 +
  • +
  • + +X StudioAI歌手 +
  • +
  • + +用户认证 +
  • +
  • + +天音AI写歌 +
  • +
  • + +云推歌 +
  • +
  • + +赞赏 +
  • +
+
+ +

+廉正举报 +不良信息举报邮箱: 51jubao@service.netease.com +

+

+互联网宗教信息服务许可证:浙(2022)0000120 +增值电信业务经营许可证:浙B2-20150198 +粤B2-20090191-18  浙ICP备15006616号-4  工业和信息化部备案管理系统网站 +

+

+网易公司版权所有©1997-2026杭州乐读科技有限公司运营:浙网文[2024] 0900-042号 + + +浙公网安备 33010802013307号 + + +算法服务公示信息 + +

+
+
+
+
+ + + + + + +' +]; diff --git a/tests/cache/v.youku.com.v_show-id_xntk1mtu4mdq0oa-.html.php b/tests/cache/v.youku.com.v_show-id_xntk1mtu4mdq0oa-.html.php new file mode 100644 index 00000000..8067daa3 --- /dev/null +++ b/tests/cache/v.youku.com.v_show-id_xntk1mtu4mdq0oa-.html.php @@ -0,0 +1,110 @@ + [ + 'date' => [ + 'Wed, 28 Oct 2026 00:44:42 GMT' + ], + 'content-type' => [ + 'text/html; charset=utf-8' + ], + 'vary' => [ + 'Accept-Encoding' + ], + 'x-server-id' => [ + 'e339c9461b97c02b1a60114e0fac7ba996e5c171ea4e47c527ff2c52d4b9f6c2be93192261c5c71d' + ], + 'x-frame-options' => [ + 'SAMEORIGIN' + ], + 'x-xss-protection' => [ + '1; mode=block' + ], + 'x-content-type-options' => [ + 'nosniff' + ], + 'x-download-options' => [ + 'noopen' + ], + 'strict-transport-security' => [ + 'max-age=31536000', + 'max-age=31536000' + ], + 'x-readtime' => [ + '42' + ], + 'content-encoding' => [ + 'gzip' + ], + 'server' => [ + 'Tengine/Aserver' + ], + 'eagleeye-traceid' => [ + '2100cfab17931482819038336e2d98', + '2100cfab17931482819038336e2d98' + ], + 'timing-allow-origin' => [ + '*' + ], + 's-rt' => [ + '146' + ], + 'Content-Location' => [ + 'https://v.youku.com/v_show/id_XNTk1MTU4MDQ0OA==.html' + ], + 'X-Request-Time' => [ + '1.371 ms' + ] + ], + 'statusCode' => 200, + 'reasonPhrase' => 'OK', + 'body' => ' +田宝申盟新婚快乐-其他-高清完整正版视频在线观看-优酷
    历史
    客户端
    登录
    ' +]; diff --git a/tests/cache/www.bilibili.com.video-bv1gj411x7h7.php b/tests/cache/www.bilibili.com.video-bv1gj411x7h7.php new file mode 100644 index 00000000..7a9e2077 --- /dev/null +++ b/tests/cache/www.bilibili.com.video-bv1gj411x7h7.php @@ -0,0 +1,120 @@ + [ + 'date' => [ + 'Wed, 28 Oct 2026 00:28:50 GMT' + ], + 'content-type' => [ + 'text/html' + ], + 'server' => [ + 'openresty' + ], + 'x-sec-request-id' => [ + '07e43c86-e59c-67a3-0000-000031e1594c' + ], + 'Content-Location' => [ + 'https://www.bilibili.com/video/BV1GJ411x7h7' + ], + 'X-Request-Time' => [ + '1.371 ms' + ] + ], + 'statusCode' => 412, + 'reasonPhrase' => 'Precondition Failed', + 'body' => ' + + + + + + + + + + 出错啦! - bilibili.com + + + + + + + +
    +
    +
    +
    错误号: 412
    +
    +
    由于触发哔哩哔哩安全风控策略,该次访问请求被拒绝。 +
    The request was rejected because of the bilibili security control policy.
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + +' +]; diff --git a/tests/fixtures/music.163.com.album.cf922cf6241903d934f045c39fca77d5.php b/tests/fixtures/music.163.com.album.cf922cf6241903d934f045c39fca77d5.php new file mode 100644 index 00000000..ef2eb70a --- /dev/null +++ b/tests/fixtures/music.163.com.album.cf922cf6241903d934f045c39fca77d5.php @@ -0,0 +1,32 @@ + null, + 'authorUrl' => null, + 'cms' => null, + 'code' => [ + 'html' => '', + 'width' => 330, + 'height' => 86, + 'ratio' => 26.061 + ], + 'description' => null, + 'favicon' => 'https://s1.music.126.net/style/favicon.ico?v20180823', + 'feeds' => [], + 'icon' => null, + 'image' => null, + 'keywords' => [], + 'language' => 'zh-CN', + 'languages' => [], + 'license' => null, + 'providerName' => '网易云音乐', + 'providerUrl' => 'https://music.163.com', + 'publishedTime' => null, + 'redirect' => null, + 'title' => '网易云音乐', + 'url' => 'https://music.163.com/album?id=18905', + 'linkedData' => [], + 'oEmbed' => [], + 'allLinkedData' => [] +]; diff --git a/tests/fixtures/music.163.com.song.767df0c775ac55440540e297d3818093.php b/tests/fixtures/music.163.com.song.767df0c775ac55440540e297d3818093.php new file mode 100644 index 00000000..682cc4d4 --- /dev/null +++ b/tests/fixtures/music.163.com.song.767df0c775ac55440540e297d3818093.php @@ -0,0 +1,137 @@ + '周杰伦', + 'authorUrl' => null, + 'cms' => null, + 'code' => [ + 'html' => '', + 'width' => 330, + 'height' => 86, + 'ratio' => 26.061 + ], + 'description' => '歌曲名《晴天》,别名《Sunny Day》,由 周杰伦 演唱,收录于《叶惠美》专辑中', + 'favicon' => 'https://s1.music.126.net/style/favicon.ico?v20180823', + 'feeds' => [], + 'icon' => null, + 'image' => 'http://p1.music.126.net/ZGffiDQZrGj5s_hnR1CNbg==/109951165566379710.jpg', + 'keywords' => [ + '晴天,sunny day,周杰伦,《晴天》下载,《晴天》歌词,《晴天》在线试听,《晴天》mp3下载,《晴天》无损音乐下载' + ], + 'language' => 'zh-CN', + 'languages' => [], + 'license' => null, + 'providerName' => '网易云音乐', + 'providerUrl' => 'https://music.163.com', + 'publishedTime' => '2003-07-31 00:00:00', + 'redirect' => null, + 'title' => '晴天', + 'url' => 'https://music.163.com/song?id=186016', + 'linkedData' => [ + '@context' => 'https://schema.org', + '@type' => [ + 'MusicRecording', + 'CreativeWork' + ], + 'name' => '晴天', + 'description' => '歌曲名《晴天》,别名《Sunny Day》,由 周杰伦 演唱,收录于《叶惠美》专辑中。《晴天》下载,《晴天》在线试听,更多相关歌曲推荐尽在网易云音乐', + 'image' => 'https://p1.music.126.net/ZGffiDQZrGj5s_hnR1CNbg==/109951165566379710.jpg', + 'byArtist' => [ + [ + '@type' => 'MusicGroup', + 'name' => '周杰伦', + 'url' => 'https://music.163.com/artist?id=6452' + ] + ], + 'inAlbum' => [ + '@type' => 'MusicAlbum', + 'name' => '叶惠美', + 'url' => 'https://music.163.com/album?id=18905', + 'image' => 'https://p1.music.126.net/ZGffiDQZrGj5s_hnR1CNbg==/109951165566379710.jpg' + ], + 'duration' => 'PT4M29S', + 'datePublished' => '2003-07-31T00:00:00', + 'publisher' => [ + '@type' => 'Organization', + 'name' => '网易云音乐', + 'logo' => [ + '@type' => 'ImageObject', + 'url' => 'https://p3.music.126.net/9z9CeujRSPOPm7Rq2DFw_g==/6674035581283071.jpg?param=200y200' + ] + ], + 'mainEntityOfPage' => [ + '@type' => 'WebPage', + '@id' => 'https://music.163.com/song?id=186016' + ] + ], + 'oEmbed' => [], + 'allLinkedData' => [ + [ + '@context' => 'https://ziyuan.baidu.com/contexts/cambrian.jsonld', + '@id' => 'https://music.163.com:80/song?id=186016', + 'appid' => '1582028769404989', + 'title' => '晴天(Sunny Day)', + 'images' => [ + 'http://p1.music.126.net/ZGffiDQZrGj5s_hnR1CNbg==/109951165566379710.jpg' + ], + 'description' => '歌曲名《晴天》,别名《Sunny Day》,由 周杰伦 演唱,收录于《叶惠美》专辑中。《晴天》下载,《晴天》在线试听,更多相关歌曲推荐尽在网易云音乐', + 'pubDate' => '2003-07-31T00:00:00' + ], + [ + '@context' => 'https://schema.org', + '@type' => [ + 'MusicRecording', + 'CreativeWork' + ], + 'name' => '晴天', + 'description' => '歌曲名《晴天》,别名《Sunny Day》,由 周杰伦 演唱,收录于《叶惠美》专辑中。《晴天》下载,《晴天》在线试听,更多相关歌曲推荐尽在网易云音乐', + 'image' => 'https://p1.music.126.net/ZGffiDQZrGj5s_hnR1CNbg==/109951165566379710.jpg', + 'byArtist' => [ + [ + '@type' => 'MusicGroup', + 'name' => '周杰伦', + 'url' => 'https://music.163.com/artist?id=6452' + ] + ], + 'inAlbum' => [ + '@type' => 'MusicAlbum', + 'name' => '叶惠美', + 'url' => 'https://music.163.com/album?id=18905', + 'image' => 'https://p1.music.126.net/ZGffiDQZrGj5s_hnR1CNbg==/109951165566379710.jpg' + ], + 'duration' => 'PT4M29S', + 'datePublished' => '2003-07-31T00:00:00', + 'publisher' => [ + '@type' => 'Organization', + 'name' => '网易云音乐', + 'logo' => [ + '@type' => 'ImageObject', + 'url' => 'https://p3.music.126.net/9z9CeujRSPOPm7Rq2DFw_g==/6674035581283071.jpg?param=200y200' + ] + ], + 'mainEntityOfPage' => [ + '@type' => 'WebPage', + '@id' => 'https://music.163.com/song?id=186016' + ] + ], + [ + '@context' => 'https://schema.org', + '@type' => 'BreadcrumbList', + 'itemListElement' => [ + [ + '@type' => 'ListItem', + 'position' => 1, + 'name' => '首页', + 'item' => 'https://music.163.com/' + ], + [ + '@type' => 'ListItem', + 'position' => 2, + 'name' => '晴天', + 'item' => 'https://music.163.com/song?id=186016' + ] + ] + ] + ] +]; diff --git a/tests/fixtures/v.youku.com.v_show-id_xntk1mtu4mdq0oa-.html.php b/tests/fixtures/v.youku.com.v_show-id_xntk1mtu4mdq0oa-.html.php new file mode 100644 index 00000000..cc10ddd4 --- /dev/null +++ b/tests/fixtures/v.youku.com.v_show-id_xntk1mtu4mdq0oa-.html.php @@ -0,0 +1,152 @@ + null, + 'authorUrl' => null, + 'cms' => null, + 'code' => [ + 'html' => '', + 'width' => 640, + 'height' => 360, + 'ratio' => 56.25 + ], + 'description' => '田宝申盟新婚快乐 是在优酷播出的其他高清视频,于2023-03-19 17:35:28上线。视频内容简介:田宝申盟新婚快乐', + 'favicon' => 'https://img.alicdn.com/imgextra/i2/O1CN01BeAcgL1ywY0G5nSn8_!!6000000006643-2-tps-195-195.png', + 'feeds' => [], + 'icon' => null, + 'image' => null, + 'keywords' => [ + '优酷视频,优酷,田宝申盟新婚快乐 其他', + '田宝申盟新婚快乐 其他' + ], + 'language' => 'zh_CN', + 'languages' => [], + 'license' => null, + 'providerName' => '优酷', + 'providerUrl' => 'https://v.youku.com', + 'publishedTime' => '2023-03-19 17:35:28', + 'redirect' => null, + 'title' => '田宝申盟新婚快乐', + 'url' => 'https://v.youku.com/v_show/id_XNTk1MTU4MDQ0OA==.html', + 'linkedData' => [ + '@context' => 'https://schema.org', + '@graph' => [ + [ + '@type' => 'VideoObject', + 'name' => '田宝申盟新婚快乐-其他-高清完整正版视频在线观看-优酷', + 'description' => '田宝申盟新婚快乐 是在优酷播出的其他高清视频,于2023-03-19 17:35:28上线。视频内容简介:田宝申盟新婚快乐', + 'thumbnailUrl' => '', + 'uploadDate' => '2023-03-19 17:35:28', + 'datePublished' => '2023-03-19 17:35:28', + 'duration' => 'PT0M0S', + 'contentUrl' => 'https://v.youku.com/v_show/id_XNTk1MTU4MDQ0OA==.html?vid=XNTk1MTU4MDQ0OA==', + 'embedUrl' => 'https://v.youku.com/v_show/id_XNTk1MTU4MDQ0OA==.html?vid=XNTk1MTU4MDQ0OA==', + 'genre' => '其他', + 'inLanguage' => 'zh-CN', + 'regionsAllowed' => 'CN', + 'isAccessibleForFree' => false, + 'keywords' => '田宝申盟新婚快乐 其他', + 'publisher' => [ + '@type' => 'Organization', + 'name' => '优酷', + 'logo' => [ + '@type' => 'ImageObject', + 'url' => 'https://img.alicdn.com/imgextra/i2/O1CN01BeAcgL1ywY0G5nSn8_!!6000000006643-2-tps-195-195.png' + ] + ] + ], + [ + '@type' => 'BreadcrumbList', + 'itemListElement' => [ + [ + '@type' => 'ListItem', + 'position' => 1, + 'name' => '优酷', + 'item' => 'https://www.youku.com' + ], + [ + '@type' => 'ListItem', + 'position' => 2, + 'name' => '其他', + 'item' => 'https://www.youku.com/channel/其他' + ], + [ + '@type' => 'ListItem', + 'position' => 3, + 'name' => '田宝申盟新婚快乐' + ], + [ + '@type' => 'ListItem', + 'position' => 4, + 'name' => '田宝申盟新婚快乐-其他-高清完整正版视频在线观看-优酷', + 'item' => 'https://v.youku.com/v_show/id_XNTk1MTU4MDQ0OA==.html?vid=XNTk1MTU4MDQ0OA==' + ] + ] + ] + ] + ], + 'oEmbed' => [], + 'allLinkedData' => [ + [ + '@context' => 'https://schema.org', + '@graph' => [ + [ + '@type' => 'VideoObject', + 'name' => '田宝申盟新婚快乐-其他-高清完整正版视频在线观看-优酷', + 'description' => '田宝申盟新婚快乐 是在优酷播出的其他高清视频,于2023-03-19 17:35:28上线。视频内容简介:田宝申盟新婚快乐', + 'thumbnailUrl' => '', + 'uploadDate' => '2023-03-19 17:35:28', + 'datePublished' => '2023-03-19 17:35:28', + 'duration' => 'PT0M0S', + 'contentUrl' => 'https://v.youku.com/v_show/id_XNTk1MTU4MDQ0OA==.html?vid=XNTk1MTU4MDQ0OA==', + 'embedUrl' => 'https://v.youku.com/v_show/id_XNTk1MTU4MDQ0OA==.html?vid=XNTk1MTU4MDQ0OA==', + 'genre' => '其他', + 'inLanguage' => 'zh-CN', + 'regionsAllowed' => 'CN', + 'isAccessibleForFree' => false, + 'keywords' => '田宝申盟新婚快乐 其他', + 'publisher' => [ + '@type' => 'Organization', + 'name' => '优酷', + 'logo' => [ + '@type' => 'ImageObject', + 'url' => 'https://img.alicdn.com/imgextra/i2/O1CN01BeAcgL1ywY0G5nSn8_!!6000000006643-2-tps-195-195.png' + ] + ] + ], + [ + '@type' => 'BreadcrumbList', + 'itemListElement' => [ + [ + '@type' => 'ListItem', + 'position' => 1, + 'name' => '优酷', + 'item' => 'https://www.youku.com' + ], + [ + '@type' => 'ListItem', + 'position' => 2, + 'name' => '其他', + 'item' => 'https://www.youku.com/channel/其他' + ], + [ + '@type' => 'ListItem', + 'position' => 3, + 'name' => '田宝申盟新婚快乐' + ], + [ + '@type' => 'ListItem', + 'position' => 4, + 'name' => '田宝申盟新婚快乐-其他-高清完整正版视频在线观看-优酷', + 'item' => 'https://v.youku.com/v_show/id_XNTk1MTU4MDQ0OA==.html?vid=XNTk1MTU4MDQ0OA==' + ] + ] + ] + ] + ] + ] +]; diff --git a/tests/fixtures/www.bilibili.com.video-bv1gj411x7h7.php b/tests/fixtures/www.bilibili.com.video-bv1gj411x7h7.php new file mode 100644 index 00000000..14d7d2c8 --- /dev/null +++ b/tests/fixtures/www.bilibili.com.video-bv1gj411x7h7.php @@ -0,0 +1,35 @@ + null, + 'authorUrl' => null, + 'cms' => null, + 'code' => [ + 'html' => '', + 'width' => 640, + 'height' => 360, + 'ratio' => 56.25 + ], + 'description' => null, + 'favicon' => 'https://static.hdslb.com/images/favicon.ico', + 'feeds' => [], + 'icon' => null, + 'image' => null, + 'keywords' => [], + 'language' => 'zh-cn', + 'languages' => [], + 'license' => null, + 'providerName' => 'Bilibili', + 'providerUrl' => 'https://www.bilibili.com', + 'publishedTime' => null, + 'redirect' => null, + 'title' => null, + 'url' => 'https://www.bilibili.com/video/BV1GJ411x7h7', + 'linkedData' => [], + 'oEmbed' => [], + 'allLinkedData' => [] +];