diff --git a/README.md b/README.md
index aa7f61a0..d3d44b33 100644
--- a/README.md
+++ b/README.md
@@ -318,7 +318,7 @@ Use `--url`/`-u` to get a list of downloadable resource URLs extracted from the
| :--: | :-- | :-----: | :-----: | :-----: |
| **YouTube** | |✓| | |
| **Twitter** | |✓|✓| |
-| VK | |✓| | |
+| VK | |✓|✓| |
| Vine | |✓| | |
| Vimeo | |✓| | |
| Vidto | |✓| | |
diff --git a/src/you_get/extractors/vk.py b/src/you_get/extractors/vk.py
index 6ad6624d..ea3e3851 100644
--- a/src/you_get/extractors/vk.py
+++ b/src/you_get/extractors/vk.py
@@ -7,12 +7,14 @@ from ..common import *
def get_video_info(url):
video_page = get_content(url)
- title = unescape_html(r1(r'"title":"([^"]+)"', video_page))
- info = dict(re.findall(r'\\"url(\d+)\\":\\"([^"]+)\\"', video_page))
+ title = r1(r'
(.[^>]+?)
]+?)"', video_page)
+
for quality in ['1080', '720', '480', '360', '240']:
- if quality in info:
- url = re.sub(r'\\\\\\/', r'/', info[quality])
- break
+ for source in sources:
+ if source.find(quality) != -1:
+ url = source
+ break
assert url
type, ext, size = url_info(url)
print_info(site_info, title, type, size)
@@ -37,7 +39,7 @@ def get_image_info(url):
def vk_download(url, output_dir='.', stream_type=None, merge=True, info_only=False, **kwargs):
link = None
- if re.match(r'vk.com/photo', url):
+ if re.match(r'(.+)z\=video(.+)', url):
link, title, ext, size = get_video_info(url)
elif re.match(r'(.+)vk\.com\/photo(.+)', url):
link, title, ext, size = get_image_info(url)