aura-fetch 1.0.0__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.
- aura_fetch-1.0.0/PKG-INFO +61 -0
- aura_fetch-1.0.0/README.md +40 -0
- aura_fetch-1.0.0/aura_fetch.egg-info/PKG-INFO +61 -0
- aura_fetch-1.0.0/aura_fetch.egg-info/SOURCES.txt +9 -0
- aura_fetch-1.0.0/aura_fetch.egg-info/dependency_links.txt +1 -0
- aura_fetch-1.0.0/aura_fetch.egg-info/requires.txt +1 -0
- aura_fetch-1.0.0/aura_fetch.egg-info/top_level.txt +1 -0
- aura_fetch-1.0.0/aura_image_fetcher/__init__.py +3 -0
- aura_fetch-1.0.0/aura_image_fetcher/core.py +107 -0
- aura_fetch-1.0.0/setup.cfg +4 -0
- aura_fetch-1.0.0/setup.py +26 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aura-fetch
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: An ultimate, lightning-fast image fetcher that bypasses Cloudflare and anti-bot servers.
|
|
5
|
+
Author: Your Name
|
|
6
|
+
Author-email: your.email@example.com
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.8
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: DrissionPage>=4.0.0
|
|
13
|
+
Dynamic: author
|
|
14
|
+
Dynamic: author-email
|
|
15
|
+
Dynamic: classifier
|
|
16
|
+
Dynamic: description
|
|
17
|
+
Dynamic: description-content-type
|
|
18
|
+
Dynamic: requires-dist
|
|
19
|
+
Dynamic: requires-python
|
|
20
|
+
Dynamic: summary
|
|
21
|
+
|
|
22
|
+
# 📸 Aura Image Fetcher (`aura-image-fetcher`)
|
|
23
|
+
|
|
24
|
+
**Aura Image Fetcher** is an insanely fast, anti-bot-bypassing Python library designed specifically to download and fetch images from **any** URL, completely ignoring Cloudflare, referer protections, and firewall blocks.
|
|
25
|
+
|
|
26
|
+
It achieves speeds of **fractions of a second** by keeping a totally invisible (headless) Native Chromium engine running in the background. When an image is requested, it directly extracts the raw image bytes from the browser's memory via HTML5 Canvas, bypassing Python's network stack entirely to evade ISP blocks, Antivirus MITM, and Cloudflare!
|
|
27
|
+
|
|
28
|
+
## 🚀 Key Features
|
|
29
|
+
- **Extreme Speed:** Downloads images in fractions of a second.
|
|
30
|
+
- **Bypass Cloudflare & ISP Blocks:** Uses a real browser engine natively, so your ISP or Antivirus cannot intercept and drop the connection like they do with `requests` or `curl`.
|
|
31
|
+
- **All Formats Supported:** Extracts PNG, JPG, WEBP, AVIF, and more directly from memory.
|
|
32
|
+
- **Auto-Hotlink Bypass:** Bypasses hotlink protections naturally.
|
|
33
|
+
|
|
34
|
+
## 📦 Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install aura-image-fetcher
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 💻 Usage
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
from aura_image_fetcher import AuraImageFetcher
|
|
44
|
+
|
|
45
|
+
# Initialize the fetcher (set debug=True to see the magic happening)
|
|
46
|
+
fetcher = AuraImageFetcher(debug=True)
|
|
47
|
+
|
|
48
|
+
# 1. Save an image directly to your disk
|
|
49
|
+
success = fetcher.save_image(
|
|
50
|
+
image_url="https://example.com/protected_image.jpg",
|
|
51
|
+
save_path="my_images/test.jpg"
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# 2. Or, fetch the raw image bytes to process in memory (e.g., for AI Vision models)
|
|
55
|
+
image_bytes = fetcher.fetch_image("https://example.com/protected_image.jpg")
|
|
56
|
+
if image_bytes:
|
|
57
|
+
print(f"Downloaded {len(image_bytes)} bytes!")
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## 🧠 Why is it so formidable?
|
|
61
|
+
Most image servers block bots by checking the TLS fingerprint or checking if the request came from their own website. `AuraImageFetcher` intelligently reconstructs a perfect Chrome header and dynamically spoofs the origin website, forcing the server to surrender the image immediately!
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# 📸 Aura Image Fetcher (`aura-image-fetcher`)
|
|
2
|
+
|
|
3
|
+
**Aura Image Fetcher** is an insanely fast, anti-bot-bypassing Python library designed specifically to download and fetch images from **any** URL, completely ignoring Cloudflare, referer protections, and firewall blocks.
|
|
4
|
+
|
|
5
|
+
It achieves speeds of **fractions of a second** by keeping a totally invisible (headless) Native Chromium engine running in the background. When an image is requested, it directly extracts the raw image bytes from the browser's memory via HTML5 Canvas, bypassing Python's network stack entirely to evade ISP blocks, Antivirus MITM, and Cloudflare!
|
|
6
|
+
|
|
7
|
+
## 🚀 Key Features
|
|
8
|
+
- **Extreme Speed:** Downloads images in fractions of a second.
|
|
9
|
+
- **Bypass Cloudflare & ISP Blocks:** Uses a real browser engine natively, so your ISP or Antivirus cannot intercept and drop the connection like they do with `requests` or `curl`.
|
|
10
|
+
- **All Formats Supported:** Extracts PNG, JPG, WEBP, AVIF, and more directly from memory.
|
|
11
|
+
- **Auto-Hotlink Bypass:** Bypasses hotlink protections naturally.
|
|
12
|
+
|
|
13
|
+
## 📦 Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install aura-image-fetcher
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 💻 Usage
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from aura_image_fetcher import AuraImageFetcher
|
|
23
|
+
|
|
24
|
+
# Initialize the fetcher (set debug=True to see the magic happening)
|
|
25
|
+
fetcher = AuraImageFetcher(debug=True)
|
|
26
|
+
|
|
27
|
+
# 1. Save an image directly to your disk
|
|
28
|
+
success = fetcher.save_image(
|
|
29
|
+
image_url="https://example.com/protected_image.jpg",
|
|
30
|
+
save_path="my_images/test.jpg"
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
# 2. Or, fetch the raw image bytes to process in memory (e.g., for AI Vision models)
|
|
34
|
+
image_bytes = fetcher.fetch_image("https://example.com/protected_image.jpg")
|
|
35
|
+
if image_bytes:
|
|
36
|
+
print(f"Downloaded {len(image_bytes)} bytes!")
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 🧠 Why is it so formidable?
|
|
40
|
+
Most image servers block bots by checking the TLS fingerprint or checking if the request came from their own website. `AuraImageFetcher` intelligently reconstructs a perfect Chrome header and dynamically spoofs the origin website, forcing the server to surrender the image immediately!
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aura-fetch
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: An ultimate, lightning-fast image fetcher that bypasses Cloudflare and anti-bot servers.
|
|
5
|
+
Author: Your Name
|
|
6
|
+
Author-email: your.email@example.com
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.8
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: DrissionPage>=4.0.0
|
|
13
|
+
Dynamic: author
|
|
14
|
+
Dynamic: author-email
|
|
15
|
+
Dynamic: classifier
|
|
16
|
+
Dynamic: description
|
|
17
|
+
Dynamic: description-content-type
|
|
18
|
+
Dynamic: requires-dist
|
|
19
|
+
Dynamic: requires-python
|
|
20
|
+
Dynamic: summary
|
|
21
|
+
|
|
22
|
+
# 📸 Aura Image Fetcher (`aura-image-fetcher`)
|
|
23
|
+
|
|
24
|
+
**Aura Image Fetcher** is an insanely fast, anti-bot-bypassing Python library designed specifically to download and fetch images from **any** URL, completely ignoring Cloudflare, referer protections, and firewall blocks.
|
|
25
|
+
|
|
26
|
+
It achieves speeds of **fractions of a second** by keeping a totally invisible (headless) Native Chromium engine running in the background. When an image is requested, it directly extracts the raw image bytes from the browser's memory via HTML5 Canvas, bypassing Python's network stack entirely to evade ISP blocks, Antivirus MITM, and Cloudflare!
|
|
27
|
+
|
|
28
|
+
## 🚀 Key Features
|
|
29
|
+
- **Extreme Speed:** Downloads images in fractions of a second.
|
|
30
|
+
- **Bypass Cloudflare & ISP Blocks:** Uses a real browser engine natively, so your ISP or Antivirus cannot intercept and drop the connection like they do with `requests` or `curl`.
|
|
31
|
+
- **All Formats Supported:** Extracts PNG, JPG, WEBP, AVIF, and more directly from memory.
|
|
32
|
+
- **Auto-Hotlink Bypass:** Bypasses hotlink protections naturally.
|
|
33
|
+
|
|
34
|
+
## 📦 Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install aura-image-fetcher
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 💻 Usage
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
from aura_image_fetcher import AuraImageFetcher
|
|
44
|
+
|
|
45
|
+
# Initialize the fetcher (set debug=True to see the magic happening)
|
|
46
|
+
fetcher = AuraImageFetcher(debug=True)
|
|
47
|
+
|
|
48
|
+
# 1. Save an image directly to your disk
|
|
49
|
+
success = fetcher.save_image(
|
|
50
|
+
image_url="https://example.com/protected_image.jpg",
|
|
51
|
+
save_path="my_images/test.jpg"
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# 2. Or, fetch the raw image bytes to process in memory (e.g., for AI Vision models)
|
|
55
|
+
image_bytes = fetcher.fetch_image("https://example.com/protected_image.jpg")
|
|
56
|
+
if image_bytes:
|
|
57
|
+
print(f"Downloaded {len(image_bytes)} bytes!")
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## 🧠 Why is it so formidable?
|
|
61
|
+
Most image servers block bots by checking the TLS fingerprint or checking if the request came from their own website. `AuraImageFetcher` intelligently reconstructs a perfect Chrome header and dynamically spoofs the origin website, forcing the server to surrender the image immediately!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
DrissionPage>=4.0.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
aura_image_fetcher
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import time
|
|
3
|
+
|
|
4
|
+
class AuraImageFetcher:
|
|
5
|
+
"""
|
|
6
|
+
The Ultimate, Lightning-Fast Image Fetcher via Native Browser Engine.
|
|
7
|
+
Bypasses Cloudflare, ISP blocks, and anti-bot servers by using a true headless browser.
|
|
8
|
+
"""
|
|
9
|
+
def __init__(self, debug: bool = False):
|
|
10
|
+
self.debug = debug
|
|
11
|
+
try:
|
|
12
|
+
from DrissionPage import ChromiumOptions, ChromiumPage
|
|
13
|
+
except ImportError:
|
|
14
|
+
raise ImportError("Please install DrissionPage: pip install DrissionPage")
|
|
15
|
+
|
|
16
|
+
co = ChromiumOptions()
|
|
17
|
+
co.set_argument('--headless=new')
|
|
18
|
+
co.mute(True)
|
|
19
|
+
# Use an isolated profile to avoid 404 websocket crashes!
|
|
20
|
+
home = os.path.expanduser("~")
|
|
21
|
+
profile_path = os.path.join(home, ".aura_image_fetcher", "profile")
|
|
22
|
+
co.set_user_data_path(profile_path)
|
|
23
|
+
co.auto_port()
|
|
24
|
+
|
|
25
|
+
if self.debug:
|
|
26
|
+
print("[Aura-Image-Fetcher] 🚀 Initializing native browser engine...")
|
|
27
|
+
|
|
28
|
+
self.page = ChromiumPage(addr_or_opts=co)
|
|
29
|
+
|
|
30
|
+
def fetch_image(self, image_url: str, referer: str = None) -> bytes:
|
|
31
|
+
"""
|
|
32
|
+
Fetches an image from a URL as bytes by loading it natively in the browser
|
|
33
|
+
and extracting the raw bytes via Canvas, bypassing all connection resets!
|
|
34
|
+
"""
|
|
35
|
+
start_time = time.time()
|
|
36
|
+
|
|
37
|
+
if self.debug:
|
|
38
|
+
print(f"[Aura-Image-Fetcher] 🚀 Fetching natively: {image_url}")
|
|
39
|
+
|
|
40
|
+
try:
|
|
41
|
+
# Load the image natively
|
|
42
|
+
self.page.get(image_url)
|
|
43
|
+
|
|
44
|
+
# The browser will render the image in an <img> tag.
|
|
45
|
+
# We extract it directly from memory without triggering Python's blocked network stack!
|
|
46
|
+
js = """
|
|
47
|
+
return new Promise((resolve) => {
|
|
48
|
+
const img = document.querySelector('img');
|
|
49
|
+
if (!img) { resolve(null); return; }
|
|
50
|
+
|
|
51
|
+
// Wait for the image to be fully decoded by the browser
|
|
52
|
+
if (img.complete) {
|
|
53
|
+
processImage(img);
|
|
54
|
+
} else {
|
|
55
|
+
img.onload = () => processImage(img);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function processImage(image) {
|
|
59
|
+
const canvas = document.createElement('canvas');
|
|
60
|
+
canvas.width = image.naturalWidth;
|
|
61
|
+
canvas.height = image.naturalHeight;
|
|
62
|
+
const ctx = canvas.getContext('2d');
|
|
63
|
+
ctx.drawImage(image, 0, 0);
|
|
64
|
+
// Extract as PNG to preserve exact quality and transparency
|
|
65
|
+
resolve(canvas.toDataURL('image/png'));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
"""
|
|
69
|
+
b64_data = self.page.run_js(js)
|
|
70
|
+
|
|
71
|
+
if b64_data and "," in b64_data:
|
|
72
|
+
import base64
|
|
73
|
+
image_bytes = base64.b64decode(b64_data.split(',')[1])
|
|
74
|
+
elapsed = time.time() - start_time
|
|
75
|
+
if self.debug:
|
|
76
|
+
print(f"[Aura-Image-Fetcher] ✅ Success! Extracted {len(image_bytes)} bytes in {elapsed:.3f} seconds!")
|
|
77
|
+
return image_bytes
|
|
78
|
+
else:
|
|
79
|
+
if self.debug:
|
|
80
|
+
print(f"[Aura-Image-Fetcher] ❌ Failed to extract image data from browser.")
|
|
81
|
+
return None
|
|
82
|
+
except Exception as e:
|
|
83
|
+
if self.debug:
|
|
84
|
+
print(f"[Aura-Image-Fetcher] ❌ Error fetching image: {e}")
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
def save_image(self, image_url: str, save_path: str, referer: str = None) -> bool:
|
|
88
|
+
"""
|
|
89
|
+
Fetches an image and saves it directly to the disk.
|
|
90
|
+
"""
|
|
91
|
+
image_bytes = self.fetch_image(image_url, referer)
|
|
92
|
+
if image_bytes:
|
|
93
|
+
try:
|
|
94
|
+
os.makedirs(os.path.dirname(os.path.abspath(save_path)), exist_ok=True)
|
|
95
|
+
with open(save_path, 'wb') as f:
|
|
96
|
+
f.write(image_bytes)
|
|
97
|
+
if self.debug:
|
|
98
|
+
print(f"[Aura-Image-Fetcher] 💾 Saved to: {save_path}")
|
|
99
|
+
return True
|
|
100
|
+
except Exception as e:
|
|
101
|
+
if self.debug:
|
|
102
|
+
print(f"[Aura-Image-Fetcher] ❌ Failed to save image: {e}")
|
|
103
|
+
return False
|
|
104
|
+
return False
|
|
105
|
+
|
|
106
|
+
def close(self):
|
|
107
|
+
self.page.quit()
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
with open(os.path.join(os.path.dirname(__file__), "README.md"), "r", encoding="utf-8") as fh:
|
|
6
|
+
long_description = fh.read()
|
|
7
|
+
|
|
8
|
+
setup(
|
|
9
|
+
name="aura-fetch",
|
|
10
|
+
version="1.0.0",
|
|
11
|
+
description="An ultimate, lightning-fast image fetcher that bypasses Cloudflare and anti-bot servers.",
|
|
12
|
+
long_description=long_description,
|
|
13
|
+
long_description_content_type="text/markdown",
|
|
14
|
+
author="Your Name",
|
|
15
|
+
author_email="your.email@example.com",
|
|
16
|
+
packages=find_packages(),
|
|
17
|
+
install_requires=[
|
|
18
|
+
"DrissionPage>=4.0.0",
|
|
19
|
+
],
|
|
20
|
+
classifiers=[
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"License :: OSI Approved :: MIT License",
|
|
23
|
+
"Operating System :: OS Independent",
|
|
24
|
+
],
|
|
25
|
+
python_requires='>=3.8',
|
|
26
|
+
)
|