Apply suggestions from code review

Co-authored-by: sepro <sepro@sepr0.com>
This commit is contained in:
Mozi 2024-09-17 13:23:18 +00:00 committed by GitHub
parent 8b6ccef342
commit 41694a516a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -84,7 +84,8 @@ def _real_extract(self, url):
video_id, display_id = self._match_valid_url(url).groups() video_id, display_id = self._match_valid_url(url).groups()
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, video_id)
video_id_dec = self._search_regex(r'\bvId\s*=\s*(\d+)', webpage, 'video id') or str(int(video_id, 16)) video_id_dec = self._search_regex(
r'\bvId\s*=\s*(\d+)', webpage, 'video id', fatal=False) or str(int(video_id, 16))
video_exp = self._search_regex(r'\bvEx\s*=\s*["\'](\d+)', webpage, 'video expiry') video_exp = self._search_regex(r'\bvEx\s*=\s*["\'](\d+)', webpage, 'video expiry')
video_hashes = self._search_json( video_hashes = self._search_json(
r'\bvHash\s*=', webpage, 'video hashes', video_id, r'\bvHash\s*=', webpage, 'video hashes', video_id,