mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-26 02:14:32 +01:00
scientology.py Add new extractor
This commit is contained in:
parent
68ddba20ae
commit
b0434adccc
@ -941,6 +941,7 @@ from .safari import (
|
||||
from .sapo import SapoIE
|
||||
from .savefrom import SaveFromIE
|
||||
from .sbs import SBSIE
|
||||
from .scientology import ScientologyIE
|
||||
from .screencast import ScreencastIE
|
||||
from .screencastomatic import ScreencastOMaticIE
|
||||
from .scrippsnetworks import ScrippsNetworksWatchIE
|
||||
|
42
youtube_dl/extractor/scientology.py
Normal file
42
youtube_dl/extractor/scientology.py
Normal file
@ -0,0 +1,42 @@
|
||||
# coding: utf-8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
import re
|
||||
|
||||
|
||||
class ScientologyIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://(?:www\.)?scientology\.tv/series/(?P<series_path>[^/?#]+)/(?P<id>[^/?#]+).html'
|
||||
_TEST = {
|
||||
'url': 'https://www.scientology.tv/series/l-ron-hubbard-in-his-own-voice/life-as-an-author.html',
|
||||
'info_dict': {
|
||||
'id': 'life-as-an-author',
|
||||
'ext': 'm3u8',
|
||||
'title': 'Life as an Author | L. Ron Hubbard: In his Own Voice',
|
||||
'description': 'The author on his real life adventures that thrilled millions, to his discoveries behind Dianetics.'
|
||||
},
|
||||
'params': {
|
||||
# m3u8 download
|
||||
'skip_download': True,
|
||||
},
|
||||
}
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
|
||||
title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title').strip()
|
||||
description = self._html_search_regex(r'<meta name="description" content="(.+?)" />', webpage, 'description').strip()
|
||||
description = re.sub("[^a-zA-Z0-9.,_\s-]+", " ", description)
|
||||
|
||||
# changing address for extration url
|
||||
extract_ext = re.search(r'<episode-video>(.*?)</episode-video>', webpage).group(0)
|
||||
extract_ext = extract_ext.replace('<episode-video>', '').replace('</episode-video>', '')
|
||||
url = url[:url.find('/', 10)] + extract_ext
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': title,
|
||||
'description': description,
|
||||
'url': url,
|
||||
}
|
Loading…
Reference in New Issue
Block a user