diff --git a/youtube_dl/extractor/bajeczki.py b/youtube_dl/extractor/bajeczki.py index f1fd72fe3..c492c611b 100644 --- a/youtube_dl/extractor/bajeczki.py +++ b/youtube_dl/extractor/bajeczki.py @@ -1,6 +1,6 @@ # coding: utf-8 from __future__ import unicode_literals -import re + from .common import InfoExtractor @@ -12,32 +12,21 @@ class BajeczkiIE(InfoExtractor): 'info_dict': { 'id': 'psi-patrol/pieski-ratuja-przyjaciol-ksiezniczki/', 'ext': 'mp4', - 'title': 'Psi Patrol - Psia misja: Pieski ratują przyjaciół księżniczki | Bajki na Bajeczki.org', - # 'thumbnail': r're:^https?://.*\.jpg$', - # TODO more properties, either as: - # * A value - # * MD5 checksum; start the string with md5: - # * A regular expression; start the string with re: - # * Any Python type (for example int or float) - } + 'title': 'Psi Patrol - Psia misja: Pieski ratują przyjaciół księżniczki', + }, } def _real_extract(self, url): video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) - # print (webpage) - # TODO more code goes here, for example ... - title = self._html_search_regex(r'(.+?)', webpage, 'title') - test = self._search_regex(r'(http.*\.mp4)', webpage, 'url') - print(test) - url = re.sub('\\\\', '', test) - print(url) + + url = self._search_regex(r'(http.*\.mp4)', webpage, 'url').replace('\\', '') + + title = self._html_search_regex(r'(.+?)', webpage, 'title').split(' |', 1)[0] return { 'id': video_id, - 'title': title, 'url': url, - # 'description': self._og_search_description(webpage), - # 'uploader': self._search_regex(r']+id="uploader"[^>]*>([^<]+)<', webpage, 'uploader', fatal=False), - # TODO more properties (see youtube_dl/extractor/common.py) + 'title': title, }