-
Notifications
You must be signed in to change notification settings - Fork 0
Related Video Recommendation System
Jackaopen edited this page Mar 24, 2026
·
1 revision
This module enhances JaTubePlayer with a related video recommendation system based on recently played tags and channels. It utilizes yt_dlp and threading to fetch data efficiently.
-
Tag & Channel Memory System
- Stores up to 15 recent search tags and channel URLs.
- Maintains these in
recent_tag.jsonandrecent_channel_url.json.
-
Recommendation Engine
- Fetches related videos from:
- Past search tags (via YouTube search)
- Channel upload lists (via their channel ID)
- Fetches related videos from:
-
Parallelized Fetching
- Uses
ThreadPoolExecutorfor concurrent data fetching. - Separate threads for tag-based search and channel video lists.
- Uses
- Updates the tag and channel memory files.
- Ensures unique entries and limits to 15 items.
- Uses
ytsearch10:with yt_dlp to fetch flat video metadata from a query.
- Retrieves latest videos from a channel's upload playlist.
- Combines the above to return:
-
title_output,url_output,channel_output,thumbnail
-
- Returns
Noneif nothing valid is retrieved.
- Initializes recent tag and channel files with example values.
- Safe to call at startup for fresh config.
| File Name | Content Type |
|---|---|
recent_tag.json |
List of recent tags |
recent_channel_url.json |
List of channel URLs |
def _dump(internal_dir, filename, content)- Writes JSON data to the target directory using
indent=4.
- The system avoids duplicate entries.
- Threading prevents UI blocking and accelerates response.
- The module assumes
yt_dlpis correctly initialized and functional.