Skip to content

Commit

Permalink
MediaEmbed: updated VK
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed May 13, 2024
1 parent 81eb1de commit 4fd5739
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/testdox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7957,7 +7957,7 @@ Curl (s9e\TextFormatter\Tests\Utils\Http\Clients\Curl)
[x] post() sends the request body if set
[x] post() sends no request body if not set
[x] post() automatically sets Content-Length if a request body is set
[ ] get() returns the response error
[x] get() returns the response error
[x] get() returns headers if returnHeaders is true

Native (s9e\TextFormatter\Tests\Utils\Http\Clients\Native)
Expand Down
4 changes: 2 additions & 2 deletions src/Bundles/MediaPack.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class CachedDefinitionCollection extends SiteDefinitionCollection
'videodetective'=>['attributes'=>[],'example'=>'https://www.videodetective.com/movies/zootopia/658596','extract'=>['!videodetective\\.com/\\w+/[-\\w]+/(?:trailer/P0*)?(?\'id\'\\d+)!'],'homepage'=>'https://www.videodetective.com/','host'=>['videodetective.com'],'iframe'=>['src'=>'//www.videodetective.com/embed/video/?options=false&autostart=false&playlist=none&publishedid={@id}'],'name'=>'Video Detective','scrape'=>[]],
'vimeo'=>['amp'=>['custom-element'=>'amp-vimeo','src'=>'https://cdn.ampproject.org/v0/amp-vimeo-0.1.js','template'=>'<amp-vimeo layout="responsive" width="640" height="360" data-videoid="{@id}"/>'],'attributes'=>['t'=>['filterChain'=>['#timestamp']]],'example'=>['https://vimeo.com/67207222','https://vimeo.com/channels/staffpicks/67207222'],'extract'=>['!vimeo\\.com/(?:channels/[^/]+/|video/)?(?\'id\'\\d+)(?:/(?\'h\'\\w+))?\\b!','!#t=(?\'t\'[\\dhms]+)!'],'homepage'=>'https://vimeo.com/','host'=>['vimeo.com'],'iframe'=>['src'=>'//player.vimeo.com/video/<xsl:value-of select="@id"/><xsl:if test="@h">?h=<xsl:value-of select="@h"/></xsl:if><xsl:if test="@t">#t=<xsl:value-of select="@t"/></xsl:if>'],'name'=>'Vimeo','oembed'=>['endpoint'=>'https://vimeo.com/api/oembed.json','scheme'=>'https://vimeo.com/{@id}'],'scrape'=>[],'source'=>'http://developer.vimeo.com/player/embedding','tags'=>['videos']],
'vine'=>['amp'=>['custom-element'=>'amp-vine','src'=>'https://cdn.ampproject.org/v0/amp-vine-0.1.js','template'=>'<amp-vine layout="responsive" width="400" height="400" data-vineid="{@id}"/>'],'attributes'=>[],'example'=>'https://vine.co/v/bYwPIluIipH','extract'=>['!vine\\.co/v/(?\'id\'[^/]+)!'],'homepage'=>'https://vine.co/','host'=>['vine.co'],'iframe'=>['height'=>480,'src'=>'https://vine.co/v/{@id}/embed/simple?audio=1','width'=>480],'name'=>'Vine','scrape'=>[],'tags'=>['social','videos']],
'vk'=>['attributes'=>[],'example'=>['https://vk.com/video121599878_165723901?hash=e06b0878046e1d32','https://vk.com/video_ext.php?oid=121599878&id=165723901&hash=e06b0878046e1d32'],'extract'=>['!vk(?:\\.com|ontakte\\.ru)/(?:[\\w.]+\\?z=)?video(?\'oid\'-?\\d+)_(?\'vid\'\\d+).*?hash=(?\'hash\'[0-9a-f]+)!','!vk(?:\\.com|ontakte\\.ru)/video_ext\\.php\\?oid=(?\'oid\'-?\\d+)&id=(?\'vid\'\\d+)&hash=(?\'hash\'[0-9a-f]+)!'],'homepage'=>'https://vk.com/','host'=>['vk.com','vkontakte.ru'],'iframe'=>['src'=>'//vk.com/video_ext.php?oid={@oid}&id={@vid}&hash={@hash}&hd=1'],'name'=>'VK','scrape'=>[['extract'=>['#meta property="og:video" content=".*?oid=(?\'oid\'-?\\d+).*?id=(?\'vid\'\\d+).*?hash=(?\'hash\'[0-9a-f]+)#'],'header'=>'User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0','match'=>['#^(?!.*?hash=)#']]],'tags'=>['.ru']],
'vk'=>['attributes'=>[],'example'=>['https://vk.com/video121599878_165723901?hash=e06b0878046e1d32','https://vk.com/video_ext.php?oid=121599878&id=165723901&hash=e06b0878046e1d32'],'extract'=>['!vk(?:\\.com|ontakte\\.ru)/(?:[\\w.]+\\?z=)?video(?\'oid\'-?\\d+)_(?\'vid\'\\d+).*?hash=(?\'hash\'[0-9a-f]+)!','!vk(?:\\.com|ontakte\\.ru)/video_ext\\.php\\?oid=(?\'oid\'-?\\d+)&id=(?\'vid\'\\d+)&hash=(?\'hash\'[0-9a-f]+)!'],'homepage'=>'https://vk.com/','host'=>['vk.com','vkontakte.ru'],'iframe'=>['src'=>'//vk.com/video_ext.php?oid={@oid}&id={@vid}&hash={@hash}&hd=1'],'name'=>'VK','scrape'=>[['extract'=>['#meta property="og:video" content=".*?oid=(?\'oid\'-?\\d+).*?id=(?\'vid\'\\d+).*?hash=(?\'hash\'[0-9a-f]+)#'],'header'=>'User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36','match'=>['#^(?!.*?hash=)#']]],'tags'=>['.ru']],
'vocaroo'=>['attributes'=>[],'example'=>'https://vocaroo.com/3OlvdB6eiiK','extract'=>['!voca(?:\\.ro|roo\\.com)/(?:i/)?(?\'id\'\\w+)!'],'homepage'=>'https://vocaroo.com/','host'=>['voca.ro','vocaroo.com'],'iframe'=>['height'=>80,'max-width'=>900,'src'=>'https://vocaroo.com/embed/{@id}','width'=>'100%'],'name'=>'Vocaroo','scrape'=>[]],
'vox'=>['attributes'=>[],'example'=>'https://www.vox.com/2015/7/21/9005857/ant-man-marvel-apology-review#ooid=ltbzJkdTpKpE-O6hOfD3YJew3t3MppXb','extract'=>['!vox.com/.*#ooid=(?\'id\'[-\\w]+)!'],'homepage'=>'https://www.vox.com/','host'=>['vox.com'],'iframe'=>['src'=>'//player.ooyala.com/iframe.html#pbid=a637d53c5c0a43c7bf4e342886b9d8b0&ec={@id}'],'name'=>'Vox','scrape'=>[]],
'washingtonpost'=>['attributes'=>[],'example'=>['https://www.washingtonpost.com/video/c/video/df229384-9216-11e6-bc00-1a9756d4111b','https://www.washingtonpost.com/video/world/aurora-display-lights-up-the-night-sky-over-finland/2016/10/14/df229384-9216-11e6-bc00-1a9756d4111b_video.html'],'extract'=>['#washingtonpost\\.com/video/c/\\w+/(?\'id\'[-0-9a-f]+)#','#washingtonpost\\.com/video/[-/\\w]+/(?\'id\'[-0-9a-f]+)_video\\.html#'],'homepage'=>'https://www.washingtonpost.com/video/','host'=>['washingtonpost.com'],'iframe'=>['src'=>'//www.washingtonpost.com/video/c/embed/{@id}'],'name'=>'Washington Post Video','scrape'=>[],'tags'=>['news']],
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/MediaEmbed/Configurator/sites/vk.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<extract>!vk(?:\.com|ontakte\.ru)/(?:[\w.]+\?z=)?video(?'oid'-?\d+)_(?'vid'\d+).*?hash=(?'hash'[0-9a-f]+)!</extract>
<extract>!vk(?:\.com|ontakte\.ru)/video_ext\.php\?oid=(?'oid'-?\d+)&amp;id=(?'vid'\d+)&amp;hash=(?'hash'[0-9a-f]+)!</extract>
<scrape>
<header>User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0</header>
<header>User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36</header>
<match>#^(?!.*?hash=)#</match>
<extract>#meta property="og:video" content=".*?oid=(?'oid'-?\d+).*?id=(?'vid'\d+).*?hash=(?'hash'[0-9a-f]+)#</extract>
</scrape>
Expand Down

0 comments on commit 4fd5739

Please sign in to comment.