GithubHelp home page GithubHelp logo

czzonet / acfun-video-downloader Goto Github PK

View Code? Open in Web Editor NEW
24.0 2.0 2.0 3.2 MB

The way to cache video in acfun.cn | reddit.com 2020 || 缓存A站|reddit视频的方法2020

License: MIT License

TypeScript 100.00%
video downloader acfun m3u8 m3u8-downloader reddit ffmpeg

acfun-video-downloader's Introduction

A 站视频缓存 | reddit 视频缓存

谁不想在遇到好视频的时候能够缓存下来呢?

声明: 本教程提供一种缓存视频的方法,意在方便离线也能观看,对于任何不当使用概不负责!

下载器m3u8 downloader

TODO

  • 脚本化
  • chrome 插件化
  • 网站化(大概不必要)

更新

  • 20190903:添加一种方法
  • 20200201:添加新方法,升级旧方法
  • 20200211:修复番剧无法提取的问题
  • 20200212:新增 reddit 视频提取
  • 20200415:新增油猴脚本
  • 20200424:优化样式 移除旧方法

step1 获取链接

脚本提取

安装脚本->A 站视频缓存 视频链接解析

该脚本会添加一个获取链接的按钮,解析的结果会显示在网页上。

测试地址:【日剧日影混剪】四月治愈‖遇见喜欢的人 就如奇迹一般

脚本

手动提取

通过手动提取m3u8地址,然后直接使用下载器下载整合。原理并没有太大区别,适合临时使用。

F12打开控制台,输入以下代码:

A 站

const ksPlay = JSON.parse(window.pageInfo.currentVideoInfo.ksPlayJson);

if (!ksPlay) {
  console.log("解析播放器数据源失败!");
} else {
  const dataVideos = ksPlay.adaptationSet;
  for (let i = 0; i < dataVideos.length; i++) {

    const representation = dataVideos[i].representation;

    for (let j = 0; j < representation.length; j++) {
      const dataVideo = representation[j];
      const url = dataVideo.url;
      const qualityLabel = dataVideo.qualityLabel;
      console.log(`【${qualityLabel}${url}`);
    }
  }
}

reddit

var redditdata = document.getElementsByTagName("source");
console.log(
  "Please copy m3u8 url below(additional audio):\n复制以下m3u8链接(外挂音频):\n",
  redditdata[redditdata.length - 1].src
);

step2 使用下载器下载

下载m3u8 downloader,分别下载一个主程序和一个 dll 库文件。再下载ffmpeg,选最下面最新的进行解压,并把前面下载的两个文件拷贝到bin目录,双击运行 m3u8 downloader 主程序,输入第一步拷贝的链接粘贴即可下载,输出.mp4文件在当前目录的Download文件夹。Reddit 是外挂音频,所以会有单独下载的音频文件,需要自己再合成一下。

演示

  • 普通视频

普通视频

  • 番剧

番剧

  • 缓存中

缓存中

  • reddit

reddit

旧方法(已移除)

A 站原先用硕鼠直接可以下载,现在只能下 m3u8 文件,需要再用对应下载器下载整合。而且是相对地址需要前缀转换

References

  1. m3u8 downloader
  2. ffmpeg
  3. Acfun-hls

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.