Teach you to download fun videos in the ditto video app

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.