- _VALID_URL = r'https?://vk\.com/(?:videos.*?\?.*?z=)?video(?P<id>.*?)(?:\?|%2F|$)'
-
- _TESTS = [{
- 'url': 'http://vk.com/videos-77521?z=video-77521_162222515%2Fclub77521',
- 'file': '162222515.flv',
- 'md5': '0deae91935c54e00003c2a00646315f0',
- 'info_dict': {
- 'title': 'ProtivoGunz - Хуёвая песня',
- 'uploader': 'Noize MC',
+ _VALID_URL = r'https?://vk\.com/(?:video_ext\.php\?.*?\boid=(?P<oid>\d+).*?\bid=(?P<id>\d+)|(?:videos.*?\?.*?z=)?video(?P<videoid>.*?)(?:\?|%2F|$))'
+ _NETRC_MACHINE = 'vk'
+
+ _TESTS = [
+ {
+ 'url': 'http://vk.com/videos-77521?z=video-77521_162222515%2Fclub77521',
+ 'md5': '0deae91935c54e00003c2a00646315f0',
+ 'info_dict': {
+ 'id': '162222515',
+ 'ext': 'flv',
+ 'title': 'ProtivoGunz - Хуёвая песня',
+ 'uploader': 'Noize MC',
+ 'duration': 195,
+ },
+ },
+ {
+ 'url': 'http://vk.com/video4643923_163339118',
+ 'md5': 'f79bccb5cd182b1f43502ca5685b2b36',
+ 'info_dict': {
+ 'id': '163339118',
+ 'ext': 'mp4',
+ 'uploader': 'Elvira Dzhonik',
+ 'title': 'Dream Theater - Hollow Years Live at Budokan 720*',
+ 'duration': 558,
+ }
+ },
+ {
+ 'note': 'Embedded video',
+ 'url': 'http://vk.com/video_ext.php?oid=32194266&id=162925554&hash=7d8c2e0d5e05aeaa&hd=1',
+ 'md5': 'c7ce8f1f87bec05b3de07fdeafe21a0a',
+ 'info_dict': {
+ 'id': '162925554',
+ 'ext': 'mp4',
+ 'uploader': 'Vladimir Gavrin',
+ 'title': 'Lin Dan',
+ 'duration': 101,
+ }
+ },
+ {
+ 'url': 'http://vk.com/video-8871596_164049491',
+ 'md5': 'a590bcaf3d543576c9bd162812387666',
+ 'note': 'Only available for registered users',
+ 'info_dict': {
+ 'id': '164049491',
+ 'ext': 'mp4',
+ 'uploader': 'Триллеры',
+ 'title': '► Бойцовский клуб / Fight Club 1999 [HD 720]\u00a0',
+ 'duration': 8352,
+ },
+ 'skip': 'Requires vk account credentials',