projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[extractor/common] Extract submit inputs
[youtube-dl]
/
youtube_dl
/
extractor
/
vk.py
diff --git
a/youtube_dl/extractor/vk.py
b/youtube_dl/extractor/vk.py
index 93c5b18c9bb8b8c3c16c6fbf849f28bdbaf349c2..c30c5a8e524324a29d7c4a2dad49d5b9d50dda30 100644
(file)
--- a/
youtube_dl/extractor/vk.py
+++ b/
youtube_dl/extractor/vk.py
@@
-20,7
+20,8
@@
from ..utils import (
class VKIE(InfoExtractor):
class VKIE(InfoExtractor):
- IE_NAME = 'vk.com'
+ IE_NAME = 'vk'
+ IE_DESC = 'VK'
_VALID_URL = r'''(?x)
https?://
(?:
_VALID_URL = r'''(?x)
https?://
(?:
@@
-153,6
+154,11
@@
class VKIE(InfoExtractor):
'url': 'http://vk.com/feed?z=video-43215063_166094326%2Fbb50cacd3177146d7a',
'only_matching': True,
},
'url': 'http://vk.com/feed?z=video-43215063_166094326%2Fbb50cacd3177146d7a',
'only_matching': True,
},
+ {
+ # age restricted video, requires vk account credentials
+ 'url': 'https://vk.com/video205387401_164765225',
+ 'only_matching': True,
+ },
{
# vk wrapper
'url': 'http://www.biqle.ru/watch/847655_160197695',
{
# vk wrapper
'url': 'http://www.biqle.ru/watch/847655_160197695',
@@
-204,6
+210,12
@@
class VKIE(InfoExtractor):
info_page = self._download_webpage(info_url, video_id)
info_page = self._download_webpage(info_url, video_id)
+ error_message = self._html_search_regex(
+ r'(?s)<!><div[^>]+class="video_layer_message"[^>]*>(.+?)</div>',
+ info_page, 'error message', default=None)
+ if error_message:
+ raise ExtractorError(error_message, expected=True)
+
if re.search(r'<!>/login\.php\?.*\bact=security_check', info_page):
raise ExtractorError(
'You are trying to log in from an unusual location. You should confirm ownership at vk.com to log in with this IP.',
if re.search(r'<!>/login\.php\?.*\bact=security_check', info_page):
raise ExtractorError(
'You are trying to log in from an unusual location. You should confirm ownership at vk.com to log in with this IP.',
@@
-289,8
+301,8
@@
class VKIE(InfoExtractor):
class VKUserVideosIE(InfoExtractor):
class VKUserVideosIE(InfoExtractor):
- IE_NAME = 'vk
.com:user-
videos'
- IE_DESC =
'vk.com:All of a user\'s videos'
+ IE_NAME = 'vk
:user
videos'
+ IE_DESC =
"VK - User's Videos"
_VALID_URL = r'https?://vk\.com/videos(?P<id>-?[0-9]+)$'
_TEMPLATE_URL = 'https://vk.com/videos'
_TESTS = [{
_VALID_URL = r'https?://vk\.com/videos(?P<id>-?[0-9]+)$'
_TEMPLATE_URL = 'https://vk.com/videos'
_TESTS = [{
@@
-313,7
+325,7
@@
class VKUserVideosIE(InfoExtractor):
entries = [
self.url_result(
'http://vk.com/video' + video_id, 'VK', video_id=video_id)
entries = [
self.url_result(
'http://vk.com/video' + video_id, 'VK', video_id=video_id)
- for video_id in
s
et(re.findall(r'href="/video(-?[0-9_]+)"', webpage))]
+ for video_id in
orderedS
et(re.findall(r'href="/video(-?[0-9_]+)"', webpage))]
title = unescapeHTML(self._search_regex(
r'<title>\s*([^<]+?)\s+\|\s+\d+\s+videos',
title = unescapeHTML(self._search_regex(
r'<title>\s*([^<]+?)\s+\|\s+\d+\s+videos',