4.1 KiB
4.1 KiB
Instagram Repost Detection - Quick Start Guide
🎉 Status: READY FOR TESTING
The Instagram repost detection feature has been safely implemented and is ready for testing. The feature is DISABLED by default - your existing downloads will work exactly as before.
⚡ Quick Enable (When Ready to Test)
Option 1: Via Web UI (Recommended)
- Open http://localhost:8000/configuration
- Scroll to "Instagram Repost Detection" section
- Toggle "Enabled" to ON
- Click "Save Configuration"
Option 2: Via Command Line
sqlite3 /opt/media-downloader/data/backup_cache.db \
"UPDATE settings SET value = json_set(value, '$.enabled', true) WHERE key = 'repost_detection';"
✅ What It Does
When enabled, the system will:
- Detect Instagram story reposts using OCR
- Download original content from the source user via ImgInn
- Match repost to original using perceptual hashing
- Replace low-quality repost with high-quality original
- Cleanup temporary files automatically
- Track all replacements in database
🧪 Test with Real Example
You already have a test file ready:
python3 tests/test_repost_detection_manual.py \
"/media/d$/OneDrive - LIComputerGuy/Celebrities/Eva Longoria/4. Media/social media/instagram/stories/evalongoria_20251109_154548_story6.mp4" \
"evalongoria" \
--live
Expected result: Detects @globalgiftfoundation, downloads originals, finds match, replaces file.
📊 Monitor Activity
Check if enabled:
sqlite3 /opt/media-downloader/data/backup_cache.db \
"SELECT json_extract(value, '$.enabled') FROM settings WHERE key = 'repost_detection';"
Watch logs:
tail -f /opt/media-downloader/logs/*.log | grep -i repost
View replacements:
sqlite3 /opt/media-downloader/data/backup_cache.db \
"SELECT * FROM repost_replacements ORDER BY detected_at DESC LIMIT 10;"
🔒 Safety Features
- ✅ Disabled by default - zero impact on existing functionality
- ✅ Can be enabled/disabled instantly (no restart needed)
- ✅ If detection fails, original file is kept
- ✅ Backward compatible - all existing code unchanged
- ✅ Full error handling - won't break downloads
📚 Documentation
- Full Design:
docs/instagram_repost_detection_design.md - Test Results:
docs/repost_detection_test_results.md - Testing Guide:
docs/repost_detection_testing_guide.md - Implementation Summary:
docs/REPOST_DETECTION_IMPLEMENTATION_SUMMARY.md
🚀 Recommended Testing Plan
- Day 1: Verify feature is disabled, normal downloads work
- Day 2: Enable feature, test with example file
- Day 3-4: Monitor live downloads, check logs
- Day 5-7: Review replacements, tune settings
- Week 2+: Full production use
⚙️ Configuration Options
All configurable via Web UI:
- Hash Distance Threshold: How similar images must be (default: 10)
- Fetch Cache Duration: How long to cache downloads (default: 12 hours)
- Max Posts Age: How far back to check posts (default: 24 hours)
- Cleanup Temp Files: Auto-delete temp downloads (default: ON)
🆘 Quick Disable
If anything goes wrong, disable instantly:
# Via SQL:
sqlite3 /opt/media-downloader/data/backup_cache.db \
"UPDATE settings SET value = json_set(value, '$.enabled', false) WHERE key = 'repost_detection';"
# Via UI:
# Configuration page → Toggle OFF → Save
✨ What's New
Files Created:
modules/instagram_repost_detector.py- Core detection logictests/test_instagram_repost_detector.py- Unit teststests/test_repost_detection_manual.py- Manual testing- 4 documentation files in
docs/
Files Modified:
modules/imginn_module.py- Added skip_database parametermodules/move_module.py- Added detection hooksweb/frontend/src/pages/Configuration.tsx- Added UI controls- Frontend rebuilt and ready
Database:
- Settings entry added (enabled: false)
- Two new tables created on first use
Everything is ready! The feature is safe to deploy and test at your convenience.
Start testing: docs/repost_detection_testing_guide.md