diff --git a/yt_dlp/extractor/pialive.py b/yt_dlp/extractor/pialive.py index 69b484fd5f..013d19aa4d 100644 --- a/yt_dlp/extractor/pialive.py +++ b/yt_dlp/extractor/pialive.py @@ -1,5 +1,14 @@ from .common import InfoExtractor -from ..utils import extract_attributes, multipart_encode, url_or_none +from ..utils import ( + ExtractorError, + clean_html, + extract_attributes, + get_element_by_class, + get_element_html_by_class, + multipart_encode, + unified_timestamp, + url_or_none, +) from ..utils.traversal import traverse_obj @@ -24,6 +33,7 @@ class PiaLiveIE(InfoExtractor): 'skip_download': True, 'ignore_no_formats_error': True, }, + 'skip': 'The video is no longer available', }, { 'url': 'https://player.pia-live.jp/stream/4JagFBEIM14s_hK9aXHKf3k3F3bY5eoHFQxu68TC6krJdu0GVBVbVy01IwpJ6J3qBEm3d9TCTt1d0eWpsZGj7DrOjVOmS7GAWGwyscMgiThopJvzgWC4H5b-7XQjAfRZ', @@ -39,6 +49,7 @@ class PiaLiveIE(InfoExtractor): 'skip_download': True, 'ignore_no_formats_error': True, }, + 'skip': 'The video is no longer available', }, ] @@ -53,28 +64,51 @@ class PiaLiveIE(InfoExtractor): program_code = self._extract_vars('programCode', webpage) article_code = self._extract_vars('articleCode', webpage) + title = self._html_extract_title(webpage) + + if get_element_html_by_class('play-end', webpage): + raise ExtractorError('The video is no longer available', expected=True, video_id=program_code) + + if start_info := clean_html(get_element_by_class('play-waiting__date', webpage)): + date, time = self._search_regex( + r'(?P\d{4}/\d{1,2}/\d{1,2})\([月火水木金土日]\)(?P