This commit is contained in:
madkub 2020-09-30 06:59:58 +02:00 committed by GitHub
commit a5c7b9b7a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,50 @@
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class ABCClassicFMIE(InfoExtractor):
_VALID_URL = r'https?:\/\/?(www.)abc.net.au\/classic\/programs\/(?P<show_id>.*)\/(?P<episode>.*)\/(?P<episode_id>.*)'
_TEST = {
'url': 'https://www.abc.net.au/classic/programs/mornings/mornings/11536178',
'md5': '1d7151b404e514f622987b01e90d3c26',
'info_dict': {
'id': '11536178',
'ext': 'mp4',
'title': 'Mornings',
'thumbnail': r're:^https?://.*\.jpg'
},
}
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
episode_id = mobj.group('episode_id')
webpage = self._download_webpage(url, episode_id)
title = self._search_regex(
r'<meta.*name="title".*content="(?P<value>.*)".*\/>', webpage,
'title', group='value')
m3u8_url = self._search_regex(
r'(["\'])(?P<url>(?:(?!\1).)+\.m3u8(?:(?!\1).)*)\1', webpage,
'm3u8 url', group='url')
formats = self._extract_m3u8_formats(
m3u8_url, episode_id, 'mp4', entry_protocol='m3u8_native',
m3u8_id='hls')
self._sort_formats(formats)
thumbnail = self._search_regex(
r'<meta.*property="og:image".*content="(?P<url>.*)".*\/>', webpage, 'thumbnail',
default=False, group='url')
return {
'id': episode_id,
'title': title,
'thumbnail': thumbnail,
'formats': formats,
}

View File

@ -5,6 +5,7 @@ from .abc import (
ABCIE,
ABCIViewIE,
)
from .abcclassicfm import ABCClassicFMIE
from .abcnews import (
AbcNewsIE,
AbcNewsVideoIE,