mirror of
https://github.com/bellingcat/snscrape.git
synced 2026-06-11 20:08:29 +03:00
Expose status code for non-200 Twitter responses
This commit is contained in:
@@ -681,7 +681,7 @@ class _TwitterAPIScraper(snscrape.base.Scraper):
|
|||||||
if r.headers.get('content-type', '').replace(' ', '') != 'application/json;charset=utf-8':
|
if r.headers.get('content-type', '').replace(' ', '') != 'application/json;charset=utf-8':
|
||||||
return False, 'content type is not JSON'
|
return False, 'content type is not JSON'
|
||||||
if r.status_code != 200:
|
if r.status_code != 200:
|
||||||
return False, 'non-200 status code'
|
return False, f'non-200 status code ({r.status_code})'
|
||||||
return True, None
|
return True, None
|
||||||
|
|
||||||
def _get_api_data(self, endpoint, apiType, params):
|
def _get_api_data(self, endpoint, apiType, params):
|
||||||
|
|||||||
Reference in New Issue
Block a user