当前位置: 首页 > news >正文

【python】You-Get

在这里插入图片描述

文章目录

  • 1、介绍
  • 2、安装与使用文档
  • 3、下载图片
  • 4、下载视频
  • 5、下载音乐
  • 6、参考

1、介绍

You-Get is a tiny command-line utility to download media contents (videos, audios, images) from the Web, in case there is no other handy way to do it.

源码:https://github.com/soimort/you-get

在这里插入图片描述
用户庞大呀

在这里插入图片描述

2、安装与使用文档

pip 直接安装

pip install you-get

使用文档,可以 you-get -h 获取

you-get: version 0.4.1743, a tiny downloader that scrapes the web.
usage: you-get [OPTION]... URL...

A tiny downloader that scrapes the web

options:
  -V, --version         Print version and exit
  -h, --help            Print this help message and exit

Dry-run options:
  (no actual downloading)

  -i, --info            Print extracted information
  -u, --url             Print extracted information with URLs
  --json                Print extracted URLs in JSON format

Download options:
  -n, --no-merge        Do not merge video parts
  --no-caption          Do not download captions (subtitles, lyrics, danmaku, ...)
  --post, --postfix     Postfix downloaded files with unique identifiers
  --pre PREFIX, --prefix PREFIX
                        Prefix downloaded files with string
  -f, --force           Force overwriting existing files
  --skip-existing-file-size-check
                        Skip existing file without checking file size
  -F STREAM_ID, --format STREAM_ID
                        Set video format to STREAM_ID
  -O FILE, --output-filename FILE
                        Set output filename
  -o DIR, --output-dir DIR
                        Set output directory
  -p PLAYER, --player PLAYER
                        Stream extracted URL to a PLAYER
  -c COOKIES_FILE, --cookies COOKIES_FILE
                        Load cookies.txt or cookies.sqlite
  -t SECONDS, --timeout SECONDS
                        Set socket timeout
  -d, --debug           Show traceback and other debug info
  -I FILE, --input-file FILE
                        Read non-playlist URLs from FILE
  -P PASSWORD, --password PASSWORD
                        Set video visit password to PASSWORD
  -l, --playlist        Prefer to download a playlist
  -a, --auto-rename     Auto rename same name different files
  -k, --insecure        ignore ssl errors
  -m, --m3u8            download video using an m3u8 url

Playlist optional options:
  --first FIRST         the first number
  --last LAST           the last number
  --size PAGE_SIZE, --page-size PAGE_SIZE
                        the page size number

Proxy options:
  -x HOST:PORT, --http-proxy HOST:PORT
                        Use an HTTP proxy for downloading
  -y HOST:PORT, --extractor-proxy HOST:PORT
                        Use an HTTP proxy for extracting only
  --no-proxy            Never use a proxy
  -s HOST:PORT or USERNAME:PASSWORD@HOST:PORT, --socks-proxy HOST:PORT or USERNAME:PASSWORD@HOST:PORT
                        Use an SOCKS5 proxy for downloading

支持的平台如下

在这里插入图片描述

3、下载图片

在这里插入图片描述

选择图片,复制图像链接

终端命令输入 you-get 图片链接

在这里插入图片描述

下载完成

在这里插入图片描述

4、下载视频

在这里插入图片描述

复制链接,you-get 视频链接

在这里插入图片描述

视频、声音、弹幕都下载了

在这里插入图片描述


可以通过 -i 查看可以下载素材的格式与分辨率

you-get -i https://www.bilibili.com/video/BV1GJ411M7TF/?spm_id_from=333.999.0.0

output

you-get: You will need login cookies for 720p formats or above. (use --cookies to load cookies.txt.)
site:                Bilibili
title:               冯老板-KOD 10 裁判表演
streams:             # Available quality and codecs
    [ DASH ] ____________________________________
    - format:        dash-flv480-AVC
      container:     mp4
      quality:       清晰 480P avc1.64001F
      size:          9.5 MiB (9936285 bytes)
    # download-with: you-get --format=dash-flv480-AVC [URL]

    - format:        dash-flv480-HEVC
      container:     mp4
      quality:       清晰 480P hev1.1.6.L120.90
      size:          7.0 MiB (7385543 bytes)
    # download-with: you-get --format=dash-flv480-HEVC [URL]

    - format:        dash-flv360-AVC
      container:     mp4
      quality:       流畅 360P avc1.64001E
      size:          4.3 MiB (4525456 bytes)
    # download-with: you-get --format=dash-flv360-AVC [URL]

    - format:        dash-flv360-HEVC
      container:     mp4
      quality:       流畅 360P hev1.1.6.L120.90
      size:          3.3 MiB (3411044 bytes)
    # download-with: you-get --format=dash-flv360-HEVC [URL]

5、下载音乐

在这里插入图片描述

复制链接,you-get 链接 下载

在这里插入图片描述
有音乐和歌词
在这里插入图片描述

[00:00.00] 编曲 : 陈恒冠
[00:00.50] 制作人 : 陈恒冠/陈恒家
[00:01.01] 作词 : 陈恒冠
[00:01.52] 作曲 : 陈恒冠
[00:02.03]监制:1991与她
[00:03.25]直到今天我都不知道
[00:09.13]你究竟以什么谋生
[00:15.02]不过这也不是太重要
[00:20.21]从不关心阳光草也长得很好
[00:26.87]喝茶和赏雨已经不再让我安详
[00:32.35]偶然又一起跨上摩托冲到边境
[00:38.38]排气狂暴轰鸣中跨过半省
[00:44.32]大山湿雾弥漫里吐出烟气
[00:50.40]克林 上路是偶然
[00:56.09]如鲸向海 请取笑那些苦难吧
[01:02.32]克林 人生是偶然
[01:07.95]依旧浪漫 尽管你知道后来啊
[01:14.29]克林 上路是偶然
[01:20.01]离开那些 曾吞没你的欲望吧
[01:26.18]克林 人生是偶然
[01:31.81]在自己的路上 义无反顾的狂奔吧
[02:08.25]喝茶和赏雨已经不再让我安详
[02:14.08]偶然又一起跨上摩托冲到边境
[02:19.97]排气狂暴轰鸣中跨过半省
[02:25.91]大山湿雾弥漫里吐出烟气
[02:31.96]克林 上路是偶然
[02:37.55]如鲸向海 请取笑那些苦难吧
[02:43.92]克林 人生是偶然
[02:49.47]依旧浪漫 尽管你知道后来啊
[02:55.80]克林 上路是偶然
[03:02.28]离开那些 曾吞没你的欲望吧
[03:08.59]克林 人生是偶然
[03:14.02]在自己的路上 义无反顾的狂奔吧
[03:44.45]克林 上路是偶然
[03:50.01]如鲸向海 请取笑那些苦难吧
[03:56.34]克林 人生是偶然
[04:01.96]依旧浪漫 尽管你知道后来啊
[04:08.29]克林 上路是偶然
[04:13.93]离开那些 曾吞没你的欲望吧
[04:20.22]克林 人生是偶然
[04:25.79]在自己的路上 义无反顾的狂奔吧!
[04:39.91](克林)
[04:42.90](克林……慢点儿!)
[04:47.92]编曲:陈恒冠/陈恒家
[04:50.90]吉他:陈恒家/龚培超
[04:52.90]录音:陈恒家@1019Studio
[04:54.90]混音:陈恒家
[04:58.90]摩托:克林&(春风650MT)

6、参考

  • 用Python实现视频\音乐\图片下载自由

相关文章:

  • 使用京东AsyncTool实现异步编排
  • 4、IP查找工具-Angry IP Scanner
  • 用deepseek学大模型03-数学基础 概率论 条件概率 全概率公式 贝叶斯定理
  • 周雨彤:用角色与生活,诠释审美的艺术
  • 1、cadence从零开始让一个VCO起振——基本设置
  • MATLAB算法实战应用案例精讲-【数模应用】空间插值(附MATLAB、R语言和python代码实现)
  • JavaScript设计模式 -- 迭代器模式
  • 【信息学奥赛一本通 C++题解】1285:最大上升子序列和
  • 同花顺数据爬取并生成K线
  • 【SpringBoot苍穹外卖】debugDay0 打开前端页面
  • sed命令详细教程
  • 力扣-二叉树-513 找二叉树左下角的值
  • FFmpeg 全面知识大纲梳理
  • 【LLM】浙大: 大模型基础 第一版 第一章:语言模型基础
  • CMake configure_file
  • Mycat中间件
  • 实现能源高效利用、优化能源结构、降低碳排放的智慧能源开源了
  • COBOL语言的移动应用开发
  • 第1章大型互联网公司的基础架构——1.3 HTTP-DNS
  • ### net7 + 出现了 自带的 限流中间件 固定窗口、滑动窗口 并发 令牌桶 全局限流器
  • 金砖国家外长会晤主席声明(摘要)
  • 国务院食安办:加强五一假期食品生产、销售、餐饮服务环节监管
  • 强制性国家标准《危险化学品企业安全生产标准化通用规范》发布
  • 探索演艺产业新路径,2万观众走进音乐科技融创节
  • 韩国下届大选执政党初选4进2结果揭晓,金文洙、韩东勋胜出
  • 阿里开源首个“混合推理模型”:集成“快思考”、“慢思考”能力