توثيق ComusThumbz
تسجيل دخول المسؤول

Video Bulk Import

Overview

The Video Bulk Import page allows administrators to import multiple video entries at once from CSV-formatted data. This powerful tool supports three import modes (download, hotlink, embed), comprehensive field mapping through saveable "playlists," automatic model and sponsor creation, category assignment (up to 10 per video), random rating/view assignment, scheduled publishing, duplicate detection, and asynchronous batch processing with real-time progress tracking.

[Screenshot: video-bulk-import-main-form]


Getting to This Page

  1. Log in to the admin panel at ct/admin/ctlogin.php
  2. In the left sidebar, click Videos
  3. Click Bulk Import or navigate directly to ct/admin/videobulkimport.php

 

Note:
This page is designed for importing video metadata from external sources, sponsor feeds, or CSV exports. All data is previewed before final import.

 


System Requirements

 

Configuration Required:
This page requires the following system dependencies to function properly.

 

PHP Requirements

Requirement Minimum Recommended Notes
PHP Version 7.4 8.2+ Uses null coalescing operators
memorylimit 256M 512M For large CSV files
maxexecutiontime 3000 3000 Set internally via iniset
defaultsockettimeout 30 30 Set internally for downloads
maxinputvars 1000 5000 For large field mapping forms
postmaxsize 10M 50M For pasting large CSV data

Required PHP Extensions

Extension Required Purpose
mysqli Yes Database connectivity
session Yes Data passing between steps
curl Yes Video/thumbnail downloading
json Yes Progress file handling, playlist storage
fileinfo Recommended MIME type detection
gd Recommended Thumbnail processing

Required PHP Functions

 

Warning:
These functions must NOT be in disablefunctions in php.ini:

 

Function Required For Notes
fileputcontents() Progress tracking, logging Core functionality
filegetcontents() Reading progress files, CSV files Core functionality
rename() Atomic file writes For progress updates
curlinit() Video/thumbnail downloading Core functionality
curlexec() Executing downloads Core functionality
mkdir() Creating temp/logs directories First-time setup
touch() Creating log files First-time setup
ignoreuserabort() Background processing Prevents timeout
settimelimit() Extended processing Large imports

Folder Permissions

Folder Path Permission Owner Purpose
ct/admin/temp/ 755 www-data Progress tracking files
ct/logs/ 755 www-data Import logging
ct/uploads/videos/ 755 www-data Downloaded videos
ct/uploads/thumbnails/ 755 www-data Downloaded thumbnails

Server Requirements

Component Requirement
Web Server Apache 2.4+ with modrewrite OR Nginx
Database MySQL 5.7+ / MariaDB 10.3+
cURL Required for downloads

Installation Requirements

Folders Required

Folder Path Permission Created By Notes
ct/admin/temp/ 755 Script (auto-create) Progress tracking files
ct/logs/ 755 Install Script Import logging
ct/uploads/videos/ 755 Install Script Video storage
ct/uploads/thumbnails/ 755 Install Script Thumbnail storage

External Dependencies

Dependency Type Required Version Notes
Bootstrap 5.3 CDN Yes 5.3.0+ UI framework
Font Awesome 6 CDN Yes 6.5.1+ Icons

Page Layout

Header Section

The page header displays:

  • Title: "Video Bulk Import" with a video icon
  • Breadcrumb: Dashboard > Videos > Bulk Import

 

[Screenshot: video-bulk-import-header]

Playlist Section

The playlist section allows you to save and load field mapping configurations:

Element Description
Load Existing Playlist Dropdown to select and auto-load saved configurations
Playlist Name Input field for naming new playlists
New Button Reset form for new playlist
Save Button Save current mappings to database
Delete Button Remove selected playlist

[Screenshot: video-bulk-import-playlist-section]

Field Mapping Section

The dynamic field mapping section lets you configure how CSV columns map to database fields:

Element Description
Column Number Sequential column identifier (1, 2, 3...)
Field Select Dropdown to choose which database field this column maps to
Field Description Contextual help showing field purpose and format
Add Column Add another column mapping (max 30)
Remove Column Remove a column mapping row

[Screenshot: video-bulk-import-field-mapping]

Available Field Mappings

# Field Name Description
0 Video URL Full video URL or file path (http(s)://)
1 Title Video title (required)
2 Description Video description
3 Tags Tags separated by semicolons
4 Categories Categories separated by commas
5 Models Model names separated by commas (auto-created)
6 Studio Studio/production company
7 Director Director name
8 Producer Producer name
9 Duration (seconds) Duration in seconds (integer)
10 Content Rating Content rating (XXX, R, NC-17)
11 Access Type Access type (free, premium, members)
12 Embedded Code Embedded iframe code (for embed mode)
13 Thumbnail URL Thumbnail URL (required for embedded)
14 Release Year Release/production year (YYYY)
15 Series Name Series name (if part of series)
16 Episode Number Episode number (integer)
17 Season Number Season number (integer)
18 Featured (0/1) Featured flag
19 Age Verification Age verification required (0/1)
20 Meta Title SEO meta title
21 Meta Description SEO meta description
22 Meta Keywords SEO meta keywords
23 Resolution Width Video width in pixels
24 Resolution Height Video height in pixels
25 FPS Frames per second (decimal)
26 Bitrate Bitrate in kbps
27 Sponsor Name Sponsor name (auto-created if not exists)
28 SubSponsor Name Sub-sponsor name (auto-created)
29 Schedule Date Schedule publish date (YYYY-MM-DD HH:mm:ss)

Import Methods (3 Modes)

 

Warning:
Understanding import modes is critical for proper video setup. Choose the right mode based on your content hosting strategy.

 

Mode 1: Download & Keep Video

How it works:

  • Downloads video file from URL to local storage
  • Full video processing (thumbnails, conversions)
  • Keeps original file for local playback
  • Status: processing (videoprocessor.php handles the rest)

 

Best for:

  • Videos you want to host yourself
  • Full player control (overlays, watermarks, ads)
  • Building local video library

 

How it works:

  • Downloads video temporarily
  • Generates thumbnails and preview clips
  • Deletes original video file
  • Stores hotlink URL for playback
  • Status: processing

 

Best for:

  • Embedding external videos with your thumbnails
  • Saving storage space
  • Videos where you need thumbnail control but not file hosting

 

Mode 3: Embed (iframe code)

How it works:

  • Stores iframe embed code directly
  • Requires thumbnail URL in CSV
  • No video file downloaded
  • Status: pending (thumbnail verification)

 

Best for:

  • YouTube, Vimeo, XVideos, etc. embeds
  • Quick import without processing
  • External hosting with minimal storage

 

 

Note:
Player Feature Note: Embedded videos (Mode 3) do NOT support player features like custom overlays, watermarks, ads, or playlists. Use Download or Hotlink modes for full player control.

 


Import Options

Category Assignment

Feature Description
Up to 10 Categories Assign multiple categories per video
First = Primary First category becomes primary display category
Force Categories Override CSV data with specified categories
Dynamic Selector Add/remove category dropdowns (max 10)

Model Handling

Option Description
Normal (from CSV) Use model names from CSV column
No Model Don't assign any model
Force Model Override with specific model for all videos
Auto-detect Scan title/description for existing model names
Tip: Models are automatically created if they don't exist in the database. No need to pre-create model records.

Sponsor Handling

Option Description
Force Sponsor Override CSV with specific sponsor
Force Sub-Sponsor Set sub-sponsor for all videos
Auto-creation Sponsors/sub-sponsors created automatically if not found

Random Assignment

Option Description
Random Rating Assign random rating between min-max (1-10 scale)
Random Views Assign random view count between min-max
Note: Random values are stored as "override" values. Real engagement stats track separately from these seeded values.

Scheduling

Option Description
Random Schedule Enable date randomization
Schedule Date A Start of random date range
Schedule Date B End of random date range

Duplicate Detection

Option Description
Check Duplicates Enable duplicate checking by title
Within Category Only check duplicates within same category

Step-by-Step Usage

Task 1: Basic Video Import (Download Mode)

 

Note:
This workflow imports videos with download for full player control.

 

Steps:

  1. Navigate to Admin Panel → Videos → Bulk Import
  1. Configure field mappings:
  • Column 1: Select "Video URL"
  • Column 2: Select "Title"
  • Column 3: Select "Description"
  • Column 4: Select "Tags"
  • Column 5: Select "Categories"
  • Click Add Column for additional fields
  1. Set Import Method to "1. Download & Keep Video"
  1. Set Status to "Processing" (for automatic processing)
  1. Paste your CSV data:
https://example.com/video1.mp4,Amazing Video,Great description,tag1;tag2,Amateurs
   https://example.com/video2.mp4,Another Video,More description,tag3;tag4,Brunettes
  1. Configure options:
  • Set random rating range: 1-10
  • Set random views range: 1000-12000
  • Check Check Duplicates if needed
  1. Click Preview Import
  1. Review the preview table
  1. Click Confirm & Start Import
  1. Monitor real-time progress

Result: Videos are added with status "processing". The videoprocessor.php cron will handle downloading and processing.

[Screenshot: video-bulk-import-download-progress]

Task 2: Embedded Video Import

Steps:

  1. Configure field mappings:
  • Column 1: Select "Title"
  • Column 2: Select "Embedded Code"
  • Column 3: Select "Thumbnail URL"
  • Column 4: Select "Categories"
  1. Set Import Method to "3. Embed (iframe code)"
  1. Paste CSV data with embed codes:
My Video Title,<iframe src="https://player.example.com/embed/12345" width="640" height="360"></iframe>,https://example.com/thumb.jpg,Category Name
  1. Preview and import

Result: Videos are added with embed code. Thumbnail URL is stored for display.

Task 3: Multi-Category Import with Sponsor

Steps:

  1. In Force Categories section, click Add Category multiple times
  1. Select up to 10 categories (first is primary)
  1. Select a Force Sponsor from dropdown (or let it auto-create)
  1. Enter Force Sub-Sponsor if needed
  1. Import data

Result: All videos assigned to multiple categories with sponsor tracking.

Task 4: Scheduled Release Import

Steps:

  1. Check Random Schedule Between Dates
  1. Set Schedule Date A (start): e.g., 2025-01-01 00:00
  1. Set Schedule Date B (end): e.g., 2025-12-31 23:59
  1. Import data

Result: Each video gets a random publishdate within the specified range.


Progress Interface

During import, the progress interface displays:

Progress Bar

  • Animated striped bar showing percentage complete
  • Percentage text (e.g., "45%")

Status Line

  • Shows "Processed X of Y" count
  • Indicates "Complete" when finished

Log Panel

  • Scrollable list of import events
  • Color-coded messages

Statistics Cards

Card Color Description
Added Green Total successfully imported
Downloaded Blue Videos queued for download
Hotlinked Cyan Videos using hotlink mode
Embedded Gray Videos using embed mode
Duplicates Yellow Skipped duplicate entries
Failed Red Entries that failed to import

Navigation Buttons

  • Admin Home: Return to dashboard
  • New Import: Start a fresh import

[Screenshot: video-bulk-import-progress-stats]


Error Messages & Troubleshooting

Common Errors

Error Message Cause Solution
"Import data not found" Preview files missing Go back and run Preview step again
"Cannot create temp dir" Permission issue Ensure ct/admin/temp/ is writable (755)
"Missing title" Required field empty Every row must have a title
"Missing video URL" URL column empty (non-embed mode) Add video URL or use embed mode
"Embedded videos require thumbnailurl" Thumbnail missing Add thumbnail URL for embed mode
"Duplicate title" Dupe detection triggered Entry exists; disable check or skip
"Duplicate within 'Category'" Category-specific dupe Entry exists in that category
"DB prepare error" SQL syntax issue Check field values, special characters
"Playlist already exists" Duplicate playlist name Choose a different name

Troubleshooting

Problem: Import stalls at 0%
Solution:

  • Check browser console for JavaScript errors
  • Verify ct/admin/temp/ folder exists and is writable
  • Check ct/logs/videobulkimport.log for PHP errors

 

Problem: Videos stuck in "processing" status
Solution:

  • Verify videoprocessor.php cron is running
  • Check ct/logs/videoprocessor/ for errors
  • Ensure FFmpeg is installed and accessible

 

Problem: Models/sponsors not linking
Solution:

  • Verify column is mapped correctly (Models = field #5, Sponsor = field #27)
  • Check log for auto-creation messages
  • Models should appear in tblModels after import

 

Problem: Categories not assigning
Solution:

  • Ensure category names match exactly (case-sensitive)
  • Check if categories exist in tblCategories with hide=0
  • First category becomes primary (isprimary=1)

 


  • Video Review (ct/admin/video.admin.php) - Manage imported videos
  • Video Processor - Cron job that processes downloaded videos
  • Models (ct/admin/models.php) - Manage auto-created models
  • Sponsors (ct/admin/sponsors.php) - Manage auto-created sponsors
  • Categories (ct/admin/categories.php) - Manage category list

Tips & Best Practices

 

Tip:
Use playlists for repeat imports: If you regularly import from the same sponsor feed, save a playlist with all mappings and options configured.

 

 

Tip:
Test with small batches first: Before importing 1000+ videos, test with 5-10 rows to verify field mappings work correctly.

 

 

Warning:
Embedded videos lack player features: If you need watermarks, overlays, or custom ads, use Download or Hotlink mode instead of Embed.

 

 

Tip:
Use random scheduling for drip content: Set a date range to automatically spread video releases over weeks or months.

 

 

Tip:
Auto-detect models when possible: Enable model auto-detection to automatically link videos to existing models mentioned in titles.

 

 

Note:
Processing happens via cron: Videos with status "processing" are handled by video
processor.php. Ensure this cron is running.

 


Translatable Strings

The following text elements should be added to backend translations:

Key Default Text
videobulkimport Video Bulk Import
fieldmappingplaylists Field Mapping Playlists
loadexistingplaylist Load Existing Playlist
playlistname Playlist Name
fieldmappingconfig Field Mapping Configuration
columnsmapped Columns mapped
addcolumn Add Column
importoptions Import Options
importmethod Import Method
downloadkeep Download & Keep Video
hotlinkprocess Hotlink + Process (thumbnails)
embediframe Embed (iframe code)
forcecategories Force Categories
forcemodel Force Model
forcesponsor Force Sponsor
forcesubsponsor Force Sub-Sponsor
randomratingrange Random Rating Range
randomviewsrange Random Views Range
randomschedule Random Schedule Between Dates
scheduledatestart Schedule Date A (start)
scheduledateend Schedule Date B (end)
checkduplicates Check for duplicates
importdata Import Data
videodata Video Data (one entry per line)
delimiter Delimiter
csvfilepath Or Use CSV File (server path)
previewimport Preview Import
confirmstartimport Confirm & Start Import
processingimport Processing Video Import
donotclose Please do NOT close this window until complete
videosadded Added
videosdownloaded Downloaded
videoshotlinked Hotlinked
videosembedded Embedded
duplicatesskipped Duplicates
failed Failed
adminhome Admin Home
newimport New Import
playlistsaved Playlist saved
playlistloaded Loaded playlist
playlistdeleted Deleted playlist
importcomplete Import complete
autodetectmodels Auto-detect models from title/description
embednote Player features not available for embedded videos

Changelog

Date Version Changes
2026-01-01 1.0 Initial guide created