Apply suggestions from code review

Co-authored-by: sepro <sepro@sepr0.com>
This commit is contained in:
ChocoLZS 2024-10-05 22:49:09 +08:00 committed by GitHub
parent b42637c619
commit 75ea808d0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View file

@ -73,7 +73,7 @@ def _real_extract(self, url):
date, time = self._search_regex( date, time = self._search_regex(
r'(?P<date>\d{4}/\d{1,2}/\d{1,2})\([月火水木金土日]\)(?P<time>\d{2}:\d{2})', r'(?P<date>\d{4}/\d{1,2}/\d{1,2})\([月火水木金土日]\)(?P<time>\d{2}:\d{2})',
start_info, 'start_info', fatal=False, group=('date', 'time')) start_info, 'start_info', fatal=False, group=('date', 'time'))
if all((date, time)): if date and time:
release_timestamp_str = f'{date} {time} +09:00' release_timestamp_str = f'{date} {time} +09:00'
release_timestamp = unified_timestamp(release_timestamp_str) release_timestamp = unified_timestamp(release_timestamp_str)
self.raise_no_formats(f'The video will be available after {release_timestamp_str}', expected=True) self.raise_no_formats(f'The video will be available after {release_timestamp_str}', expected=True)

View file

@ -43,8 +43,7 @@ def _real_extract(self, url):
) )
m3u8_url = self._search_regex( m3u8_url = self._search_regex(
r'["\'](https://vms-api\.p\.uliza\.jp/v1/prog-index\.m3u8[^"\']+)', player_data, r'["\'](https://vms-api\.p\.uliza\.jp/v1/prog-index\.m3u8[^"\']+)', player_data, 'm3u8 url')
'm3u8 url', default=None)
video_id = parse_qs(m3u8_url).get('ss', [display_id])[0] video_id = parse_qs(m3u8_url).get('ss', [display_id])[0]
formats = self._extract_m3u8_formats(m3u8_url, video_id) formats = self._extract_m3u8_formats(m3u8_url, video_id)