X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fkeek.py;h=94a03d277a227733480b8a73f5535f9f3410be15;hb=70d35d166c1cfb14af20fb6d45ed820b6249f941;hp=24f5c7cb71e727bd0ed3df7e7b873c63ff6e0a9f;hpb=6a24cb3d22876826477dc2857f9d46fe65a9fc28;p=youtube-dl diff --git a/youtube_dl/extractor/keek.py b/youtube_dl/extractor/keek.py index 24f5c7cb7..94a03d277 100644 --- a/youtube_dl/extractor/keek.py +++ b/youtube_dl/extractor/keek.py @@ -1,7 +1,6 @@ +# coding: utf-8 from __future__ import unicode_literals -import re - from .common import InfoExtractor @@ -14,8 +13,7 @@ class KeekIE(InfoExtractor): 'info_dict': { 'id': 'NODfbab', 'ext': 'mp4', - 'title': 'test chars: "\'/\\ä<>This is a test video for youtube-dl.For more information, contact phihag@phihag.de . - Video - Videos on Keek', - 'description': 'test chars: "\'/\\ä<>This is a test video for youtube-dl.For more information, contact phihag@phihag.de .', + 'title': 'md5:35d42050a3ece241d5ddd7fdcc6fd896', 'uploader': 'ytdl', 'uploader_id': 'eGT5bab', }, @@ -25,18 +23,17 @@ class KeekIE(InfoExtractor): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) - uploader = uploader_id = None - matches = re.search(r'data-username="(?P[^"]+)"[^>]*data-user-id="(?P[^"]+)"', webpage) - if matches: - uploader, uploader_id = matches.groups() return { 'id': video_id, 'url': self._og_search_video_url(webpage), 'ext': 'mp4', - 'title': self._og_search_title(webpage), - 'description': self._og_search_description(webpage), + 'title': self._og_search_description(webpage).strip(), 'thumbnail': self._og_search_thumbnail(webpage), - 'uploader': uploader, - 'uploader_id': uploader_id, + 'uploader': self._search_regex( + r'data-username=(["\'])(?P.+?)\1', webpage, + 'uploader', fatal=False, group='uploader'), + 'uploader_id': self._search_regex( + r'data-user-id=(["\'])(?P.+?)\1', webpage, + 'uploader id', fatal=False, group='uploader_id'), }