mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 17:31:24 +01:00
Compare commits
5 Commits
4f478a9f05
...
11eb240df9
Author | SHA1 | Date | |
---|---|---|---|
|
11eb240df9 | ||
|
3c90db7555 | ||
|
e9f8f3e397 | ||
|
d5c6e48d5d | ||
|
988329c5ae |
|
@ -1,21 +1,21 @@
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from ..utils import clean_html, urljoin
|
||||||
|
|
||||||
|
|
||||||
class JoqrAgIE(InfoExtractor):
|
class JoqrAgIE(InfoExtractor):
|
||||||
IE_DESC = '超!A&G+ 文化放送 Nippon Cultural Broadcasting, Inc. (JOQR)'
|
IE_DESC = '超!A&G+ 文化放送 Nippon Cultural Broadcasting, Inc. (JOQR)'
|
||||||
_VALID_URL = r'''(?x)
|
_VALID_URL = [r'https?://www\.uniqueradio\.jp/agplayer5/player\.php',
|
||||||
(https?://www\.uniqueradio\.jp/agplayer5/player\.php)|
|
r'https?://www\.uniqueradio\.jp/agplayer5/inc-player-hls\.php',
|
||||||
(https?://www\.uniqueradio\.jp/agplayer5/inc-player-hls\.php)|
|
r'https?://(?:www\.)?joqr\.co\.jp/ag/',
|
||||||
(https?://(?:www\.)?joqr\.co\.jp/ag/)|
|
r'https?://(?:www\.)?joqr\.co\.jp/qr/(?:agdailyprogram|agregularprogram)/']
|
||||||
(https?://(?:www\.)?joqr\.co\.jp/qr/(?:agdailyprogram|agregularprogram)/)
|
|
||||||
'''
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://www.uniqueradio.jp/agplayer5/player.php',
|
'url': 'https://www.uniqueradio.jp/agplayer5/player.php',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'live',
|
'id': 'live',
|
||||||
'title': str,
|
'title': str,
|
||||||
|
'channel': '超!A&G+',
|
||||||
'description': str,
|
'description': str,
|
||||||
'live_status': 'is_live',
|
'live_status': 'is_live',
|
||||||
},
|
},
|
||||||
|
@ -23,6 +23,18 @@ class JoqrAgIE(InfoExtractor):
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
'ignore_no_formats_error': 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):
|
def _real_extract(self, url):
|
||||||
|
@ -31,10 +43,10 @@ class JoqrAgIE(InfoExtractor):
|
||||||
metadata = self._download_webpage(
|
metadata = self._download_webpage(
|
||||||
'https://www.uniqueradio.jp/aandg', video_id,
|
'https://www.uniqueradio.jp/aandg', video_id,
|
||||||
note='Downloading metadata', errnote='Failed to download metadata')
|
note='Downloading metadata', errnote='Failed to download metadata')
|
||||||
title = urllib.parse.unquote_plus(
|
title = clean_html(urllib.parse.unquote_plus(
|
||||||
self._search_regex(r'var\s+Program_name\s*=\s*["\']([^"\']+)["\']', metadata, 'program title'))
|
self._search_regex(r'var\s+Program_name\s*=\s*["\']([^"\']+)["\']', metadata, 'program title')))
|
||||||
desc = urllib.parse.unquote_plus(
|
desc = clean_html(urllib.parse.unquote_plus(
|
||||||
self._search_regex(r'var\s+Program_text\s*=\s*["\']([^"\']+)["\']', metadata, 'program description'))
|
self._search_regex(r'var\s+Program_text\s*=\s*["\']([^"\']+)["\']', metadata, 'program description')))
|
||||||
|
|
||||||
m3u8_path = self._search_regex(
|
m3u8_path = self._search_regex(
|
||||||
r'<source\s[^>]*\bsrc="([^"]+)"',
|
r'<source\s[^>]*\bsrc="([^"]+)"',
|
||||||
|
@ -43,11 +55,12 @@ class JoqrAgIE(InfoExtractor):
|
||||||
note='Downloading player data', errnote='Failed to download player data'),
|
note='Downloading player data', errnote='Failed to download player data'),
|
||||||
'm3u8 url')
|
'm3u8 url')
|
||||||
formats = self._extract_m3u8_formats(
|
formats = self._extract_m3u8_formats(
|
||||||
f'https://www.uniqueradio.jp/{m3u8_path}', video_id, fatal=False)
|
urljoin('https://www.uniqueradio.jp/', m3u8_path), video_id, fatal=False)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': f'{title} - 超!A&G+',
|
'title': title,
|
||||||
|
'channel': '超!A&G+',
|
||||||
'description': desc,
|
'description': desc,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'live_status': 'is_live',
|
'live_status': 'is_live',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user