Total Pageviews

Friday 5 June 2020

YouKuDownLoader

a video downloader focused on China mainland video sites.

this project is a fork of you-get with below changes.
  1. Structured source code
  2. focus on China mainland video sites
  3. support Python2
Consider install from source by:
  1. sudo apt-get install ffmpeg mpv python3-pip
  2. pip3 install git+git://github.com/zhangn1985/ykdl.git --upgrade --user
  3. add ~/.local/bin to your PATH
Simple installation guide:
Linux/debian:
  1. sudo apt-get install ffmpeg mpv python3-pip
  2. pip3 install ykdl --upgrade --user
  3. add ~/.local/bin to your PATH
Windows:
  1. install python3 from python.org
  2. pip install --upgrade ykdl
  3. install deps: FFMPEG MPV to system PATH
Other Linux: please follow debian
Other OS: please DIY.
Site status:
please check wiki page: sites-status
file bugs or requirements are welcome。
-----

This project is a fork of you-get with below changes.

  • Structured source code.
  • Focus on China mainland video sites.
  • Dropped supports of Python 3.4 and below (see #487).

Simple installation guide

There are some useful software package managers.

Step:
  1. Dependencies

    FFmpeg, for merge media files.
    mpv, default media player (optimal compatibility).
  2. Python 3

  3. pip and setuptools, make sure they are updated.

    python3 -m ensurepip
    python3 -m pip install pip --upgrade
    python3 -m pip install setuptools --upgrade
  4. ykdl from PyPI or GitHub

    pip3 install ykdl --upgrade
    pip3 install https://github.com/SeaHOH/ykdl/archive/master.zip --force-reinstall --no-deps
    pip3 install https://github.com/SeaHOH/ykdl/archive/master.zip --upgrade
  5. Make sure those folders are in your PATH, if they are not, add them.

    Windows: folders of ffmpeg.exe, mpv.exe, and python.exe, and folder "<PYTHONHOME>\Scripts"
    others: "~/.local/bin" or "/usr/local/bin"

Site status

Please check wiki page: sites-status

from https://github.com/SeaHOH/ykdl 

( ykdl-专注于优酷视频的下载

由于视频网站规则不断变换,无论是神器youtube-dl,you-get,经常莫名其妙无法解析视频,尤其是you-get,优酷某些特殊视频,在解析时经常出现”客户端无权播放-201″

这种情况下,我们可以试试ykdl。

ykdl——顾名思义,一款专注于国内优酷视频的命令行下载工具。这些天试用下来,在优酷视频解析下载方面ykdl的表现更为强大,至少在写这篇文章时,某些优酷视频,youtube-dl和you-get要么只能解析下载前几分钟,要么直接无法解析。

  -h, --help            show this help message and exit

                        显示本帮助信息并退出

  -l, --playlist        Download as a playlist.

                        将所给的视频 URL 作为播放列表进行下载

  -i, --info            Display the information of videos without downloading.

                        只显示视频信息而不进行下载

  -J, --json            Display info in json format.

                        以 json 格式显示视频信息

  -F FORMAT, --format FORMAT

                        Video format code.

                        指定视频的格式代号。参数通常是 TD, HD, SD, LD。默认最高清晰度。具体请看 -i 的输出。

  -o OUTPUT_DIR, --output-dir OUTPUT_DIR

                        Set the output directory for downloaded videos.

                        指定下载视频的保存目录

  -O OUTPUT_NAME, --output-name OUTPUT_NAME

                        downloaded videos with the NAME you want

                        指定下载视频的文件名

  -p PLAYER, --player PLAYER

                        Directly play the video with PLAYER like mpv

                        直接使用播放器播放而不是下载,推荐使用[mpv](https://mpv.io)

  --proxy PROXY         set proxy HOST:PORT for http(s) transfer. default: use

                        system proxy settings

                        为下载指定代理 HOST:PORT(主机名:端口号),默认使用系统的代理设置

  -t TIMEOUT, --timeout TIMEOUT

                        set socket timeout seconds, default 60s

                        设置网络传输超时时长,单位秒。默认为60秒

  --no-merge            do not merge video slides

                        不合并视频分片

  -s START, --start START

                        start from INDEX to play/download playlist

                        配合 -l 使用,从播放列表的第 X 项开始播放。

  -j JOBS, --jobs JOBS  number of jobs for multiprocess download

                        指定并行下载的视频分片数

  --debug               print debug messages from ykdl

                        打印调试信息 。

相比较而言,ykdl的命令并不太多,但足够我们使用,最简单的命令ykdl+视频网址,可一键解析下载视频.

ykdl下载优酷视频

当然,除了优酷视频,ykdl也支持爱奇艺、腾讯视频的解析下载。值得一说的是,通过ykdl -p命令我们还可以直接加载在线视频到mpv播放器上播放

如果你不堪忍受视频网站广告,使用此方法直接本地播放视频是个不错的办法。

https://github.com/SeaHOH/ykdl)

-----

Website video downloader, supports the videos on Bilibili, iQIYI, Tencent Video, MGTV and WeTV. 网站视频下载器,主要支持Bilibili、爱奇艺、腾讯视频、芒果TV、WeTV、愛奇藝台灣站。 

webvideo-downloader

🚀 视频下载器,用于下载网站中可以在线播放的视频。


目录

支持的网站

站点 URL 普通画质 VIP专属
哔哩哔哩(单P/多P) https://www.bilibili.com/
爱奇艺 https://www.iqiyi.com/
腾讯视频 https://v.qq.com/
芒果TV https://www.mgtv.com/
WeTV https://wetv.vip/
爱奇艺国际站 https://www.iq.com/

此外,可选的 CommonHlsDownloader 脚本支持绝大部分基于 HLS 流式视频的网站,如 LPL官网 等。

功能特性

下载特性

  • 跨平台支持(Windows/Linux/Mac)
  • 多线程下载(单文件分段/多文件并行)
  • 字幕下载和集成(集成字幕的视频需使用支持字幕的播放器播放,如 PotPlayerVLC Player 等)

关于 VIP

本项目支持1080p蓝光画质、VIP专享、VIP点播、付费视频的下载,前提是你是VIP/用了券/付了费。

What you can watch determined what you can download.

你只能下载你或你的账号可以在线观看的视频,本项目没有VIP破解功能。

快速开始

安装

依赖程序

本项目基于PythonFFmpeg 和浏览器扩展 Violentmonkey/Tampermonkey 开发:

获取项目

直接下载压缩包,或使用 git clone:

git clone https://github.com/jaysonlong/webvideo-downloader.git
安装项目

浏览器安装以下基于 Violentmonkey/Tampermonkey 的脚本。直接点击以下链接即可安装:

安装 python 依赖包:

cd webvideo-downloader/downloader
pip install -r requirements.txt

(可选)浏览器安装广告拦截器:

对于某些网站,视频存在广告时,浏览器插件脚本会延迟到广告即将结束时才能提取到视频链接,安装拦截器可不用等待广告播放完毕

运行

本项目分为两部分,Violentmonkey 目录下的 javascript 脚本用于在浏览器中提取视频链接,Downloader 目录下的 python 脚本用于下载、合并视频。

首先执行 python 脚本:

python daemon.py

然后访问视频网站并点击某个视频,网页会自动弹出下载按钮,点击按钮即可下载。

示例链接:https://www.bilibili.com/video/BV1c741157Wb

下载进度可在 python 脚本的命令窗口查看:

$ python daemon.py
Listening on port 18888 for clients...

Receive: {
    "fileName": "看小黄书会被处罚吗",
    "linksurl": "http://xxx",
    "type": "link"
}

Handle: "看小黄书会被处罚吗"

匹配到1段音频,1段视频,开始下载
-- dispatcher/downloadDash
正在下载 E:\Workspace\Github\webvideo-downloader\temp\看小黄书会被处罚吗.audio.m4s
分8段, 并行8线程下载
进度: [########################################] 100%    0.9/0.9MB  450KB/s 0s
正在下载 E:\Workspace\Github\webvideo-downloader\temp\看小黄书会被处罚吗.video.m4s
分8段, 并行8线程下载
进度: [########################################] 100%  11.2/11.2MB  5.2MB/s 2s
正在合并视频
Finish.

下载目录默认为项目根目录下的 videos 文件夹,可在 downloader/config.py 中配置。

python 脚本可选命令行参数:

$ python daemon.py -h
usage: daemon.py [-h] [-t:h N] [-t:f N] [-f N] [-p PORT] [-c] [-s] [-d] [-i]

optional arguments:
  -h, --help     show this help message and exit
  -t:h N         the thread count of hls download, default 8
  -t:f N         the thread count of fragments download, default 8
  -f N           the fragments count of each file, default 0 using the thread count
  -p PORT        the port that the backend server listens on, default 18888
  -c, --correct  correct the timestamp of hls video, merge fragments using binnary mode
  -s             if set, will save the temp files
  -d             debug mode, log more info and save the temp files (ignore -s)
  -i             interactive mode, get url and file name from the command line 
from https://github.com/jaysonlong/webvideo-downloader 

 

 

No comments:

Post a Comment