mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-10 07:47:45 +08:00
[Bajeczki] Add new extractor
This commit is contained in:
parent
83964685be
commit
88261409ed
@ -1,6 +1,6 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import re
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
@ -12,32 +12,21 @@ class BajeczkiIE(InfoExtractor):
|
|||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'psi-patrol/pieski-ratuja-przyjaciol-ksiezniczki/',
|
'id': 'psi-patrol/pieski-ratuja-przyjaciol-ksiezniczki/',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Psi Patrol - Psia misja: Pieski ratują przyjaciół księżniczki | Bajki na Bajeczki.org',
|
'title': 'Psi Patrol - Psia misja: Pieski ratują przyjaciół księżniczki',
|
||||||
# '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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
# print (webpage)
|
|
||||||
# TODO more code goes here, for example ...
|
url = self._search_regex(r'(http.*\.mp4)', webpage, 'url').replace('\\', '')
|
||||||
title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title')
|
|
||||||
test = self._search_regex(r'(http.*\.mp4)', webpage, 'url')
|
title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title').split(' |', 1)[0]
|
||||||
print(test)
|
|
||||||
url = re.sub('\\\\', '', test)
|
|
||||||
print(url)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
|
||||||
'url': url,
|
'url': url,
|
||||||
# 'description': self._og_search_description(webpage),
|
'title': title,
|
||||||
# 'uploader': self._search_regex(r'<div[^>]+id="uploader"[^>]*>([^<]+)<', webpage, 'uploader', fatal=False),
|
|
||||||
# TODO more properties (see youtube_dl/extractor/common.py)
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user