From e09aea70e74583f58540aeb584c089813cca547b Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Sat, 3 Dec 2022 06:36:52 +0000 Subject: [PATCH] Fix Twitter username length limit Although 15 characters is the official, current limit, there are accounts with longer usernames. 20 is the longest observed example, but it's unclear what the true limit is. --- snscrape/modules/twitter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snscrape/modules/twitter.py b/snscrape/modules/twitter.py index 4bf84f1..060ed6c 100644 --- a/snscrape/modules/twitter.py +++ b/snscrape/modules/twitter.py @@ -1539,7 +1539,7 @@ class TwitterUserScraper(TwitterSearchScraper): @staticmethod def is_valid_username(s): - return 1 <= len(s) <= 15 and s.strip(string.ascii_letters + string.digits + '_') == '' + return 1 <= len(s) <= 20 and s.strip(string.ascii_letters + string.digits + '_') == '' @classmethod def _cli_setup_parser(cls, subparser):