Skip to content

Commit

Permalink
detect cookie file size
Browse files Browse the repository at this point in the history
  • Loading branch information
BennyThink committed Jan 15, 2025
1 parent da5ae16 commit b8157dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/engine/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def _download(self, formats) -> list:
}
# 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"

Expand Down

0 comments on commit b8157dc

Please sign in to comment.