INNER CODE UNIT · Python

_should_refresh_session

VeNoMouS/cloudscraper · cloudscraper/__init__.py:494

    def _should_refresh_session(self):
        """
        Check if the session should be refreshed based on age and other factors
        """
        current_time = time.time()
        session_age = current_time - self.session_start_time

        # Refresh if session is older than the configured interval
        if session_age > self.session_refresh_interval:
            return True

        # Refresh if we've had recent 403 errors
        if self.last_403_time > 0 and (current_time - self.last_403_time) < 60:
            return True

        return False

    def _refresh_session(self, url):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…