Skip to content

Commit 163efc5

Browse files
authored
fix: backwards compatibility with <1.1 API
1 parent 9269ff3 commit 163efc5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

scholarly/_proxy_generator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,11 @@ def _fp_coroutine(self, timeout=1, wait_time=120):
515515
while (time.time()-t1 < wait_time):
516516
proxy = all_proxies.pop()
517517
if not all_proxies:
518-
all_proxies = freeproxy.get_proxy_list()
518+
try:
519+
all_proxies = freeproxy.get_proxy_list(repeat=False) # free-proxy >= 1.1.0
520+
except TypeError:
521+
all_proxies = freeproxy.get_proxy_list() # free-proxy < 1.1.0
522+
all_proxies.reverse() # Try the older proxies first
519523
if proxy in self._dirty_freeproxies:
520524
continue
521525
proxies = {'http://': proxy, 'https://': proxy}

0 commit comments

Comments
 (0)