- Implemented a YouTube channel importer.

Added [admin/youtube_import.php (line 
1)](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/youtube_import.php:1), 
which:
Accepts a channel URL, @handle, or UC... channel ID.
Scrapes the channel /videos page.
Extracts videos from ytInitialData.
Shows a preview with checkboxes.
Imports selected videos into videos and video_sources.
Stores each video as a canonical YouTube watch URL with mime_type = 
text/html, so the existing YouTube embed playback path handles it 
correctly.
Downloads scraped thumbnails into media/thumbs/ when possible.
Skips duplicates by matching existing remote YouTube URLs.
Also wired it into the admin navigation in [admin/index.php (line 
172)](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/index.php:172), 
[admin/add.php (line 
199)](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/add.php:199), 
[admin/edit.php (line 
267)](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/edit.php:267), 
and [admin/settings.php (line 
109)](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/settings.php:109). 
Updated [README.md (line 
81)](/Users/tyemeclifford/Documents/GH/mediaplayer/README.md:81) with 
usage notes.
This commit is contained in:
Ty Clifford
2026-06-24 12:49:22 -04:00
parent 75d5d39cda
commit 42725c0c03
6 changed files with 523 additions and 0 deletions
+5
View File
@@ -43,6 +43,7 @@ Styled to match the existing `gate.php` / `index.php` dark theme exactly.
│ ├── index.php ← Video list with search + pagination
│ ├── add.php ← Add new video with uploaded or external URL sources
│ ├── edit.php ← Edit video metadata + manage local/remote sources
│ ├── youtube_import.php ← Scrape a YouTube channel and import videos
│ ├── settings.php ← Site settings, per-page count, password
│ ├── login.php ← Admin login
│ ├── logout.php ← Session destroy + redirect
@@ -75,6 +76,10 @@ Styled to match the existing `gate.php` / `index.php` dark theme exactly.
External URLs must use `http://` or `https://`. Uploaded files and remote URLs can be mixed on the same video. Recognized provider URLs such as YouTube, Vimeo, Dailymotion, Twitch, Facebook, TikTok, Instagram, X/Twitter, SoundCloud, Spotify, Google Drive, Wistia, Streamable, and Loom render through their embed players.
### Importing YouTube Channels
Use **Admin → YouTube Importer** to paste a YouTube channel URL, `@handle`, or `UC...` channel ID. The importer scrapes the channel's `/videos` page, extracts video data from `ytInitialData`, previews the results, and imports selected videos as remote YouTube embed sources. Duplicate YouTube watch URLs are skipped.
### Public Search
The full catalogue page includes a public search for published videos only. Search matches video title, description, and slug; draft videos remain hidden.