diff --git a/snapchat_dl/snapchat_dl.py b/snapchat_dl/snapchat_dl.py index 804e0ad..7aee59f 100644 --- a/snapchat_dl/snapchat_dl.py +++ b/snapchat_dl/snapchat_dl.py @@ -43,7 +43,12 @@ def __init__( def _api_response(self, username): web_url = self.endpoint_web.format(username) - return requests.get(web_url).text + return requests.get( + web_url, + headers={ + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" + }, + ).text def _web_fetch_story(self, username): """Download user stories from Web. diff --git a/snapchat_dl/version.py b/snapchat_dl/version.py index 8c0d5d5..159d48b 100644 --- a/snapchat_dl/version.py +++ b/snapchat_dl/version.py @@ -1 +1 @@ -__version__ = "2.0.0" +__version__ = "2.0.1" diff --git a/tests/test_snapchat_dl.py b/tests/test_snapchat_dl.py index d39e8c5..ea245c6 100644 --- a/tests/test_snapchat_dl.py +++ b/tests/test_snapchat_dl.py @@ -48,8 +48,8 @@ def test_class_init(self): def test_invalid_username(self): """Test snapchat_dl Stories are not available.""" - with self.assertRaises(NoStoriesFound): - self.snapchat_dl.download("username") + with self.assertRaises(UserNotFoundError): + self.snapchat_dl.download("use=rname") @mock.patch("snapchat_dl.snapchat_dl.SnapchatDL._api_response") def test_api_error(self, api_response):