Skip to content

Commit

Permalink
[weibo] detect redirects to login page (#4773)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Nov 10, 2023
1 parent 5e58d2b commit e8b5e59
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions gallery_dl/extractor/weibo.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ def _init(self):
def request(self, url, **kwargs):
response = Extractor.request(self, url, **kwargs)

if response.history and "passport.weibo.com" in response.url:
self._sina_visitor_system(response)
response = Extractor.request(self, url, **kwargs)
if response.history:
if "login.sina.com" in response.url:
raise exception.StopExtraction(
"HTTP redirect to login page (%s)",
response.url.partition("?")[0])
if "passport.weibo.com" in response.url:
self._sina_visitor_system(response)
response = Extractor.request(self, url, **kwargs)

return response

Expand Down

0 comments on commit e8b5e59

Please sign in to comment.