ios - How to download video from youtube and save (objective c)? -


how can download videos you-tube , save in app folder. have videoid, don't have working code. found link code link not working me.

save youtube video iphone in app

if 1 have working code please share me thanks.

set youtube url

- (void)downloadmultiafn:(nsstring *)useridfrom messageid:(nsstring *)msgid message:(nsstring *)message url:(nsstring *)url contact:(nsstring *) contact nickname:(nsstring *)nickname  {     imageurlpathforsharingmessgeid=msgid;      nsurl *url = [nsurl urlwithstring:url];     nsurlrequest *request = [nsurlrequest requestwithurl:url];     afhttprequestoperation *downloadrequest = [[afhttprequestoperation alloc] initwithrequest:request];     [downloadrequest setcompletionblockwithsuccess:^(afhttprequestoperation *operation, id responseobject) {          nsdata *data = [[nsdata alloc] initwithdata:responseobject];  // can save video or image avi or png         //  [[dbmanagernew getsharedinstance] savedatauploadimage:msgid isread:no issend:yes isreceipt:no image:data];       //  imageisselected=no;   // [self fetchallmessage];        } failure:^(afhttprequestoperation *operation, nserror *error) {         nslog(@"file downloading error : %@", [error localizeddescription]);     }];      [downloadrequest start];   } 

Comments