Skip to content

Commit 32d84db

Browse files
committed
v4.1.1
1 parent 94ae992 commit 32d84db

7 files changed

+388
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [4.1.1] - 2020-04-24
9+
### Added
10+
- Updated oembed endpoints from `oembed.com`
11+
- Add support for tiktok.com
12+
813
## [4.1.0] - 2020-04-19
914
### Added
1015
- Ability to send settings to `CurlClient`. Added the `cookies_path` setting to customize the file used for cookies. [#345]
@@ -40,4 +45,5 @@ Full library refactoring.
4045
[#345]: https://github.com/oscarotero/Embed/issues/345
4146
[#346]: https://github.com/oscarotero/Embed/issues/346
4247

48+
[4.1.1]: https://github.com/oscarotero/Embed/compare/v4.1.0...v4.1.1
4349
[4.1.0]: https://github.com/oscarotero/Embed/compare/v4.0.0...v4.1.0

scripts/update-oembed.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
saveEndpoint('http://www.scribd.com/services/oembed/', ['www.scribd.com/document/*']);
2525
saveEndpoint('https://api.imgur.com/oembed', ['imgur.com/*', 'i.imgur.com/*']);
2626
saveEndpoint('https://www.youtube.com/oembed', ['*.youtube.com/playlist?*']);
27+
saveEndpoint('https://www.tiktok.com/oembed', ['*.tiktok.com/*']);
2728

2829
//Export the endpoints
2930
file_put_contents(

src/resources/oembed.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,4 +898,7 @@
898898
'|^https?://imgur\\.com/.*$|i',
899899
'|^https?://i\\.imgur\\.com/.*$|i',
900900
],
901+
'https://www.tiktok.com/oembed' => [
902+
'|^https?://.*\\.tiktok\\.com/.*$|i',
903+
],
901904
];

tests/PagesTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ public function testTwitter()
168168
$this->assertEmbed('https://twitter.com/pepephone/status/436461658601713664');
169169
}
170170

171+
public function testTikTok()
172+
{
173+
$this->assertEmbed('https://www.tiktok.com/@a3noticias/video/6806030056956251397');
174+
}
175+
171176
public function testYoutube()
172177
{
173178
$this->assertEmbed('http://www.youtube.com/watch?v=eiHXASgRTcA');

tests/cache/www.tiktok.com.a3noticias-video-6806030056956251397.php

Lines changed: 151 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?php
2+
declare(strict_types = 1);
3+
4+
return [
5+
'headers' => [
6+
'server' => [
7+
'nginx/1.14.2'
8+
],
9+
'content-type' => [
10+
'application/json; charset=utf-8'
11+
],
12+
'x-tt-logid' => [
13+
'20200424151649010115115139027411F6'
14+
],
15+
'strict-transport-security' => [
16+
'max-age=31536000'
17+
],
18+
'x-ua-compatible' => [
19+
'IE=Edge,chrome=1'
20+
],
21+
'x-xss-protection' => [
22+
'1; mode=block'
23+
],
24+
'x-frame-options' => [
25+
'DENY'
26+
],
27+
'x-content-type-options' => [
28+
'nosniff'
29+
],
30+
'x-download-options' => [
31+
'noopen'
32+
],
33+
'content-security-policy-report-only' => [
34+
'default-src \'self\' data: blob: *.tiktokcdn.com *.akamaized.net *.muscdn.com *.tiktok.com *.musical.ly *.byteoversea.com *.ibytedtos.com;connect-src *.ibytedtos.com *.bytedanceapi.com *.tiktokv.com *.snssdk.com *.tiktok.com *.musical.ly *.byteoversea.com *.tiktokcdn.com *.hypstarcdn.com *.bytedance.net;script-src data: blob: \'unsafe-inline\' \'unsafe-eval\' *.bytedance.com *.byteoversea.com *.ibytedtos.com *.ipstatp.com *.tiktok.com *.tiktokcdn.com *.hypstarcdn.com *.googletagmanager.com *.google-analytics.com *.akamaized.com *.muscdn.com *.googleapis.com;style-src \'unsafe-inline\' *.tiktokcdn.com *.muscdn.com *.akamaized.net *.ibytedtos.com *.tiktok.com *.ibyteimg.com;img-src data: *.muscdn.com *.akamaized.net *.tiktokcdn.com *.ibytedtos.com *.ibyteimg.com *.musical.ly *.tiktok.com *.hypstarcdn.com *.facebook.com *.byted.org *.google-analytics.com;frame-src *.tiktok.com;media-src *.tiktokcdn.com *.akamaized.net *.muscdn.com *.ibytedtos.com *.musical.ly *.byted.org;report-uri https://mon-va.byteoversea.com/log/sentry/v2/api/slardar/main/?ev_type=csp&bid=tiktok_web'
35+
],
36+
'x-csp-nonce' => [
37+
'dweGg-t_-mkWd-X0LOSLt'
38+
],
39+
'server-timing' => [
40+
'inner; dur=84',
41+
'cdn-cache; desc=MISS, edge; dur=1, origin; dur=275'
42+
],
43+
'x-tt-trace-host' => [
44+
'016d1b89f5d6bc49723e6fc317b08617e06bf6f55d41be29f14088467c9a0adab78921e452ba08ecdfe7fa8d382a17c0af23365a33af1098d2551c787a9a0055f14d5fc99e4396a0662a2605787f6192f9'
45+
],
46+
'content-encoding' => [
47+
'br'
48+
],
49+
'date' => [
50+
'Fri, 24 Apr 2020 15:16:49 GMT'
51+
],
52+
'content-length' => [
53+
'550'
54+
],
55+
'x-tt-trace-tag' => [
56+
'id=16;cdn-cache=miss;type=dyn'
57+
],
58+
'x-origin-response-time' => [
59+
'275,212.145.41.196'
60+
],
61+
'access-control-expose-headers' => [
62+
'x-tt-trace-host,x-tt-trace-id'
63+
],
64+
'access-control-allow-methods' => [
65+
'OPTIONS,GET'
66+
],
67+
'access-control-allow-origin' => [
68+
'*'
69+
],
70+
'Content-Location' => [
71+
'https://www.tiktok.com/oembed?url=https%3A%2F%2Fwww.tiktok.com%2F%40a3noticias%2Fvideo%2F6806030056956251397&format=json'
72+
],
73+
'X-Request-Time' => [
74+
'0.486 ms'
75+
]
76+
],
77+
'statusCode' => 200,
78+
'reasonPhrase' => 'OK',
79+
'body' => '{"version":"1.0","type":"video","title":"Nuestro #AplausoSanitario más sincero. Para todos. Y recuerda, #QuédateEnCasa","author_url":"https://www.tiktok.com/@a3noticias","author_name":"Antena 3 Noticias","width":"100%","height":"100%","html":"<blockquote class=\\"tiktok-embed\\" cite=\\"https://www.tiktok.com/@a3noticias/video/6806030056956251397\\" data-video-id=\\"6806030056956251397\\" style=\\"max-width: 605px;min-width: 325px;\\" > <section> <a target=\\"_blank\\" title=\\"@a3noticias\\" href=\\"https://www.tiktok.com/@a3noticias\\">@a3noticias</a> <p>Nuestro <a title=\\"aplausosanitario\\" target=\\"_blank\\" href=\\"https://www.tiktok.com/tag/aplausosanitario\\">#AplausoSanitario</a> más sincero. Para todos. Y recuerda, <a title=\\"quédateencasa\\" target=\\"_blank\\" href=\\"https://www.tiktok.com/tag/quédateencasa\\">#QuédateEnCasa</a></p> <a target=\\"_blank\\" title=\\"♬ Resistiré - Duo Dinamico\\" href=\\"https://www.tiktok.com/music/Resistiré-250824169968246784\\">♬ Resistiré - Duo Dinamico</a> </section> </blockquote> <script async src=\\"https://www.tiktok.com/embed.js\\"></script>","thumbnail_width":480,"thumbnail_height":848,"thumbnail_url":"https://p16-va-default.akamaized.net/obj/tos-maliva-p-0068/26093075d77684fa3d60fd42bf50d48a","provider_url":"https://www.tiktok.com","provider_name":"TikTok"}'
80+
];
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<?php
2+
declare(strict_types = 1);
3+
4+
return [
5+
'authorName' => 'Antena 3 Noticias',
6+
'authorUrl' => 'https://www.tiktok.com/@a3noticias',
7+
'cms' => null,
8+
'code' => [
9+
'html' => '<blockquote class="tiktok-embed" cite="https://www.tiktok.com/@a3noticias/video/6806030056956251397" data-video-id="6806030056956251397" style="max-width: 605px;min-width: 325px;" > <section> <a target="_blank" title="@a3noticias" href="https://www.tiktok.com/@a3noticias">@a3noticias</a> <p>Nuestro <a title="aplausosanitario" target="_blank" href="https://www.tiktok.com/tag/aplausosanitario">#AplausoSanitario</a> más sincero. Para todos. Y recuerda, <a title="quédateencasa" target="_blank" href="https://www.tiktok.com/tag/quédateencasa">#QuédateEnCasa</a></p> <a target="_blank" title="♬ Resistiré - Duo Dinamico" href="https://www.tiktok.com/music/Resistiré-250824169968246784">♬ Resistiré - Duo Dinamico</a> </section> </blockquote> <script async src="https://www.tiktok.com/embed.js"></script>',
10+
'width' => 100,
11+
'height' => 100
12+
],
13+
'description' => 'Nuestro #AplausoSanitario más sincero. Para todos. Y recuerda, #QuédateEnCasa',
14+
'favicon' => 'https://s16.tiktokcdn.com/musical/resource/wap/static/image/logo_144c91a.png?v=2',
15+
'feeds' => [],
16+
'icon' => 'https://s16.tiktokcdn.com/musical/resource/mtact/static/pwa/icon_128x128.png',
17+
'image' => 'https://p16-va-default.akamaized.net/obj/tos-maliva-p-0068/26093075d77684fa3d60fd42bf50d48a',
18+
'keywords' => [
19+
'a3noticias',
20+
'antena 3 noticias',
21+
'aplausosanitario',
22+
'quédateencasa'
23+
],
24+
'language' => 'en',
25+
'languages' => [
26+
'x-default' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397',
27+
'id' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=id',
28+
'de' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=de',
29+
'en' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=en',
30+
'es' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=es',
31+
'fr' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=fr',
32+
'it' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=it',
33+
'pl' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=pl',
34+
'pt-BR' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=pt_BR',
35+
'vi' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=vi',
36+
'tr' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=tr',
37+
'ru' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=ru',
38+
'hi-IN' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=hi',
39+
'ko' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=ko',
40+
'ja' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=ja',
41+
'zh-Hant' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=zh_Hant',
42+
'ar' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397?lang=ar'
43+
],
44+
'license' => null,
45+
'providerName' => 'TikTok',
46+
'providerUrl' => 'https://www.tiktok.com/',
47+
'publishedTime' => null,
48+
'redirect' => null,
49+
'title' => 'Nuestro #AplausoSanitario más sincero. Para todos. Y recuerda, #QuédateEnCasa',
50+
'url' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397',
51+
'linkedData' => [
52+
'@context' => 'http://schema.org/',
53+
'@type' => 'VideoObject',
54+
'url' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397',
55+
'name' => 'Antena 3 Noticias(@a3noticias) on TikTok Nuestro #AplausoSanitario más sincero. Para todos. Y recuerda, #QuédateEnCasa',
56+
'description' => 'Antena 3 Noticias(@a3noticias) has created a short video on TikTok with music Resistiré. Nuestro #AplausoSanitario más sincero. Para todos. Y recuerda, #QuédateEnCasa',
57+
'keywords' => 'a3noticias, Antena 3 Noticias,aplausosanitario,quédateencasa',
58+
'thumbnailUrl' => [
59+
'https://p16-va-default.akamaized.net/obj/tos-maliva-p-0068/26093075d77684fa3d60fd42bf50d48a',
60+
'https://p16-va-default.akamaized.net/obj/tos-maliva-p-0068/f6341ac3dbb54a188f2ea94ac27dd848_1584652366'
61+
],
62+
'uploadDate' => '2020-03-19T21:12:41.000Z',
63+
'contentUrl' => 'https://v19.muscdn.com/8bf11e3d42bab77f82d7a093d48cfed5/5ea3575d/video/tos/useast2a/tos-useast2a-ve-0068c003/2e16caf331794dd3bb95baf864210f7d/?a=1233&br=1912&bt=956&cr=0&cs=0&dr=0&ds=2&er=&l=20200424151648010115228069176F9653&lr=tiktok_m&qs=0&rc=M2x0Zjxrdmp4czMzNjczM0ApaGk1NWY4Ojw8N2Y7PDZpOWcwby5fc2ZlLW1fLS0uMTZzcy0zLjNjNC5hMWE1YjQ1YTE6Yw%3D%3D&vl=&vr=',
64+
'embedUrl' => 'https://www.tiktok.com/embed/v2/6806030056956251397',
65+
'commentCount' => '346',
66+
'duration' => 'PT29S',
67+
'audio' => [
68+
'name' => 'Resistiré - Duo Dinamico',
69+
'author' => 'Duo Dinamico',
70+
'mainEntityOfPage' => [
71+
'@type' => 'ItemPage',
72+
'@id' => 'https://www.tiktok.com/music/Resistiré-250824169968246784'
73+
]
74+
],
75+
'creator' => [
76+
'@type' => 'Person',
77+
'name' => 'Antena 3 Noticias',
78+
'alternateName' => 'a3noticias',
79+
'url' => 'https://www.tiktok.com/@a3noticias',
80+
'interactionStatistic' => [
81+
[
82+
'@type' => 'InteractionCounter',
83+
'interactionType' => [
84+
'@type' => 'http://schema.org/LikeAction'
85+
],
86+
'userInteractionCount' => '139176'
87+
],
88+
[
89+
'@type' => 'InteractionCounter',
90+
'interactionType' => [
91+
'@type' => 'http://schema.org/FollowAction'
92+
],
93+
'userInteractionCount' => 21892
94+
]
95+
]
96+
],
97+
'width' => 480,
98+
'height' => 848,
99+
'interactionStatistic' => [
100+
[
101+
'@type' => 'InteractionCounter',
102+
'interactionType' => [
103+
'@type' => 'http://schema.org/WatchAction'
104+
],
105+
'userInteractionCount' => 207568
106+
],
107+
[
108+
'@type' => 'InteractionCounter',
109+
'interactionType' => [
110+
'@type' => 'http://schema.org/LikeAction'
111+
],
112+
'userInteractionCount' => 10645
113+
],
114+
[
115+
'@type' => 'InteractionCounter',
116+
'interactionType' => [
117+
'@type' => 'http://schema.org/ShareAction'
118+
],
119+
'userInteractionCount' => 139
120+
]
121+
],
122+
'mainEntityOfPage' => [
123+
'@type' => 'ItemPage',
124+
'@id' => 'https://www.tiktok.com/@a3noticias/video/6806030056956251397'
125+
]
126+
],
127+
'oEmbed' => [
128+
'version' => '1.0',
129+
'type' => 'video',
130+
'title' => 'Nuestro #AplausoSanitario más sincero. Para todos. Y recuerda, #QuédateEnCasa',
131+
'author_url' => 'https://www.tiktok.com/@a3noticias',
132+
'author_name' => 'Antena 3 Noticias',
133+
'width' => '100%',
134+
'height' => '100%',
135+
'html' => '<blockquote class="tiktok-embed" cite="https://www.tiktok.com/@a3noticias/video/6806030056956251397" data-video-id="6806030056956251397" style="max-width: 605px;min-width: 325px;" > <section> <a target="_blank" title="@a3noticias" href="https://www.tiktok.com/@a3noticias">@a3noticias</a> <p>Nuestro <a title="aplausosanitario" target="_blank" href="https://www.tiktok.com/tag/aplausosanitario">#AplausoSanitario</a> más sincero. Para todos. Y recuerda, <a title="quédateencasa" target="_blank" href="https://www.tiktok.com/tag/quédateencasa">#QuédateEnCasa</a></p> <a target="_blank" title="♬ Resistiré - Duo Dinamico" href="https://www.tiktok.com/music/Resistiré-250824169968246784">♬ Resistiré - Duo Dinamico</a> </section> </blockquote> <script async src="https://www.tiktok.com/embed.js"></script>',
136+
'thumbnail_width' => 480,
137+
'thumbnail_height' => 848,
138+
'thumbnail_url' => 'https://p16-va-default.akamaized.net/obj/tos-maliva-p-0068/26093075d77684fa3d60fd42bf50d48a',
139+
'provider_url' => 'https://www.tiktok.com',
140+
'provider_name' => 'TikTok'
141+
]
142+
];

0 commit comments

Comments
 (0)