Domain-Based Scraper System
Overview
The UPlanet MULTIPASS system includes an extensible framework for automatically executing domain-specific scrapers based on uploaded cookies. This allows users to share their authenticated sessions with their AI assistant, enabling personalized data extraction from various websites.
📖 For complete cookie management documentation, see COOKIE_SYSTEM.md
Architecture
Cookie Detection
When a user uploads a cookie via the /api/fileupload endpoint, the system:
Detects the cookie format (Netscape HTTP Cookie File)
Extracts the primary domain from the cookie
Saves it as a hidden file:
.DOMAIN.cookiein~/.zen/game/nostr/EMAIL/
Example:
YouTube cookies →
.youtube.com.cookieLeboncoin cookies →
.leboncoin.fr.cookie
Automatic Scraper Execution
During the daily MULTIPASS refresh cycle (NOSTRCARD.refresh.sh), the system:
Scans for all
.*.cookiefiles in each user's directoryFor each cookie found, extracts the domain name
Looks for a corresponding scraper script:
DOMAIN.shinAstroport.ONE/IA/If found, executes the scraper with the user's email and cookie file path
If not found, sends an email notification to the user
Naming Convention
Cookie Files:
Format:
.DOMAIN.cookie(hidden file)Location:
~/.zen/game/nostr/EMAIL/Examples:
.youtube.com.cookie.leboncoin.fr.cookie.twitter.com.cookie
Scraper Scripts:
Format:
DOMAIN.shLocation:
Astroport.ONE/IA/Examples:
youtube.com.shleboncoin.fr.shtwitter.com.sh
Python Backend (optional):
Format:
scraper_DOMAIN.pyLocation:
Astroport.ONE/IA/Examples:
scraper_youtube.pyscraper_leboncoin.py
Creating a New Scraper
1. Cookie File
Users upload their cookies via the UPlanet interface at https://u.copylaradio.com/cookie. The system automatically:
Detects the domain
Renames the file to
.DOMAIN.cookieStores it in the user's MULTIPASS directory
2. Bash Script (DOMAIN.sh)
Create a bash script that:
Accepts
PLAYER_EMAILandCOOKIE_FILE_PATHas argumentsReads user-specific configuration (GPS, preferences, etc.)
Calls the Python scraper or executes the logic directly
Saves results to the user's uDRIVE
Template:
3. Python Scraper (optional)
If the logic is complex, create a Python script:
4. Make Executable
Existing Scrapers
YouTube (youtube.com.sh)
Purpose: Synchronizes liked videos from YouTube
Features:
Fetches recent liked videos using
yt-dlpDownloads videos to
uDRIVE/Music/oruDRIVE/Videos/Processes metadata and generates AI summaries
Tracks last synchronization to avoid duplicates
Configuration:
Cookie:
.youtube.com.cookieScript:
youtube.com.shBackend: Uses
yt-dlpandprocess_youtube.sh
Leboncoin (leboncoin.fr.sh)
Purpose: Searches for geolocated classified ads
Features:
Uses user's GPS coordinates for search location
Default search: "donne" (free items) within 10km
Customizable via
.leboncoin_configfileSaves results to
leboncoin_results/
Configuration:
Cookie:
.leboncoin.fr.cookieScript:
leboncoin.fr.shBackend:
scraper_leboncoin.py
Custom Search Parameters:
Create ~/.zen/game/nostr/EMAIL/.leboncoin_config:
User Notifications
When a user uploads a cookie for a domain without a scraper, they receive an email:
Subject: "Cookie détecté: DOMAIN - Service à créer"
Content:
Notification that the cookie was detected
Explanation that no automated service exists yet
Instructions to contact the Captain (system administrator)
List of existing services (YouTube, Leboncoin)
This notification is sent once per domain and stored in .DOMAIN_notified.
Smart Contracts
The system is designed to be extended via "smart contracts" - individual scraper scripts added to the official codebase after validation by the Captain.
Process:
User uploads cookie for new domain
User receives notification email
User contacts Captain to describe their needs
Captain (or developer) creates custom scraper
Script is added to
Astroport.ONE/IA/Next day, scraper runs automatically for that user
Security Considerations
Cookie Privacy: Cookies are stored as hidden files in user's private MULTIPASS directory
Access Control: Only the user and their AI assistant can access the cookies
Encryption: MULTIPASS directories are protected by NOSTR authentication
No Cookie Sharing: Cookies are never shared between users
Extensibility
The system is designed for easy extension:
No Code Changes Required: Just add
DOMAIN.shtoIA/directoryAutomatic Detection:
NOSTRCARD.refresh.shscans for all cookiesPer-User Execution: Each scraper runs independently per user
Background Execution: Scrapers run in background to avoid blocking
Logging: Dedicated log file per domain per user
Testing
To test a new scraper:
Upload cookie via UPlanet interface
Create
DOMAIN.shscript inAstroport.ONE/IA/Make it executable:
chmod +x DOMAIN.shRun manually:
./DOMAIN.sh user@email.com ~/.zen/game/nostr/user@email.com/.DOMAIN.cookieCheck logs:
~/.zen/tmp/DOMAIN_sync_user@email.com.logWait for next daily refresh, or trigger manually with
NOSTRCARD.refresh.sh
Troubleshooting
Scraper not running:
Check if cookie file exists:
ls -la ~/.zen/game/nostr/EMAIL/.*.cookieCheck if script exists:
ls -la Astroport.ONE/IA/DOMAIN.shCheck if script is executable:
ls -l Astroport.ONE/IA/DOMAIN.shCheck logs:
~/.zen/tmp/MULTIPASS.refresh.log
Cookie expired:
Re-export cookie from website (in private browser window)
Re-upload via UPlanet interface
Old cookie will be replaced automatically
Scraper fails:
Check domain-specific log:
~/.zen/tmp/DOMAIN_sync_EMAIL.logVerify cookie format (should be Netscape HTTP Cookie File)
Test Python scraper independently
Future Enhancements
Web-based scraper configuration interface
AI-powered data extraction without manual scripting
Multi-domain cookie support in a single file
Real-time scraping triggers (not just daily)
User-defined scheduling (hourly, weekly, etc.)
Version: 0.1 Last Updated: 2025-11-05 Author: Fred (support@qo-op.com) License: AGPL-3.0
Last updated