How to download the fun videos in the ditto video app and the ditto video app

Source: Internet
Author: User

How to download the fun videos in the ditto video app and the ditto video app

How to download a fun video from the ditto video app

1. ditto video app


Key Content
2. Capture packets to obtain the video address of the app.
Use charles
Enable Proxy:

Set the proxy ip address of the computer on the same wifi:

So many packet capture tools are available for windows.
The last retrieved data interface 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 by webpage analysis:

This url is required.

4. Get the url. Because I am developing for ios, I directly go to the ios code.

- (void)getDittoVideos {    for (int i = 1;i <= 3; i++) {        NSString *url = [NSString stringWithFormat:@"http://ditto.short.tv/api/v1/videos?page=%d",i];        AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];        [manager GET:url parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {            NSLog(@"%d\n",i);            NSString *detail = @"";            NSArray *videoList = responseObject;            for (int j=0;j<videoList.count;j++) {                NSString *name = [NSString stringWithFormat:@"%@.%@.mp4#%@",videoList[j][@"id"],videoList[j][@"title"],videoList[j][@"url"][@"m3u8"]];                detail = [NSString stringWithFormat:@"%@\n%@",detail,name];            }            NSLog(@"%@",detail);        } failure:^(AFHTTPRequestOperation *operation, NSError *error) {        }];    }}

5. The address is m3u8, which is a live video format. It is not mp4 format. Therefore, you cannot download m3u8 using the conventional method. You can use ffmpeg to download m3u8.
Ffmpeg: https://www.ffmpeg.org/
Download command:

./ffmpeg -i "url" -c copy -bsf:a aac_adtstoasc "fileName.mp4"

6. Download To mp4 format (python)

#coding=utf-8import re,urllib2,osfor line in open("url.txt"):    contents = line.split('#')        name = contents[0]        url = contents[1]        urlTmp = url.split()        cmd = "./ffmpeg -i \"%s\" -c copy -bsf:a aac_adtstoasc \"%s\"" % (urlTmp[0],name)        os.system(cmd)

7. OK. All the videos have been downloaded.

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.