Teach you to download fun videos in the ditto video app
1.ditto Video App
Key Content
2. First, capture the video address of the app
With Charles
To open a proxy:
Under the same wifi, the phone sets the proxy IP of the computer:
Then grabbed, so many grab the bag tool, whatever you use the tool, Windows can use Findler.
The last data interface obtained is:
Http://ditto.short.tv/api/v1/videos
Http://ditto.short.tv/api/v1/sliders
http://ditto.short.tv/api/v1/videos/153
http://ditto.short.tv/api/v1/videos?page=2
3. JSON returned with Web page analysis:
That's the URL you need.
4. Get the URL as I was developing iOS, so go directly to the iOS code
- (void) Getdittovideos { for(inti =1; I <=3; i++) {NSString*url = [NSStringstringwithformat:@"http://ditto.short.tv/api/v1/videos?page=%d", I]; Afhttprequestoperationmanager *manager = [Afhttprequestoperationmanager manager]; [Manager Get:url Parameters:Nilsuccess:^ (Afhttprequestoperation *operation,IDResponseobject) {NSLog(@"%d\n", i);NSString*detail = @"";Nsarray*videolist = Responseobject; for(intj=0; j<videolist. Count; j + +) {NSString*name = [NSStringstringwithformat:@"%@.%@.mp4#%@", videolist[j][@"id"],videolist[j][@"title"],videolist[j][@"url"][@"m3u8"]]; detail = [NSStringstringwithformat:@"%@\n%@", Detail,name]; }NSLog(@"%@", detail); } failure:^ (Afhttprequestoperation *operation,Nserror*error) {}]; }}
5. Address is m3u8, is a kind of live format, not MP4 format, so it is not possible to download by conventional method, download m3u8 can be downloaded with ffmpeg
ffmpeg:https://www.ffmpeg.org/
Download command:
.-i"url"-c-bsf"fileName.mp4"
6. Download as MP4 format (python)
#coding=utf-8import re,urllib2,osforlineinopen("url.txt"): line.split(‘#‘) name = contents[0] url = contents[1] urlTmp = url.split() "./ffmpeg -i \"%s\" -c copy -bsf:a aac_adtstoasc \"%s\"" % (urlTmp[0],name) os.system(cmd)
7.ok, the video has been downloaded.
Teach you to download fun videos in the ditto video app