How to pick up videos

Author: Wang Jiaojiao

When: November 8, 2017

When it comes to front-end development, it is unavoidable to put videos on web pages. If you put videos, sometimes you will inevitably pick up videos. The following is the bitter journey of my videos. Let’s watch and cherish them.

1. Directly pick up the code

Like pandakill 's video, you can just pick up the code directly.

As for what format, after downloading it by yourself, you can directly convert it with the format factory.

Second, look at the network

For example , the video of tentacles can be found by watching the network. At first, I was still looking for it slowly. Later, a netizen suggested that you can sort by size first, because the video will be much larger than the general file==, so that It's easy, hahaha.

3. Change the domain name

This video applies to station B (bilibili) .

For example, a website address is https://www.bilibili.com/video/av71/index_4.html

How to pick up videos, just change bilibili to kanbilibili, that is

https://www.kanbilibili.com/video/av71/index_4.html

After opening, the top of the page looks like this:

After clicking "Download Address",

It is divided into 2 parts, the download address and the barrage download address, we only need to select the download address (the first part).

In the download address part, there are 3 types of download methods, P2, P3 and P4. Generally, P3 can be downloaded. I have downloaded P4, but there will be several download failures in the middle. P3 can be completely downloaded. There are many ts files downloaded, and then we can use the code merging tool provided by station B to merge multiple ts files into one ts file. Merge address: https://www.kanbilibili.com/tools/flvjoin.

First add multiple files that have been downloaded. If you need to sort, you can click "Auto Sort", then enter the merged file name, click "Start merging", wait for a while, and after merging, download it and it will be ok La.

But at this time, someone may ask, I need a video in mp4 format, and I don't know what ts file is. This and this, there is a particularly simple and rude method, which is to directly change the suffix name of the video to mp4. It can be fully played locally, but we are definitely not limited to local playback, but also can be placed on In our code, then others can play this page when they visit this page. Then this method will not work. We all know that there are many encoding formats for video, and different browsers support different encoding formats. For example, the encoding format of ts is MPEG , while the encoding format supported by browsers such as Google and Firefox is FLV . so~~The protagonist is here: Format Factory , it can not only convert the video format, but also convert the video format, so it is so easy~~

Fourth, use Chrome and Thunder to download videos

This method is recommended. Although it is complicated, it is very effective.

Applicable websites: Douyu, MOOC, NetEase Cloud Classroom, Station B , etc.

We all know that video websites generally use segmented videos to load in order to protect copyright and prevent hotlink downloads. For the general .flv format, there are only a few video sources at most, but the .ts format is usually a few megabytes per segment, and there are basically hundreds of videos for an hour or so. It is too tiring to download manually. Next, I will share a painless method, and only need to use the common software of the system.

1. Get the original video

Take a video as an example, use Chrome to access and open the developer tools to switch to the Netword panel, you can click the position where the video starts and ends, then we can find that the video source is a regular address, and from 001 to 344 .

http://vodhls1.douyucdn.cn/live/normal_live-1472475rRBixlMro--20161208170245/8a710e1fcd074f5e8172a289948015b4_0000001.ts?k=13f7855bd737b9572e71edaf4bf0cd23&t=585eb0a5&d=97D3DB2B2FBB6117D2076CA626978877&u=0&ct=web&vid=40890

Just focus on the places I marked in red.

2. Batch download .ts videos

  • First open Xunlei, create a new task, and then select Add tasks in batches.

  • Set the URL rule, use (*) to represent the change part, and the maximum length is 3 (because Thunderbolt supports adding up to 1000 tasks at the same time)

You just need to pay attention to the 3 parts in my circle.

The first part : Select the position of the number you want to change and replace it with a pair of parentheses and wildcards, namely (*), but there are points to pay attention to here, we noticed that I wrote 6 0s and a wildcard here, then the following In that column, the corresponding writing is 0 to 9 (one-digit number), when the ts file is 10 to 99, then it has to be written as 5 0 plus a wildcard, and so on, the ts file is 100 to 999 , here it has to be written as 4 0s plus a wildcard. In short, the total number of digits in the ts file is 7 digits, which means that although we download in batches, we still divide into batches, 0 to 9 batches, 10 to 99 One batch, 100 to 999 batches, etc., this is ok if you pay attention.

The second part : The first part of the first two input boxes has been finished. Now the main thing is the length of the wildcard. Here, it is enough to write 1 by default. Then why not write 2 and 3? You can see the results.

The third part : This is equivalent to the inspection part. After filling in the first two parts, you can view the scope of the ts file in the third part, and we can check whether the previous configuration is correct.

After clicking "OK", the following pop-up window will pop up:

For this, we only need to pay attention to "merge into a task group". What does this mean? It means that this ts file is classified into the task group you wrote first, which is convenient for management.

  • If there is no setting error, the next download will be automatic.

  • After the download is complete, how to merge these ts files into one?

In fact, this is simpler, using a line of DOS commands can be achieved.

copy/b D:\video\*.ts D:\video-all\all.ts

After executing the above command, all .ts files under the D:\video\ directory will be merged into all.ts, and the all.ts file will be placed in the video-all folder.

Command description:

copy is used to merge files. Without the /b parameter, it will be merged as a normal text file. Adding this parameter means that it will be merged as a binary file; in addition, the file order is sorted by file name, because most video stream file names are also They are very regular and basically do not need to rename and sort by themselves. (Note: there should be no spaces in the path)

 

5. Use the download tool to download videos

Applicable to: fighting fish , etc.

I failed this test, you can try it yourself, hahaha.

 

step

1. Open the Firefox browser plugin page and install the Ant.com video downloader plugin

%u63D2%u4EF6%u8BE6%u60C5

After the plugin is installed, you will see a download icon in the upper right corner of the browser.

%u89C6%u9891%u4E0B%u8F7D%u63D2%u4EF6

2. Configure the plugin

Click the down arrow ↓ next to the plugin download icon and select Preferences, where:

  • Display Modechange toToolbar
  • Downloaded movies folderCan be changed to the address where you want to save the video

Note: Because this plug-in can't meet all our needs, it doesn't matter where the video folder is saved here, and it doesn't necessarily save all the videos here.

3. Open the Douyu video details page to get the real address of the video

Open the video details page you want to download, such as: https://v.douyu.com/show/rjNBdvnpJGmME2yw

After the page is loaded, you can see that the downloadicon of the video plug-in is animated. Click downloadto see the list of currently downloadable videos.

Since Douyu's video is segmented, a video will be divided into multiple ts format videos, so you can see multiple files in the video list.

Left-click on the penultimate one in the list to start the download. (This file is the first paragraph of the full video)

%u63D2%u4EF6%u4E2D%u7684%u89C6%u9891%u5217%u8868

After the download is complete, the downloaded file can be found in the upper right corner of the browser. Right-click the file you just downloaded and select 复制下载链接.

%u6D4F%u89C8%u5668%u4E0B%u8F7D%u6587%u4EF6%u5217%u8868

After copying the download link, you can go back to the method introduced above and download in batches with Thunder.

 

So far, let’s talk about these 5 methods first. In fact, there are other methods, you can explore them yourself~~~

 

My blog will be moved and synchronized to Tencent Cloud + community, and I invite everyone to join:

https://cloud.tencent.com/developer/support-plan?invite_code=20opgbsr7x34w

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326077923&siteId=291194637