- 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:
@@ -196,6 +196,10 @@ render_head('Add Video — Admin', '
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="16"/><line x1="8" y1="12" x2="16" y2="12"/></svg>
|
||||
Add Video
|
||||
</a>
|
||||
<a href="youtube_import.php">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22.54 6.42a2.78 2.78 0 00-1.95-2C18.88 4 12 4 12 4s-6.88 0-8.59.46a2.78 2.78 0 00-1.95 2A29 29 0 001 12a29 29 0 00.46 5.58 2.78 2.78 0 001.95 2C5.12 20 12 20 12 20s6.88 0 8.59-.46a2.78 2.78 0 001.95-2A29 29 0 0023 12a29 29 0 00-.46-5.58z"/><polygon points="10,15 15,12 10,9"/></svg>
|
||||
YouTube Importer
|
||||
</a>
|
||||
<hr class="nav-divider">
|
||||
<a href="settings.php">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.07 4.93l-1.41 1.41M4.93 4.93l1.41 1.41M19.07 19.07l-1.41-1.41M4.93 19.07l1.41-1.41M12 2v2M12 20v2M2 12h2M20 12h2"/></svg>
|
||||
|
||||
Reference in New Issue
Block a user