Hi Readers,
We can download video file from Youtube if we know youtube URL of the video. First you need to add attached files (HCYoutubeParser) into your project. Now you need to call following function into your code:
let video = HCYoutubeParser.h264videosWithYoutubeURL(yturl!)
let downloadURL = video["medium"] as! String
Where yturl is video URL. We need to pass it into h264videosWithYoutubeURL function. HCYoutubeParser is a class which provides methods for converting Youtube video watch URL into video download URL. This can be done by Youtube video id also. Following method is used for that:
let video = HCYoutubeParser.h264videosWithYoutubeID(ytID!)
let downloadURL = video["medium"] as! String
Where ytID is id of Youtube video. In these examples we are getting download URL of medium quality video. We can get it according to our requirement.
For downloading please follow another blog : http://findnerd.com/list/view/How-to-download-data-Using-NSOperations-and-NSOperationQueue/22420/ . It will help you serially download files serially.
Thanks for reading.
1 Comment(s)