@@ -24,23 +24,34 @@ class HtmlParser extends BaseParser implements ParserInterface
2424 */
2525 private $ tags = [
2626 'cover ' => [
27- ['selector ' => 'meta[itemprop=" image"] ' , 'attribute ' => 'content ' ],
27+ ['selector ' => 'meta[property="twitter: image"] ' , 'attribute ' => 'value ' ],
2828 ['selector ' => 'meta[property="og:image"] ' , 'attribute ' => 'content ' ],
29- ['selector ' => 'meta[property="twitter: image"] ' , 'attribute ' => 'value ' ]
29+ ['selector ' => 'meta[itemprop=" image"] ' , 'attribute ' => 'content ' ],
3030 ],
3131
3232 'title ' => [
33- ['selector ' => 'meta[itemprop="name"] ' , 'attribute ' => 'content ' ],
34- ['selector ' => 'meta[property="og:title"] ' , 'attribute ' => 'content ' ],
3533 ['selector ' => 'meta[property="twitter:title"] ' , 'attribute ' => 'value ' ],
34+ ['selector ' => 'meta[property="og:title"] ' , 'attribute ' => 'content ' ],
35+ ['selector ' => 'meta[itemprop="name"] ' , 'attribute ' => 'content ' ],
3636 ['selector ' => 'title ' ]
3737 ],
3838
3939 'description ' => [
40- ['selector ' => 'meta[itemprop=" description"] ' , 'attribute ' => 'content ' ],
40+ ['selector ' => 'meta[property="twitter: description"] ' , 'attribute ' => 'content ' ],
4141 ['selector ' => 'meta[property="og:description"] ' , 'attribute ' => 'content ' ],
42- ['selector ' => 'meta[name="description"] ' , 'attribute ' => 'content ' ]
43- ]
42+ ['selector ' => 'meta[itemprop="description"] ' , 'attribute ' => 'content ' ],
43+ ['selector ' => 'meta[name="description"] ' , 'attribute ' => 'content ' ],
44+ ],
45+
46+ 'video ' => [
47+ ['selector ' => 'meta[property="twitter:player:stream"] ' , 'attribute ' => 'content ' ],
48+ ['selector ' => 'meta[property="og:video"] ' , 'attribute ' => 'content ' ],
49+ ],
50+
51+ 'videoType ' => [
52+ ['selector ' => 'meta[property="twitter:player:stream:content_type"] ' , 'attribute ' => 'content ' ],
53+ ['selector ' => 'meta[property="og:video:type"] ' , 'attribute ' => 'content ' ],
54+ ],
4455 ];
4556
4657 /**
@@ -168,6 +179,6 @@ protected function parseHtml(LinkInterface $link)
168179
169180 if (!isset ($ cover ) && count ($ images )) $ cover = $ images [0 ];
170181
171- return compact ('cover ' , 'title ' , 'description ' , 'images ' );
182+ return compact ('cover ' , 'title ' , 'description ' , 'images ' , ' video ' , ' videoType ' );
172183 }
173- }
184+ }
0 commit comments