Major rewrite of threads/threads_client.py based on official Meta Threads API docs:
1. Threads Profiles API - get_user_profile() with full fields
2. Threads Media API - updated get_user_threads(), get_thread_by_id() with complete fields
3. Threads Reply Management - get_conversation() for full tree, manage_reply() for hide/unhide
4. Threads Publishing API - create_container(), publish_thread(), create_and_publish()
5. Threads Insights API - get_thread_insights(), get_user_insights(), get_thread_engagement()
6. Rate Limiting - get_publishing_limit(), can_publish()
7. Pagination - _get_paginated() helper with cursor-based pagination
8. POST support - _post() method for write operations
Also:
- Updated check_token.py to use full profile fields
- Added [threads.publishing] config section
- Added use_conversation and use_insights config options
- Optimized thread selection with engagement-based ranking
- Use conversation endpoint instead of just replies for better data
Agent-Logs-Url: https://github.com/thaitien280401-stack/RedditVideoMakerBot/sessions/c01dbc92-66f9-4a1f-bf83-7f0a75dd9968
Co-authored-by: thaitien280401-stack <271128961+thaitien280401-stack@users.noreply.github.com>
Add threads/google_trends.py module that:
- Fetches trending keywords from Google Trends RSS feed (geo=VN)
- Searches Threads posts by keyword using Playwright
- Returns matched thread posts for video creation
Update threads/threads_client.py:
- Add _get_google_trends_content() as new content source
- Add Google Trends as fallback: trending → google_trends → user
- Add Google Trends fallback when user threads also fails
Update config template with "google_trends" source option.
Agent-Logs-Url: https://github.com/thaitien280401-stack/RedditVideoMakerBot/sessions/b3d8248e-4f90-4f82-baef-11a251967a3b
Co-authored-by: thaitien280401-stack <271128961+thaitien280401-stack@users.noreply.github.com>
- Add ThreadsAPIError exception class for clear error typing
- Add validate_token() method to check token via /me endpoint before fetching
- Add automatic token refresh attempt when validation fails
- Add retry logic with backoff for transient connection/timeout failures
- Add API error body detection (Meta API can return 200 with error in body)
- Add request timeout (30s) to prevent hanging
- Fix keyword filtering to fall back to unfiltered list when all are filtered out
- Add detailed diagnostic messages with user_id, permission hints, and URLs
- Handle ThreadsAPIError separately in main.py for targeted troubleshooting guidance
- Remove unused Authorization header (Threads API uses access_token query param)
Agent-Logs-Url: https://github.com/thaitien280401-stack/RedditVideoMakerBot/sessions/0fff9f19-a7aa-44c2-a703-9e5a7ec6d880
Co-authored-by: thaitien280401-stack <271128961+thaitien280401-stack@users.noreply.github.com>
- Changed default cron from every 6h to every 3h (8 videos/day)
- Added utils/title_history.py: tracks used titles in JSON
- threads_client.py: skips threads with already-used titles
- scheduler/pipeline.py: saves title after successful video creation
- main.py: saves title in manual mode too
- Updated config template with new scheduler defaults
Agent-Logs-Url: https://github.com/thaitien280401-stack/RedditVideoMakerBot/sessions/17c7c41c-cf86-4279-88b8-01cba23ee763
Co-authored-by: thaitien280401-stack <271128961+thaitien280401-stack@users.noreply.github.com>