crash.software
Projects
Pull Requests
Issues
Builds
snscrape
Code
Files
Commits
Branches
Tags
Pull Requests
Code Comments
Code Compare
Issues
List
Boards
Milestones
Builds
Statistics
Contributions
Source Lines
Child Projects
Projects
STRLCPY
snscrape
Commits
5d156c6a
🤬
Sign In
Detect and raise error on redirect from GraphQL endpoint to login
#165
JustAnotherArchivist
committed
2 years ago
5d156c6a
1 parent
694657ef
Total 1 files
■ ■
■ ■ ■ ■
snscrape/modules/instagram.py
skipped 95 lines
96
96
def _check_json_callback(self, r):
97
97
if r.status_code != 200:
98
98
return False, f'status code {r.status_code}'
99
+
if r.url.startswith('https://www.instagram.com/accounts/login/'):
100
+
raise snscrape.base.ScraperException('Redirected to login page')
99
101
try:
100
102
obj = json.loads(r.text)
101
103
except json.JSONDecodeError as e:
skipped 141 lines
All occurrences
Please wait...
Page is in error, reload to recover