mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-16 22:10:26 +00:00
Check cookie file has entries
This commit is contained in:
parent
2e8cd48f3c
commit
eeee80ec4f
1 changed files with 4 additions and 0 deletions
|
|
@ -21,6 +21,8 @@ from http.cookiejar import split_header_words
|
|||
import email
|
||||
import requests
|
||||
|
||||
from . import LinkCheckerError
|
||||
|
||||
|
||||
def from_file(filename):
|
||||
"""Parse cookie data from a text file in HTTP header format.
|
||||
|
|
@ -40,6 +42,8 @@ def from_file(filename):
|
|||
lines.append(line)
|
||||
if lines:
|
||||
entries.extend(from_headers("\r\n".join(lines)))
|
||||
if not entries:
|
||||
raise LinkCheckerError(_("No entries found"))
|
||||
return entries
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue