This commit is contained in:
sguan28 2020-09-24 01:04:14 -05:00 committed by GitHub
commit 4673beb8c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

View File

@ -976,6 +976,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 (

View 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,
}