mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-21 09:51:25 +02:00
Compare commits
No commits in common. "b2920d0790c9ffa35ae0acc85fba65be2fed62a6" and "11eb240df949fe61530abdbdcc828046d804e1a5" have entirely different histories.
b2920d0790
...
11eb240df9
|
@ -37,24 +37,17 @@ class JoqrAgIE(InfoExtractor):
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _extract_metadata(self, variable, html, name):
|
|
||||||
return clean_html(urllib.parse.unquote_plus(self._search_regex(
|
|
||||||
rf'var\s+{variable}\s*=\s*["\']([^"\']+)["\']', html, name, default=''))) or None
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = 'live'
|
video_id = 'live'
|
||||||
|
|
||||||
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 = self._extract_metadata('Program_name', metadata, 'program title')
|
title = clean_html(urllib.parse.unquote_plus(
|
||||||
desc = self._extract_metadata('Program_text', metadata, 'program description')
|
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')))
|
||||||
|
|
||||||
if title == '放送休止':
|
|
||||||
self.raise_no_formats('This stream has not started yet', expected=True)
|
|
||||||
formats = []
|
|
||||||
live_status = 'is_upcoming'
|
|
||||||
else:
|
|
||||||
m3u8_path = self._search_regex(
|
m3u8_path = self._search_regex(
|
||||||
r'<source\s[^>]*\bsrc="([^"]+)"',
|
r'<source\s[^>]*\bsrc="([^"]+)"',
|
||||||
self._download_webpage(
|
self._download_webpage(
|
||||||
|
@ -63,7 +56,6 @@ class JoqrAgIE(InfoExtractor):
|
||||||
'm3u8 url')
|
'm3u8 url')
|
||||||
formats = self._extract_m3u8_formats(
|
formats = self._extract_m3u8_formats(
|
||||||
urljoin('https://www.uniqueradio.jp/', m3u8_path), video_id, fatal=False)
|
urljoin('https://www.uniqueradio.jp/', m3u8_path), video_id, fatal=False)
|
||||||
live_status = 'is_live'
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
@ -71,5 +63,5 @@ class JoqrAgIE(InfoExtractor):
|
||||||
'channel': '超!A&G+',
|
'channel': '超!A&G+',
|
||||||
'description': desc,
|
'description': desc,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'live_status': live_status,
|
'live_status': 'is_live',
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user