1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-10 00:47:15 +08:00

[Bajeczki] Add new extractor

This commit is contained in:
Monastario 2019-04-16 17:59:23 +02:00
parent 83964685be
commit 88261409ed

View File

@ -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'<title>(.+?)</title>', 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'<title>(.+?)</title>', webpage, 'title').split(' |', 1)[0]
return {
'id': video_id,
'title': title,
'url': url,
# 'description': self._og_search_description(webpage),
# 'uploader': self._search_regex(r'<div[^>]+id="uploader"[^>]*>([^<]+)<', webpage, 'uploader', fatal=False),
# TODO more properties (see youtube_dl/extractor/common.py)
'title': title,
}