mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
YT: resolve redirects on the Clapper side
Instead of providing URIs directly to GStreamer, follow redirects and provide that final URI. With this change souphttpsrc will not have to go through redirects from the beginning for each video segment.
This commit is contained in:
@@ -86,16 +86,23 @@ class ClapperPlayer extends PlayerBase
|
||||
if(!info)
|
||||
throw new Error('no YouTube video info');
|
||||
|
||||
const dash = Dash.generateDash(info);
|
||||
let videoUri = null;
|
||||
const dashInfo = await this.ytClient.getDashInfoAsync(info).catch(debug);
|
||||
|
||||
if(dash) {
|
||||
const dashFile = await FileOps.saveFilePromise(
|
||||
'tmp', null, 'clapper.mpd', dash
|
||||
).catch(debug);
|
||||
if(dashInfo) {
|
||||
debug('parsed video info to dash info');
|
||||
const dash = Dash.generateDash(dashInfo);
|
||||
|
||||
if(dashFile)
|
||||
videoUri = dashFile.get_uri();
|
||||
if(dash) {
|
||||
debug('got dash');
|
||||
|
||||
const dashFile = await FileOps.saveFilePromise(
|
||||
'tmp', null, 'clapper.mpd', dash
|
||||
).catch(debug);
|
||||
|
||||
if(dashFile)
|
||||
videoUri = dashFile.get_uri();
|
||||
}
|
||||
}
|
||||
|
||||
if(!videoUri)
|
||||
|
Reference in New Issue
Block a user