Topic: SVPTube Optimisation with correct filename

Hi guys,

Here some lines to change in your svptube-dl.wsf for have the correct Title of the youtube movie as name of the downloaded mp4 :

Line 30 :
Replace

var videoURL,audioURL,subsURL;

By

var videoURL,audioURL,subsURL,varTitle;

Line 35 :
Replace

case 2: videoURL=WScript.Arguments(0); break;

by

case 2: videoURL=WScript.Arguments(0); varTitle=WScript.Arguments(3); break;

Line 56 :
Replace

fileName=WScript.Arguments(WScript.Arguments.length-1);

by

fileName=varTitle;

Enjoy

Re: SVPTube Optimisation with correct filename

didn't get the point  hmm
video title is the last argument so "fileName=WScript.Arguments(WScript.Arguments.length-1)" is exactly what is needed

3 (edited by Chacc 13-07-2014 19:39:50)

Re: SVPTube Optimisation with correct filename

The original code don't works on my computer...

Re: SVPTube Optimisation with correct filename

Post here the url of video that doesn't work.

Re: SVPTube Optimisation with correct filename

It's not a question of the link, it's a question of than your code don't return a valid string on my computer.

A other problem is your method to get the dowload folder : "%HOMEDRIVE%%HOMEPATH% is the same of %USERPROFILE% and your code don't works if a user had moved the Download folder on other hard drive.

Apparently we can't use "Knowfolder" with JScript for get the Absolute PATH of Download or Movie folder..

Re: SVPTube Optimisation with correct filename

Chacc
It's not a question of the link, it's a question of than your code don't return a valid string on my computer.

ok, then just tell me why and I'll fix it big_smile

it can be some strange video title that gets broken by the shell into two (or more) arguments
try to enumerate all script arguments with WScript.Echo()

BTW your code isn't correct at all cause number of arguments depends on video format and presence of subtitles wink