1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-11 03:47:34 +00:00

[vk] Use unicode_literals

This commit is contained in:
Philipp Hagemeister 2014-01-21 17:32:03 +01:00
parent 608bf69880
commit 94a23d2a1e

View File

@ -1,4 +1,6 @@
# encoding: utf-8 # encoding: utf-8
from __future__ import unicode_literals
import re import re
import json import json
@ -10,17 +12,16 @@ from ..utils import (
class VKIE(InfoExtractor): class VKIE(InfoExtractor):
IE_NAME = u'vk.com' IE_NAME = 'vk.com'
_VALID_URL = r'https?://vk\.com/(?:videos.*?\?.*?z=)?video(?P<id>.*?)(?:\?|%2F|$)' _VALID_URL = r'https?://vk\.com/(?:videos.*?\?.*?z=)?video(?P<id>.*?)(?:\?|%2F|$)'
_TEST = { _TEST = {
u'url': u'http://vk.com/videos-77521?z=video-77521_162222515%2Fclub77521', 'url': 'http://vk.com/videos-77521?z=video-77521_162222515%2Fclub77521',
u'md5': u'0deae91935c54e00003c2a00646315f0', 'file': '162222515.flv',
u'info_dict': { 'md5': '0deae91935c54e00003c2a00646315f0',
u'id': u'162222515', 'info_dict': {
u'ext': u'flv', 'title': 'ProtivoGunz - Хуёвая песня',
u'title': u'ProtivoGunz - Хуёвая песня', 'uploader': 'Noize MC',
u'uploader': u'Noize MC',
}, },
} }
@ -33,7 +34,7 @@ class VKIE(InfoExtractor):
if m_yt is not None: if m_yt is not None:
self.to_screen(u'Youtube video detected') self.to_screen(u'Youtube video detected')
return self.url_result(m_yt.group(1), 'Youtube') return self.url_result(m_yt.group(1), 'Youtube')
data_json = self._search_regex(r'var vars = ({.*?});', info_page, u'vars') data_json = self._search_regex(r'var vars = ({.*?});', info_page, 'vars')
data = json.loads(data_json) data = json.loads(data_json)
return { return {