Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions collection/sites/vk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "VK"
homepage: "https://vk.com/"
tags: ".ru"
host:
- "vk.com"
- "vkontakte.ru"
- "vkvideo.ru"
example:
- "https://vk.com/video121599878_165723901?hash=e06b0878046e1d32"
- "https://vk.com/video_ext.php?oid=121599878&id=165723901&hash=e06b0878046e1d32"
attributes:
oid:
required: true
vid:
required: true
extract:
- "!video(?'oid'-?\\d+)_(?'vid'\\d+)!"
- "!video_ext\\.php\\?oid=(?'oid'-?\\d+)&id=(?'vid'\\d+)!"
- "!hash=(?'hash'[0-9a-f]+)!"
- "!hd=(?'hd'\\d)!"
iframe:
src: "//vk.com/video_ext.php?oid={@oid}&id={@vid}&hash={@hash}&hd={@hd}"
scrape:
extract:
- "#meta property=\"og:video\" content=\".*?oid=(?'oid'-?\\d+).*?id=(?'vid'\\d+)#"
- "#meta property=\"og:video\" content=\".*?hash=(?'hash'[0-9a-f]+)#"
match: "#^(?!.*?hash=)#"
header:
- "User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
- "Cookie: _ignoreAutoLogin=1"
1 change: 1 addition & 0 deletions tests/custom_sites_collection_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function test_get_collection()
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/snotr.yml', $collection);
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/tenor.yml', $collection);
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/videopress.yml', $collection);
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/vk.yml', $collection);
$this->assertNotContains('phpBB/ext/phpbb/mediaembed/collection/sites/youtube.yml', $collection);
}
}