Skip to content

Commit 6f6c7a8

Browse files
committed
Fixing Twitter scraper cookie extraction edge case
1 parent a190c5e commit 6f6c7a8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

minet/twitter/api_scraper.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#
55
# Twitter public API "scraper".
66
#
7+
from typing import Optional
8+
79
import time
810
import json
911
import datetime
@@ -63,7 +65,10 @@ def is_query_too_long(query):
6365
return len(quote(query)) > MAXIMUM_QUERY_LENGTH
6466

6567

66-
def is_cookie_valid(cookie: str) -> bool:
68+
def is_cookie_valid(cookie: Optional[str]) -> bool:
69+
if cookie is None:
70+
return False
71+
6772
dict_cookie = cookie_string_to_dict(cookie)
6873

6974
return bool(

0 commit comments

Comments
 (0)