Closed MeShootIn closed 1 year ago
I would recommend creating a seperate function for this. The getDownloadLinks() function should then only accept the returned youtube id. This would slightly increase the performance when only the id is given.
yeah, the existing ID parsing logic is pretty weak... your regex solution is much better. So we'll just use that in the next release: https://github.com/Athlon1600/youtube-downloader/commit/250f575cd82d39f8248dd07b0cf126fe3a1bd459
I would recommend creating a seperate function for this. The getDownloadLinks() function should then only accept the returned youtube id. This would slightly increase the performance when only the id is given.
true. But a good solution to that is to first check if the string passed in is exactly 11 characters long (very efficient operation), and if so, assume that the ID itself was passed in rather than some URL
Method
Utils::extractVideoId
doesn't parse correctly some links (tested on https://gist.github.com/rodrigoborgesdeoliveira/987683cfbfcc8d800192da1e73adc486):So, maybe use another method like below?