1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-08-08 05:28:30 +00:00

[cookies] Load cookies with float expires timestamps (#13873)

Authored by: bashonly
This commit is contained in:
bashonly 2025-07-29 14:47:28 -05:00 committed by GitHub
parent 682334e4b3
commit 28b68f6875
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1335,7 +1335,7 @@ def prepare_line(line):
if len(cookie_list) != self._ENTRY_LEN: if len(cookie_list) != self._ENTRY_LEN:
raise http.cookiejar.LoadError(f'invalid length {len(cookie_list)}') raise http.cookiejar.LoadError(f'invalid length {len(cookie_list)}')
cookie = self._CookieFileEntry(*cookie_list) cookie = self._CookieFileEntry(*cookie_list)
if cookie.expires_at and not cookie.expires_at.isdigit(): if cookie.expires_at and not re.fullmatch(r'[0-9]+(?:\.[0-9]+)?', cookie.expires_at):
raise http.cookiejar.LoadError(f'invalid expires at {cookie.expires_at}') raise http.cookiejar.LoadError(f'invalid expires at {cookie.expires_at}')
return line return line