Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceeded 30 redirects. #178

Open
Natkeeran opened this issue Oct 6, 2022 · 0 comments
Open

Exceeded 30 redirects. #178

Natkeeran opened this issue Oct 6, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Natkeeran
Copy link

Describe the bug

Running into the Exceeded 30 redirects when saving urls. I was using the same script before, did not encounter this type of issue. Leaving 15 seconds before each request, thus this is not making too many requests to IA. Often fails even when trying to save the first url.

2     user_agent = "Mozilla/5.0 (Windows NT 5.1; rv:40.0) Gecko/20100101 Firefox/40.0"
      3     save_api = WaybackMachineSaveAPI(save_url, user_agent)
----> 4     save_api.save()

~/.local/lib/python3.8/site-packages/waybackpy/save_api.py in save(self)
    208                 self.sleep(tries)
    209 
--> 210             self.get_save_request_headers()
    211             self.saved_archive = self.archive_url_parser()
    212 

~/.local/lib/python3.8/site-packages/waybackpy/save_api.py in get_save_request_headers(self)
     87         )
     88         session.mount("https://", HTTPAdapter(max_retries=retries))
---> 89         self.response = session.get(self.request_url, headers=self.request_headers)
     90         # requests.response.headers is requests.structures.CaseInsensitiveDict
     91         self.headers = self.response.headers

~/.local/lib/python3.8/site-packages/requests/sessions.py in get(self, url, **kwargs)
    540 
    541         kwargs.setdefault('allow_redirects', True)
--> 542         return self.request('GET', url, **kwargs)
    543 
    544     def options(self, url, **kwargs):

~/.local/lib/python3.8/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    527         }
    528         send_kwargs.update(settings)
--> 529         resp = self.send(prep, **send_kwargs)
    530 
    531         return resp

~/.local/lib/python3.8/site-packages/requests/sessions.py in send(self, request, **kwargs)
    665             # Redirect resolving generator.
    666             gen = self.resolve_redirects(r, request, **kwargs)
--> 667             history = [resp for resp in gen]
    668         else:
    669             history = []

~/.local/lib/python3.8/site-packages/requests/sessions.py in <listcomp>(.0)
    665             # Redirect resolving generator.
    666             gen = self.resolve_redirects(r, request, **kwargs)
--> 667             history = [resp for resp in gen]
    668         else:
    669             history = []

~/.local/lib/python3.8/site-packages/requests/sessions.py in resolve_redirects(self, resp, req, stream, timeout, verify, cert, proxies, yield_requests, **adapter_kwargs)
    164 
    165             if len(resp.history) >= self.max_redirects:
--> 166                 raise TooManyRedirects('Exceeded {} redirects.'.format(self.max_redirects), response=resp)
    167 
    168             # Release the connection back into the pool.

TooManyRedirects: Exceeded 30 redirects.

failed_links

Version:

  • OS: Linux
  • Version: Version: 3.0.6
  • Is latest version? Yes
@Natkeeran Natkeeran added the bug Something isn't working label Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants