Compare commits

..

No commits in common. "11eb240df949fe61530abdbdcc828046d804e1a5" and "4f478a9f057ec47ec403d7a1a6fa54861a0f7c7e" have entirely different histories.

View File

@ -1,21 +1,21 @@
import urllib.parse
from .common import InfoExtractor
from ..utils import clean_html, urljoin
class JoqrAgIE(InfoExtractor):
IE_DESC = '超!A&G+ 文化放送 Nippon Cultural Broadcasting, Inc. (JOQR)'
_VALID_URL = [r'https?://www\.uniqueradio\.jp/agplayer5/player\.php',
r'https?://www\.uniqueradio\.jp/agplayer5/inc-player-hls\.php',
r'https?://(?:www\.)?joqr\.co\.jp/ag/',
r'https?://(?:www\.)?joqr\.co\.jp/qr/(?:agdailyprogram|agregularprogram)/']
_VALID_URL = r'''(?x)
(https?://www\.uniqueradio\.jp/agplayer5/player\.php)|
(https?://www\.uniqueradio\.jp/agplayer5/inc-player-hls\.php)|
(https?://(?:www\.)?joqr\.co\.jp/ag/)|
(https?://(?:www\.)?joqr\.co\.jp/qr/(?:agdailyprogram|agregularprogram)/)
'''
_TESTS = [{
'url': 'https://www.uniqueradio.jp/agplayer5/player.php',
'info_dict': {
'id': 'live',
'title': str,
'channel': '超!A&G+',
'description': str,
'live_status': 'is_live',
},
@ -23,18 +23,6 @@ class JoqrAgIE(InfoExtractor):
'skip_download': True,
'ignore_no_formats_error': True,
},
}, {
'url': 'https://www.uniqueradio.jp/agplayer5/inc-player-hls.php',
'only_matching': True,
}, {
'url': 'https://www.joqr.co.jp/ag/article/103760/',
'only_matching': True,
}, {
'url': 'http://www.joqr.co.jp/qr/agdailyprogram/',
'only_matching': True,
}, {
'url': 'http://www.joqr.co.jp/qr/agregularprogram/',
'only_matching': True,
}]
def _real_extract(self, url):
@ -43,10 +31,10 @@ class JoqrAgIE(InfoExtractor):
metadata = self._download_webpage(
'https://www.uniqueradio.jp/aandg', video_id,
note='Downloading metadata', errnote='Failed to download metadata')
title = clean_html(urllib.parse.unquote_plus(
self._search_regex(r'var\s+Program_name\s*=\s*["\']([^"\']+)["\']', metadata, 'program title')))
desc = clean_html(urllib.parse.unquote_plus(
self._search_regex(r'var\s+Program_text\s*=\s*["\']([^"\']+)["\']', metadata, 'program description')))
title = urllib.parse.unquote_plus(
self._search_regex(r'var\s+Program_name\s*=\s*["\']([^"\']+)["\']', metadata, 'program title'))
desc = urllib.parse.unquote_plus(
self._search_regex(r'var\s+Program_text\s*=\s*["\']([^"\']+)["\']', metadata, 'program description'))
m3u8_path = self._search_regex(
r'<source\s[^>]*\bsrc="([^"]+)"',
@ -55,12 +43,11 @@ class JoqrAgIE(InfoExtractor):
note='Downloading player data', errnote='Failed to download player data'),
'm3u8 url')
formats = self._extract_m3u8_formats(
urljoin('https://www.uniqueradio.jp/', m3u8_path), video_id, fatal=False)
f'https://www.uniqueradio.jp/{m3u8_path}', video_id, fatal=False)
return {
'id': video_id,
'title': title,
'channel': '超!A&G+',
'title': f'{title} - 超!A&G+',
'description': desc,
'formats': formats,
'live_status': 'is_live',