From df81810879e4a53a733e9c4013dc0c9f21d7acfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Finn=20G=C3=A4rtner?= Date: Tue, 27 Feb 2024 21:05:15 +0100 Subject: [PATCH] fix: New Piapro design --- yt_dlp/extractor/piapro.py | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/yt_dlp/extractor/piapro.py b/yt_dlp/extractor/piapro.py index 3ae985da2..c7cb24dfe 100644 --- a/yt_dlp/extractor/piapro.py +++ b/yt_dlp/extractor/piapro.py @@ -88,25 +88,19 @@ class PiaproIE(InfoExtractor): if category_id not in ('1', '2', '21', '22', '23', '24', '25'): raise ExtractorError('The URL does not contain audio.', expected=True) - str_duration, str_filesize = self._search_regex( - r'サイズ:(.+?)/\(([0-9,]+?[KMG]?B))', webpage, 'duration and size', - group=(1, 2), default=(None, None)) - str_viewcount = self._search_regex(r'閲覧数:([0-9,]+)\s+', webpage, 'view count', fatal=False) + str_duration = self._search_regex(r'長さ:\s*(.+?)

', webpage, 'duration') + str_filesize = self._search_regex(r'サイズ:\s*([0-9.]+?[KMG]?B)', webpage, 'size') + str_viewcount = self._search_regex(r'閲覧数:\s*([0-9,]+)\s*

', webpage, 'view count', fatal=False) - uploader_id, uploader = self._search_regex( - r'([^<]+)さん<', webpage, 'uploader', - group=(1, 2), default=(None, None)) - content_id = self._search_regex(r'contentId\:\'(.+)\'', webpage, 'content ID') - create_date = self._search_regex(r'createDate\:\'(.+)\'', webpage, 'timestamp') + uploader_id = self._search_regex(r'\s*(.*)', webpage, 'timestamp') return { 'id': video_id, - 'title': self._html_search_regex(r'(.+?)', webpage, 'title', fatal=False), - 'description': self._html_search_regex(r'(?s)(.+?)

\s*(.+?)', webpage, 'title', fatal=False), + 'description': self._html_search_regex(r'(?s)(.+?)\s*