closed
#64
by Saverign - opened
- .gitattributes +63 -1
- README.md +34 -52
- catalog.db +2 -2
- master_fullres_8.5m_links.rar +3 -0
- master_fullres_8.5m_links.txt +3 -0
- test_pr64.txt +1 -0
- tool.py +21 -48
.gitattributes
CHANGED
|
@@ -1 +1,63 @@
|
|
| 1 |
-
*.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.avro filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.mds filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
# Audio files - uncompressed
|
| 40 |
+
*.pcm filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
*.sam filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
*.raw filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
# Audio files - compressed
|
| 44 |
+
*.aac filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
*.ogg filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 49 |
+
# Image files - uncompressed
|
| 50 |
+
*.bmp filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
*.tiff filter=lfs diff=lfs merge=lfs -text
|
| 54 |
+
# Image files - compressed
|
| 55 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 58 |
+
# Video files - compressed
|
| 59 |
+
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
master_fullres_8.5m_links.txt filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
catalog.db filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
catalog_salted_hash.db filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,92 +1,74 @@
|
|
| 1 |
# CaraArchive Index Dataset
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
### 1) This is an Index Dataset, not an Image dataset
|
| 4 |
- This dataset contains **0 image data**.
|
| 5 |
- It only contains links to Cara App's CDN and metadata.
|
| 6 |
- HuggingFace may load some images in the preview because it detects the CDN links, however those images do not exist as data in this dataset, HF literally just loads them using your own connection as a preview.
|
| 7 |
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
-
|
| 13 |
-
```bash
|
| 14 |
-
python tool.py --user artist_fc17f3c7 --overview
|
| 15 |
-
# or query by author UUID:
|
| 16 |
-
python tool.py --user fc17f3c7-73ab-4866-8d1a-554da8ea68a9 --overview
|
| 17 |
-
```
|
| 18 |
|
| 19 |
-
|
| 20 |
```bash
|
| 21 |
-
python tool.py --user
|
| 22 |
```
|
| 23 |
|
| 24 |
-
|
| 25 |
```bash
|
| 26 |
-
python tool.py --post
|
| 27 |
-
# or using web URL:
|
| 28 |
-
python tool.py --post https://cara.app/post/00002b4d-120a-4e94-bae7-49b9c905bc05
|
| 29 |
```
|
| 30 |
|
| 31 |
-
|
| 32 |
```bash
|
| 33 |
-
python tool.py --art
|
| 34 |
-
# or using direct CDN link:
|
| 35 |
-
python tool.py --art https://cdn.cara.app/production/posts/93d6c843-1f4a-429d-8144-31e9099b95c6/tenaebron-S4TIL677BLm8bh_T0jB6I-post-cover-image.jpeg
|
| 36 |
```
|
| 37 |
|
| 38 |
---
|
| 39 |
|
| 40 |
### Database Structure (`catalog.db`)
|
| 41 |
|
| 42 |
-
The SQLite database contains 3 main tables
|
| 43 |
|
| 44 |
-
#### `master_artworks_12m` (8,
|
| 45 |
Contains all full-resolution master artwork uploads.
|
| 46 |
-
- `id`: Unique image ID (`<post_id>_slide_<number>`)
|
| 47 |
- `post_id`: Post ID this artwork belongs to
|
| 48 |
-
- `author_slug`:
|
| 49 |
- `slide_number`: Order in the multi-image gallery (1, 2, 3...)
|
| 50 |
-
- `title`: Post title
|
| 51 |
-
- `cdn_url`: Direct high-res CDN link
|
| 52 |
- `width`: Image width in pixels
|
| 53 |
- `height`: Image height in pixels
|
| 54 |
- `created_at`: Upload timestamp
|
| 55 |
|
| 56 |
#### `artworks` (3,431,475 rows)
|
| 57 |
Contains all posts and cover thumbnails.
|
| 58 |
-
- `
|
| 59 |
-
- `author_slug`:
|
| 60 |
-
- `author_id`:
|
| 61 |
-
- `
|
| 62 |
-
- `cdn_url`: Cover image / thumbnail link `(UNIQUE)`
|
| 63 |
- `created_at`: Creation timestamp
|
| 64 |
-
- `downloaded`: Download status flag (`0` = pending, `1` = downloaded)
|
| 65 |
|
| 66 |
-
#### `post_metadata` (3,431,
|
| 67 |
-
Contains all tags, software, descriptions,
|
| 68 |
-
- `post_id`: Post ID
|
| 69 |
-
- `author_slug`:
|
| 70 |
-
- `author_name`:
|
| 71 |
-
- `title`: Post title
|
| 72 |
-
- `content`: Description / lore text
|
| 73 |
-
- `softwares`: Software used (
|
| 74 |
-
- `tags`: Categories and tags (
|
| 75 |
-
- `raw_tags`: Typed tags (JSON array of objects, e.g. `[{"type": "category", "value": "Horror"}]`)
|
| 76 |
-
- `like_count`: Number of likes
|
| 77 |
-
- `comment_count`: Number of comments
|
| 78 |
- `status_code`: HTTP status (`200` = active, `404` = deleted post, `403` = private)
|
| 79 |
- `is_deleted`: `1` if post was removed, `0` if active
|
| 80 |
- `created_at`: Creation timestamp
|
| 81 |
|
| 82 |
-
#### Additional Tracking Tables:
|
| 83 |
-
- `indexed_artists` (3,267 rows): `author_id` (PK), `slug`, `artwork_count`
|
| 84 |
-
- `processed_posts` (3,431,475 rows): `post_id` (PK)
|
| 85 |
-
|
| 86 |
---
|
| 87 |
-
|
| 88 |
-
### Files in this Release
|
| 89 |
-
- `catalog.db`: SQLite database with all tables and B-Tree indexes (9.82 GB)
|
| 90 |
-
- `tool.py`: CLI dataset explorer script
|
| 91 |
-
- `README.md`: Dataset documentation
|
| 92 |
-
|
|
|
|
| 1 |
# CaraArchive Index Dataset
|
| 2 |
|
| 3 |
+
phamrhgids
|
| 4 |
+
igmutexyzb
|
| 5 |
+
|
| 6 |
### 1) This is an Index Dataset, not an Image dataset
|
| 7 |
- This dataset contains **0 image data**.
|
| 8 |
- It only contains links to Cara App's CDN and metadata.
|
| 9 |
- HuggingFace may load some images in the preview because it detects the CDN links, however those images do not exist as data in this dataset, HF literally just loads them using your own connection as a preview.
|
| 10 |
|
| 11 |
+
### 2) This dataset is *100% Complete*
|
| 12 |
+
- It includes **3.43 million posts** (and their thumbnails) from **790k users** to which belong **8.52 million artworks**, making a total of **~12 million image links**.
|
| 13 |
+
- Every user and every post on the platform (from 14/6/26 and before) is included here.
|
| 14 |
+
- Some people got the impression that not all of their posts are there because they searched their names in the CDN URLs, however *not all URLs include the name in them* (many use server timestamps and random hashes).
|
| 15 |
|
| 16 |
+
---
|
| 17 |
|
| 18 |
+
### How to Query the Database `tool.py` (make sure catalog.db is in the directory)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
To see a clean summary overview of an account
|
| 21 |
```bash
|
| 22 |
+
python tool.py --user <username>
|
| 23 |
```
|
| 24 |
|
| 25 |
+
To see all artworks, software, metadata and creator for a specific post:
|
| 26 |
```bash
|
| 27 |
+
python tool.py --post <Post URL or ID>
|
|
|
|
|
|
|
| 28 |
```
|
| 29 |
|
| 30 |
+
To find the post and creator that an artwork belongs to:
|
| 31 |
```bash
|
| 32 |
+
python tool.py --art <CDN URL or filename>
|
|
|
|
|
|
|
| 33 |
```
|
| 34 |
|
| 35 |
---
|
| 36 |
|
| 37 |
### Database Structure (`catalog.db`)
|
| 38 |
|
| 39 |
+
The SQLite database contains 3 main tables:
|
| 40 |
|
| 41 |
+
#### `master_artworks_12m` (8,522,366 rows)
|
| 42 |
Contains all full-resolution master artwork uploads.
|
| 43 |
+
- `id`: Unique image ID (`<post_id>_slide_<number>`)
|
| 44 |
- `post_id`: Post ID this artwork belongs to
|
| 45 |
+
- `author_slug`: Username of the creator
|
| 46 |
- `slide_number`: Order in the multi-image gallery (1, 2, 3...)
|
| 47 |
+
- `title`: Post title
|
| 48 |
+
- `cdn_url`: Direct high-res CDN link
|
| 49 |
- `width`: Image width in pixels
|
| 50 |
- `height`: Image height in pixels
|
| 51 |
- `created_at`: Upload timestamp
|
| 52 |
|
| 53 |
#### `artworks` (3,431,475 rows)
|
| 54 |
Contains all posts and cover thumbnails.
|
| 55 |
+
- `post_id`: Unique post ID
|
| 56 |
+
- `author_slug`: Username of the creator
|
| 57 |
+
- `author_id`: User UUID
|
| 58 |
+
- `cdn_url`: Cover image / thumbnail link
|
|
|
|
| 59 |
- `created_at`: Creation timestamp
|
|
|
|
| 60 |
|
| 61 |
+
#### `post_metadata` (3,431,475 rows)
|
| 62 |
+
Contains all tags, software, descriptions, and audit statuses.
|
| 63 |
+
- `post_id`: Post ID
|
| 64 |
+
- `author_slug`: Username
|
| 65 |
+
- `author_name`: Display name
|
| 66 |
+
- `title`: Post title
|
| 67 |
+
- `content`: Description / lore text
|
| 68 |
+
- `softwares`: Software used (e.g. `["Blender", "Photoshop"]`)
|
| 69 |
+
- `tags`: Categories and tags (e.g. `["Illustration", "ConceptArt"]`)
|
|
|
|
|
|
|
|
|
|
| 70 |
- `status_code`: HTTP status (`200` = active, `404` = deleted post, `403` = private)
|
| 71 |
- `is_deleted`: `1` if post was removed, `0` if active
|
| 72 |
- `created_at`: Creation timestamp
|
| 73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
catalog.db
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ba8a3050a08ab946da0d3b9eab299c61a0a2666647c92208c0b5dcbaf6555d63
|
| 3 |
+
size 5072785408
|
master_fullres_8.5m_links.rar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7c15492a42118dac25bc070f4bc6d8ffee920dff486bf62a9e7829e2e7959dac
|
| 3 |
+
size 342777453
|
master_fullres_8.5m_links.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d34b3b7bf2d01af6a190c73ba00d61ae59e5e669fe33ae26661691b98442befb
|
| 3 |
+
size 1155400458
|
test_pr64.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
hello pr64
|
tool.py
CHANGED
|
@@ -13,20 +13,10 @@ import argparse
|
|
| 13 |
from urllib.parse import urlparse
|
| 14 |
from collections import Counter
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
if hasattr(sys.stdout, "reconfigure"):
|
| 18 |
-
try:
|
| 19 |
-
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
| 20 |
-
except Exception:
|
| 21 |
-
pass
|
| 22 |
-
|
| 23 |
-
# Dynamic discovery of catalog.db or catalog_anonymized.db (100% portable & anonymous)
|
| 24 |
DB_CANDIDATE_PATHS = [
|
| 25 |
-
"catalog_anonymized.db",
|
| 26 |
"catalog.db",
|
| 27 |
-
os.path.join(os.path.dirname(os.path.abspath(__file__)), "catalog_anonymized.db"),
|
| 28 |
os.path.join(os.path.dirname(os.path.abspath(__file__)), "catalog.db"),
|
| 29 |
-
"../catalog_anonymized.db",
|
| 30 |
"../catalog.db",
|
| 31 |
]
|
| 32 |
|
|
@@ -44,7 +34,7 @@ COMMON_PLACEHOLDERS = [
|
|
| 44 |
|
| 45 |
|
| 46 |
def find_database() -> str:
|
| 47 |
-
"""Auto-detects catalog
|
| 48 |
for path in DB_CANDIDATE_PATHS:
|
| 49 |
if os.path.exists(path) and os.path.getsize(path) > 1000000:
|
| 50 |
return path
|
|
@@ -52,13 +42,13 @@ def find_database() -> str:
|
|
| 52 |
|
| 53 |
|
| 54 |
def get_db_connection():
|
| 55 |
-
"""Connects to
|
| 56 |
db_path = find_database()
|
| 57 |
if not db_path:
|
| 58 |
print("\n" + "=" * 80)
|
| 59 |
-
print("❌ DATABASE NOT FOUND: '
|
| 60 |
print("=" * 80)
|
| 61 |
-
print("Please make sure
|
| 62 |
print(f"Current working directory: {os.getcwd()}")
|
| 63 |
print("=" * 80 + "\n")
|
| 64 |
sys.exit(1)
|
|
@@ -136,29 +126,6 @@ def explore_user(username_raw: str, is_overview: bool = False):
|
|
| 136 |
conn = get_db_connection()
|
| 137 |
cur = conn.cursor()
|
| 138 |
|
| 139 |
-
# Resolve author by slug or author_id UUID
|
| 140 |
-
cur.execute("""
|
| 141 |
-
SELECT author_slug, author_id FROM artworks
|
| 142 |
-
WHERE author_slug = ? COLLATE NOCASE OR author_id = ?
|
| 143 |
-
LIMIT 1;
|
| 144 |
-
""", (username, username))
|
| 145 |
-
author_row = cur.fetchone()
|
| 146 |
-
if author_row:
|
| 147 |
-
username = author_row["author_slug"]
|
| 148 |
-
author_id = author_row["author_id"]
|
| 149 |
-
else:
|
| 150 |
-
cur.execute("SELECT DISTINCT author_slug FROM master_artworks_12m WHERE author_slug = ? COLLATE NOCASE;", (username,))
|
| 151 |
-
found_slug = cur.fetchone()
|
| 152 |
-
if not found_slug:
|
| 153 |
-
print("\n" + "=" * 80)
|
| 154 |
-
print(f"❌ Artist '{username}' was not found in the database.")
|
| 155 |
-
print("Tip: Double-check the handle or author UUID.")
|
| 156 |
-
print("=" * 80 + "\n")
|
| 157 |
-
conn.close()
|
| 158 |
-
return
|
| 159 |
-
username = found_slug["author_slug"]
|
| 160 |
-
author_id = None
|
| 161 |
-
|
| 162 |
# 1. Fetch Posts from artworks table
|
| 163 |
cur.execute("""
|
| 164 |
SELECT post_id, cdn_url as cover_url, created_at
|
|
@@ -168,6 +135,17 @@ def explore_user(username_raw: str, is_overview: bool = False):
|
|
| 168 |
""", (username,))
|
| 169 |
posts = cur.fetchall()
|
| 170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
# 2. Fetch Master Artworks
|
| 172 |
cur.execute("""
|
| 173 |
SELECT post_id, slide_number, title, cdn_url, width, height, created_at
|
|
@@ -179,7 +157,7 @@ def explore_user(username_raw: str, is_overview: bool = False):
|
|
| 179 |
|
| 180 |
# 3. Fetch Post Metadata
|
| 181 |
cur.execute("""
|
| 182 |
-
SELECT post_id, author_name, title, content, softwares, tags,
|
| 183 |
FROM post_metadata
|
| 184 |
WHERE author_slug = ? COLLATE NOCASE;
|
| 185 |
""", (username,))
|
|
@@ -222,8 +200,6 @@ def explore_user(username_raw: str, is_overview: bool = False):
|
|
| 222 |
print("\n" + "=" * 80)
|
| 223 |
print(f"👤 ARTIST SUMMARY: {name_header}")
|
| 224 |
print("=" * 80)
|
| 225 |
-
if author_id:
|
| 226 |
-
print(f"🆔 Author UUID: {author_id}")
|
| 227 |
print(f"📊 Total Posts (Cover Thumbnails): {len(posts):,}")
|
| 228 |
print(f"🖼️ Total Master Artworks (Full-Res): {len(artworks):,}")
|
| 229 |
if top_software:
|
|
@@ -232,6 +208,7 @@ def explore_user(username_raw: str, is_overview: bool = False):
|
|
| 232 |
print(f"🏷️ Top Tags: {', '.join(top_tags)}")
|
| 233 |
if all_dates:
|
| 234 |
print(f"📅 Activity Span: {date_range}")
|
|
|
|
| 235 |
print("=" * 80)
|
| 236 |
|
| 237 |
if is_overview:
|
|
@@ -324,7 +301,7 @@ def explore_post(post_raw: str):
|
|
| 324 |
|
| 325 |
print("\n" + "=" * 80)
|
| 326 |
print(f"📌 POST ID: {post_id}")
|
| 327 |
-
print(f"👤 ARTIST: @{author}")
|
| 328 |
print(f"🎨 TITLE: {title}")
|
| 329 |
print(f"🔗 WEB LINK: https://cara.app/post/{post_id}")
|
| 330 |
|
|
@@ -339,10 +316,6 @@ def explore_post(post_raw: str):
|
|
| 339 |
print(f"💻 SOFTWARE: {softwares}")
|
| 340 |
if tags:
|
| 341 |
print(f"🏷️ TAGS: {tags}")
|
| 342 |
-
if meta["like_count"] is not None or meta["comment_count"] is not None:
|
| 343 |
-
likes = meta["like_count"] if meta["like_count"] is not None else 0
|
| 344 |
-
comments = meta["comment_count"] if meta["comment_count"] is not None else 0
|
| 345 |
-
print(f"❤️ ENGAGEMENT: {likes:,} likes | {comments:,} comments")
|
| 346 |
if meta["content"]:
|
| 347 |
print(f"\n📝 POST BODY:\n{meta['content'].strip()}")
|
| 348 |
except Exception:
|
|
@@ -397,7 +370,7 @@ def explore_artwork(art_raw: str):
|
|
| 397 |
print("=" * 80)
|
| 398 |
print(f"🖼️ Thumbnail: {cover_match['cdn_url']}")
|
| 399 |
print(f"📌 Post ID: {cover_match['post_id']}")
|
| 400 |
-
print(f"👤 Creator: @{cover_match['author_slug']}")
|
| 401 |
print(f"🔗 Direct Web: https://cara.app/post/{cover_match['post_id']}")
|
| 402 |
print("=" * 80 + "\n")
|
| 403 |
conn.close()
|
|
@@ -420,7 +393,7 @@ def explore_artwork(art_raw: str):
|
|
| 420 |
print(f"🖼️ Image Link: {match['cdn_url']}")
|
| 421 |
print(f"📐 Resolution: {match['width']}x{match['height']} (Slide {match['slide_number']})")
|
| 422 |
print(f"📌 Post ID: {match['post_id']}")
|
| 423 |
-
print(f"👤 Creator: @{match['author_slug']}")
|
| 424 |
print(f"🎨 Title: {match['title'] or 'Untitled'}")
|
| 425 |
print(f"📅 Upload Date: {match['created_at']}")
|
| 426 |
print(f"🔗 Direct Web: https://cara.app/post/{match['post_id']}")
|
|
|
|
| 13 |
from urllib.parse import urlparse
|
| 14 |
from collections import Counter
|
| 15 |
|
| 16 |
+
# Dynamic discovery of catalog.db (100% portable & anonymous)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
DB_CANDIDATE_PATHS = [
|
|
|
|
| 18 |
"catalog.db",
|
|
|
|
| 19 |
os.path.join(os.path.dirname(os.path.abspath(__file__)), "catalog.db"),
|
|
|
|
| 20 |
"../catalog.db",
|
| 21 |
]
|
| 22 |
|
|
|
|
| 34 |
|
| 35 |
|
| 36 |
def find_database() -> str:
|
| 37 |
+
"""Auto-detects catalog.db location dynamically."""
|
| 38 |
for path in DB_CANDIDATE_PATHS:
|
| 39 |
if os.path.exists(path) and os.path.getsize(path) > 1000000:
|
| 40 |
return path
|
|
|
|
| 42 |
|
| 43 |
|
| 44 |
def get_db_connection():
|
| 45 |
+
"""Connects to catalog.db with clean error guidance if missing."""
|
| 46 |
db_path = find_database()
|
| 47 |
if not db_path:
|
| 48 |
print("\n" + "=" * 80)
|
| 49 |
+
print("❌ DATABASE NOT FOUND: 'catalog.db'")
|
| 50 |
print("=" * 80)
|
| 51 |
+
print("Please make sure 'catalog.db' is located in the same folder as this script!")
|
| 52 |
print(f"Current working directory: {os.getcwd()}")
|
| 53 |
print("=" * 80 + "\n")
|
| 54 |
sys.exit(1)
|
|
|
|
| 126 |
conn = get_db_connection()
|
| 127 |
cur = conn.cursor()
|
| 128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
# 1. Fetch Posts from artworks table
|
| 130 |
cur.execute("""
|
| 131 |
SELECT post_id, cdn_url as cover_url, created_at
|
|
|
|
| 135 |
""", (username,))
|
| 136 |
posts = cur.fetchall()
|
| 137 |
|
| 138 |
+
if not posts:
|
| 139 |
+
cur.execute("SELECT DISTINCT author_slug FROM master_artworks_12m WHERE author_slug = ? COLLATE NOCASE;", (username,))
|
| 140 |
+
found_slug = cur.fetchone()
|
| 141 |
+
if not found_slug:
|
| 142 |
+
print("\n" + "=" * 80)
|
| 143 |
+
print(f"❌ Artist '@{username}' was not found in the database.")
|
| 144 |
+
print("Tip: Double-check the exact handle as it appears in the artist's Cara profile URL.")
|
| 145 |
+
print("=" * 80 + "\n")
|
| 146 |
+
conn.close()
|
| 147 |
+
return
|
| 148 |
+
|
| 149 |
# 2. Fetch Master Artworks
|
| 150 |
cur.execute("""
|
| 151 |
SELECT post_id, slide_number, title, cdn_url, width, height, created_at
|
|
|
|
| 157 |
|
| 158 |
# 3. Fetch Post Metadata
|
| 159 |
cur.execute("""
|
| 160 |
+
SELECT post_id, author_name, title, content, softwares, tags, created_at
|
| 161 |
FROM post_metadata
|
| 162 |
WHERE author_slug = ? COLLATE NOCASE;
|
| 163 |
""", (username,))
|
|
|
|
| 200 |
print("\n" + "=" * 80)
|
| 201 |
print(f"👤 ARTIST SUMMARY: {name_header}")
|
| 202 |
print("=" * 80)
|
|
|
|
|
|
|
| 203 |
print(f"📊 Total Posts (Cover Thumbnails): {len(posts):,}")
|
| 204 |
print(f"🖼️ Total Master Artworks (Full-Res): {len(artworks):,}")
|
| 205 |
if top_software:
|
|
|
|
| 208 |
print(f"🏷️ Top Tags: {', '.join(top_tags)}")
|
| 209 |
if all_dates:
|
| 210 |
print(f"📅 Activity Span: {date_range}")
|
| 211 |
+
print(f"🔗 Profile Link: https://cara.app/{username}")
|
| 212 |
print("=" * 80)
|
| 213 |
|
| 214 |
if is_overview:
|
|
|
|
| 301 |
|
| 302 |
print("\n" + "=" * 80)
|
| 303 |
print(f"📌 POST ID: {post_id}")
|
| 304 |
+
print(f"👤 ARTIST: @{author} (https://cara.app/{author})")
|
| 305 |
print(f"🎨 TITLE: {title}")
|
| 306 |
print(f"🔗 WEB LINK: https://cara.app/post/{post_id}")
|
| 307 |
|
|
|
|
| 316 |
print(f"💻 SOFTWARE: {softwares}")
|
| 317 |
if tags:
|
| 318 |
print(f"🏷️ TAGS: {tags}")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 319 |
if meta["content"]:
|
| 320 |
print(f"\n📝 POST BODY:\n{meta['content'].strip()}")
|
| 321 |
except Exception:
|
|
|
|
| 370 |
print("=" * 80)
|
| 371 |
print(f"🖼️ Thumbnail: {cover_match['cdn_url']}")
|
| 372 |
print(f"📌 Post ID: {cover_match['post_id']}")
|
| 373 |
+
print(f"👤 Creator: @{cover_match['author_slug']} (https://cara.app/{cover_match['author_slug']})")
|
| 374 |
print(f"🔗 Direct Web: https://cara.app/post/{cover_match['post_id']}")
|
| 375 |
print("=" * 80 + "\n")
|
| 376 |
conn.close()
|
|
|
|
| 393 |
print(f"🖼️ Image Link: {match['cdn_url']}")
|
| 394 |
print(f"📐 Resolution: {match['width']}x{match['height']} (Slide {match['slide_number']})")
|
| 395 |
print(f"📌 Post ID: {match['post_id']}")
|
| 396 |
+
print(f"👤 Creator: @{match['author_slug']} (https://cara.app/{match['author_slug']})")
|
| 397 |
print(f"🎨 Title: {match['title'] or 'Untitled'}")
|
| 398 |
print(f"📅 Upload Date: {match['created_at']}")
|
| 399 |
print(f"🔗 Direct Web: https://cara.app/post/{match['post_id']}")
|