reddrix 0.2.0__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reddrix
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Reddrix is an open-source, blazing-fast Reddit Scraper for Python (No API Key)
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE.md
@@ -29,7 +29,7 @@ Dynamic: summary
29
29
 
30
30
  <p align="center" id="badges">
31
31
  <a href="https://pypi.org/project/reddrix/">
32
- <img src="https://img.shields.io/badge/pypi-v0.2.0-orange.svg" alt="pypi package logo">
32
+ <img src="https://img.shields.io/badge/pypi-v0.2.2-orange.svg" alt="pypi package logo">
33
33
  </a>
34
34
  <a href="https://pypi.org/project/reddrix/">
35
35
  <img src="https://img.shields.io/badge/python-3.10%2B-blue.svg" alt="python versions badge">
@@ -8,7 +8,7 @@
8
8
 
9
9
  <p align="center" class="badges">
10
10
  <a href="https://pypi.org/project/reddrix/">
11
- <img src="https://img.shields.io/badge/pypi-v0.2.0-orange.svg" alt="pypi package logo">
11
+ <img src="https://img.shields.io/badge/pypi-v0.2.2-orange.svg" alt="pypi package logo">
12
12
  </a>
13
13
  <a href="https://pypi.org/project/reddrix/">
14
14
  <img src="https://img.shields.io/badge/python-3.10%2B-blue.svg" alt="python versions badge">
@@ -1,2 +1,2 @@
1
1
  from .reddrix import Reddrix
2
- __version__ = "0.2.0"
2
+ __version__ = "0.2.2"
@@ -56,7 +56,7 @@ def auto_retry(max_attempts: int):
56
56
  raise FatalAntiBotBlockError(f"Error executing function: {func.__name__}\n\nError Message: Cookies expired, and attempts have been exhausted.")
57
57
 
58
58
  async with COOKIE_LOCK:
59
- if current_time - scraper.cookies_last_accessed_at >= 15: # Must match the wait selector timeout.
59
+ if current_time - scraper.cookies_last_accessed_at >= 15 and scraper.is_running: # Must match the wait selector timeout.
60
60
  await scraper.refresh_cookies()
61
61
 
62
62
  await asyncio.sleep(min(2 ** attempt + random.uniform(0, 5), 60))
@@ -87,10 +87,7 @@ class Reddrix:
87
87
  max_top_comments_per_post: int=999999,
88
88
  proxies: list[str]=[],
89
89
  verbose: bool=False
90
- ):
91
- if http_client == "curl_cffi":
92
- self.log("CURL_CFFI CLIENT IS DEPRECATED. SWITCHING TO CAMOUFOX...", level="warning")
93
-
90
+ ):
94
91
  self.mode = mode
95
92
  self.max_results = max_results
96
93
  self.max_posts_per_collection = max_posts_per_collection
@@ -120,6 +117,9 @@ class Reddrix:
120
117
  self.page_semaphore = asyncio.Semaphore(10)
121
118
  self.request_semaphore = asyncio.Semaphore(10)
122
119
  self.items_queue = asyncio.Queue(maxsize=1000)
120
+ self.is_running = True
121
+ if http_client == "curl_cffi":
122
+ self.log("CURL_CFFI CLIENT IS DEPRECATED. SWITCHING TO CAMOUFOX...", level="warning")
123
123
 
124
124
  async def start(self):
125
125
  return await self.__aenter__()
@@ -822,4 +822,5 @@ class Reddrix:
822
822
  else:
823
823
  break
824
824
  finally:
825
+ self.is_running = False
825
826
  runner.cancel()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reddrix
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Reddrix is an open-source, blazing-fast Reddit Scraper for Python (No API Key)
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE.md
@@ -29,7 +29,7 @@ Dynamic: summary
29
29
 
30
30
  <p align="center" id="badges">
31
31
  <a href="https://pypi.org/project/reddrix/">
32
- <img src="https://img.shields.io/badge/pypi-v0.2.0-orange.svg" alt="pypi package logo">
32
+ <img src="https://img.shields.io/badge/pypi-v0.2.2-orange.svg" alt="pypi package logo">
33
33
  </a>
34
34
  <a href="https://pypi.org/project/reddrix/">
35
35
  <img src="https://img.shields.io/badge/python-3.10%2B-blue.svg" alt="python versions badge">
@@ -5,7 +5,7 @@ with open("PYPI_README.md", mode="r", encoding="utf-8") as f:
5
5
 
6
6
  setup(
7
7
  name="reddrix",
8
- version="0.2.0",
8
+ version="0.2.2",
9
9
  packages=find_packages(),
10
10
  install_requires=["camoufox[geoip]", "whiskeysour", "curl-cffi"],
11
11
  entry_points={
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes