Release v0.4.0 #110

Merged
lamacchinadesiderante merged 50 commits from develop into main 2024-05-27 19:05:12 +00:00
1 changed files with 3 additions and 16 deletions
Showing only changes of commit 81b3bb8660 - Show all commits

View File

@ -17,8 +17,6 @@ export const fetchPornHubVideoData = async (videoId: string, params?: FetchParam
srcSet: []
}
let related: GalleryData[] = [];
let mediaUrl, sessionCookie, convertedData: VideoSourceItem[]
let reqHeaders = getHeaders(PORNHUB_BASE_URL)
@ -26,10 +24,9 @@ export const fetchPornHubVideoData = async (videoId: string, params?: FetchParam
const queryUrl = `${PORNHUB_BASE_URL_VIDEO}${videoId.replace(/\//g, '')}`
const cachedVideoData = await getDataFromRedis(queryUrl)
const cachedRelatedData = await getDataFromRedis(queryUrl + DEFAULT_RELATED_VIDEO_KEY_PATH)
if (cachedVideoData) {
return [cachedVideoData as VideoData, cachedRelatedData as GalleryData[] ?? []]
return [cachedVideoData as VideoData, []]
}
await axios.get(queryUrl, reqHeaders)
@ -51,14 +48,6 @@ export const fetchPornHubVideoData = async (videoId: string, params?: FetchParam
mediaUrl = getMediaUrl
}
// // populate related gallery
// scriptTags.map((idx, elem) => {
// // magic goes here
// })
// await storeDataIntoRedis(queryUrl + DEFAULT_RELATED_VIDEO_KEY_PATH, related, DEFAULT_PORNHUB_VIDEO_EXPIRY);
})
}).catch((error: AxiosError) => {
@ -67,12 +56,10 @@ export const fetchPornHubVideoData = async (videoId: string, params?: FetchParam
if (sessionCookie && mediaUrl) {
convertedData = await getPornHubMediaUrlList(mediaUrl, sessionCookie)
await storeDataIntoRedis(queryUrl, convertedData, DEFAULT_PORNHUB_VIDEO_EXPIRY);
data.srcSet = convertedData.reverse()
await storeDataIntoRedis(queryUrl, data, DEFAULT_PORNHUB_VIDEO_EXPIRY);
}
return [ data, []]
// return [ { lowResUrl: 'https://www.w3schools.com/html/mov_bbb.mp4' } ,[]]
}