detect cookie file size

This commit is contained in:
Benny 2025-01-15 07:39:24 +01:00
parent da5ae16aee
commit b8157dc1ff
No known key found for this signature in database
GPG key ID: 6CD0DBDA5235D481

View file

@ -92,7 +92,7 @@ class YoutubeDownload(BaseDownloader):
}
# setup cookies for youtube only
if self._url.startswith("https://www.youtube.com/") or self._url.startswith("https://youtu.be/"):
if os.path.isfile("youtube-cookies.txt"):
if os.path.isfile("youtube-cookies.txt") and os.path.getsize("youtube-cookies.txt") > 100:
# src/cookies.txt
ydl_opts["cookiefile"] = "youtube-cookies.txt"