Started work on re-implementation of youtube raw-link reloading.

This commit is contained in:
rainbow napkin 2025-11-01 08:09:54 -04:00
parent a70879c76c
commit 02c4d214fa

View file

@ -67,7 +67,6 @@ module.exports.yankMedia = async function(url, title){
module.exports.refreshRawLink = async function(mediaObj){ module.exports.refreshRawLink = async function(mediaObj){
switch(mediaObj.type){ switch(mediaObj.type){
case 'yt': case 'yt':
console.log("lolnope");
/* We're skipping this one for now... /* We're skipping this one for now...
//Scrape expiration from query strings //Scrape expiration from query strings
const expires = mediaObj.rawLink.match(/expire=([0-9]+)/); const expires = mediaObj.rawLink.match(/expire=([0-9]+)/);
@ -80,14 +79,16 @@ module.exports.refreshRawLink = async function(mediaObj){
return null; return null;
} }
*/
//Re-fetch media metadata //Re-fetch media metadata
metadata = await ytdlpUtil.fetchYoutubeMetadata(mediaObj.id); metadata = await ytdlpUtil.fetchYoutubeMetadata(mediaObj.id);
//Refresh media rawlink from metadata //Refresh media rawlink from metadata
mediaObj.rawLink = metadata[0].rawLink; mediaObj.rawLink = metadata[0].rawLink;
//return media object //return media object
return mediaObj; return mediaObj;
*/
} }
//Return null to tell the calling function there is no refresh required for this media type //Return null to tell the calling function there is no refresh required for this media type