Use YouTube videos from local JSON

This commit is contained in:
Sam Carlton 2022-06-06 17:36:16 -05:00
parent 69eefc0a34
commit ea6f8d480c

View file

@ -1,4 +1,4 @@
import fs from 'fs-extra'
import axios from 'axios' import axios from 'axios'
import { PromisePool } from '@supercharge/promise-pool' import { PromisePool } from '@supercharge/promise-pool'
@ -7,6 +7,7 @@ import { byTimeThenNull } from './sort-list.js'
import { getVideoEndpoint } from './app-derived.js' import { getVideoEndpoint } from './app-derived.js'
import parseDate from './parse-date' import parseDate from './parse-date'
import { makeSlug } from './slug.js' import { makeSlug } from './slug.js'
import { youtubeVideoPath } from '~/helpers/api/youtube/build.js'
const inTimestamps = ( name, video ) => { const inTimestamps = ( name, video ) => {
@ -184,12 +185,12 @@ async function handleFetchedVideo ( fetchedVideo, videoId, applist ) {
export default async function ( applist ) { export default async function ( applist ) {
const videosJsonUrl = process.env.VIDEO_SOURCE || `${process.env.VFUNCTIONS_URL}/videos.json` // const videosJsonUrl = process.env.VIDEO_SOURCE || `${process.env.VFUNCTIONS_URL}/videos.json`
// Fetch Commits // Fetch Commits
const response = await axios.get( videosJsonUrl ) // const response = await axios.get( videosJsonUrl )
// Extract commit from response data // Extract commit from response data
const fetchedVideos = response.data const fetchedVideos = await fs.readJson( youtubeVideoPath )//response.data
const videos = [] const videos = []