Update vk.py

Some videos have incorrect path in point of view of old regular expression.
This just repair it, and all the videos detects good, I think.

```
➜  ~  youtube-dl --verbose -g https://vk.com/\?z\=video-43215063_168067957%2F15c66b9b533119788d
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', '-g', 'https://vk.com/?z=video-43215063_168067957%2F15c66b9b533119788d']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.06.26
[debug] Git HEAD: b1ce1ee
[debug] Python version 2.7.6 - Darwin-13.2.0-x86_64-i386-64bit
[debug] Proxy map: {}
WARNING: Falling back on generic information extractor.
ERROR: Unsupported URL: https://vk.com/?z=video-43215063_168067957%2F15c66b9b533119788d; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/generic.py", line 451, in _real_extract
    doc = parse_xml(webpage)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/utils.py", line 1406, in parse_xml
    return xml.etree.ElementTree.XML(s.encode('utf-8'), **kwargs)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1300, in XML
    parser.feed(text)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1642, in feed
    self._raiseerror(v)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror
    raise err
ParseError: mismatched tag: line 12, column 72
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 516, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 167, in extract
    return self._real_extract(url)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/generic.py", line 741, in _real_extract
    raise ExtractorError('Unsupported URL: %s' % url)
ExtractorError: Unsupported URL: https://vk.com/?z=video-43215063_168067957%2F15c66b9b533119788d; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
```
This commit is contained in:
Alex Snet 2014-06-29 15:19:35 +04:00
parent 9b27e6c3b4
commit 7280671596

View File

@ -16,7 +16,7 @@ from ..utils import (
class VKIE(InfoExtractor):
IE_NAME = 'vk.com'
_VALID_URL = r'https?://vk\.com/(?:video_ext\.php\?.*?\boid=(?P<oid>-?\d+).*?\bid=(?P<id>\d+)|(?:videos.*?\?.*?z=)?video(?P<videoid>.*?)(?:\?|%2F|$))'
_VALID_URL = r'https?://vk\.com/(?:video_ext\.php\?.*?\boid=(?P<oid>-?\d+).*?\bid=(?P<id>\d+)|(?:[a-zA-Z0-9\.-_]+?z=)?video?-(?P<videoid>[0-9_]+)(?:\?|%2F|$))'
_NETRC_MACHINE = 'vk'
_TESTS = [