Spaces:
Sleeping
Sleeping
Download scratch/test-pexels.js from Atdevindotcom/youtube-auto-bot: direct link, hf CLI and curl.
- Browser
- Download file 815 Bytes
-
https://huggingface.co/spaces/Atdevindotcom/youtube-auto-bot/resolve/main/scratch/test-pexels.js
- Command line
-
hf download hf://spaces/Atdevindotcom/youtube-auto-bot/scratch/test-pexels.js
-
curl -L -o test-pexels.js https://huggingface.co/spaces/Atdevindotcom/youtube-auto-bot/resolve/main/scratch/test-pexels.js
815 Bytes
| const path = require('path'); | |
| require('dotenv').config({ path: path.join(__dirname, '..', '.env') }); | |
| const pexels = require('../utils/pexels-service'); | |
| async function test() { | |
| console.log('🚀 Testing Pexels Stock Video Search...'); | |
| const query = 'forest'; | |
| console.log(`🔍 Searching for: ${query}`); | |
| try { | |
| const link = await pexels.searchVideo(query); | |
| if (link) { | |
| console.log('✅ Found Video Link:', link); | |
| const outputPath = path.join(__dirname, 'test_pexels.mp4'); | |
| console.log('📥 Downloading...'); | |
| await pexels.downloadVideo(link, outputPath); | |
| console.log('✅ Download Complete:', outputPath); | |
| } else { | |
| console.log('❌ No video found.'); | |
| } | |
| } catch (error) { | |
| console.error('❌ Test Failed:', error.message); | |
| } | |
| } | |
| test(); | |