avatarMore Less

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

5615

Abstract

24.9 MiB (26130838 bytes)</span> <span class="hljs-comment"># download-with: you-get --itag=135 [URL]</span></pre></div><div id="d8b1"><pre><span class="hljs-bullet">-</span> <span class="hljs-string">itag: 244</span> <span class="hljs-attribute">container</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> webm</span> <span class="hljs-attribute">quality</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 854x480</span> <span class="hljs-attribute">size</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 20.6 MiB (21562584 bytes)</span> <span class="hljs-comment"># download-with: you-get --itag=244 [URL]</span></pre></div><div id="b9bb"><pre><span class="hljs-bullet">-</span> <span class="hljs-string">itag: 134</span> <span class="hljs-attribute">container</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> mp4</span> <span class="hljs-attribute">quality</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 640x360</span> <span class="hljs-attribute">size</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 14.2 MiB (14863399 bytes)</span> <span class="hljs-comment"># download-with: you-get --itag=134 [URL]</span></pre></div><div id="34f8"><pre><span class="hljs-bullet">-</span> <span class="hljs-string">itag: 243</span> <span class="hljs-attribute">container</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> webm</span> <span class="hljs-attribute">quality</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 640x360</span> <span class="hljs-attribute">size</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 13.6 MiB (14308835 bytes)</span> <span class="hljs-comment"># download-with: you-get --itag=243 [URL]</span></pre></div><div id="c2fb"><pre><span class="hljs-bullet">-</span> <span class="hljs-string">itag: 242</span> <span class="hljs-attribute">container</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> webm</span> <span class="hljs-attribute">quality</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 426x240</span> <span class="hljs-attribute">size</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 8.9 MiB (9302263 bytes)</span> <span class="hljs-comment"># download-with: you-get --itag=242 [URL]</span></pre></div><div id="d4b6"><pre><span class="hljs-bullet">-</span> <span class="hljs-string">itag: 133</span> <span class="hljs-attribute">container</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> mp4</span> <span class="hljs-attribute">quality</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 426x240</span> <span class="hljs-attribute">size</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 8.8 MiB (9266854 bytes)</span> <span class="hljs-comment"># download-with: you-get --itag=133 [URL]</span></pre></div><div id="1b40"><pre><span class="hljs-bullet">-</span> <span class="hljs-string">itag: 278</span> <span class="hljs-attribute">container</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> webm</span> <span class="hljs-attribute">quality</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 256x144</span> <span class="hljs-attribute">size</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 6.5 MiB (6845295 bytes)</span> <span class="hljs-comment"># download-with: you-get --itag=278 [URL]</span></pre></div><div id="8370"><pre><span class="hljs-bullet">-</span> <span class="hljs-string">itag: 160</span> <span class="hljs-attribute">container</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> mp4</span> <span class="hljs-attribute">quality</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 256x144</span> <span class="hljs-attribute">size</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 6.1 MiB (6445955 bytes)</span> <span class="hljs-comment"># download-with: you-get --itag=160 [URL]</span></pre></div><div id="84f1"><pre>[ DEFAULT ] <span class="hljs-strong"></span><span class="hljs-strong"></span><span class="hljs-strong"></span><span class="hljs-strong"></span><span class="hljs-strong"></span><span class="hljs-strong"></span><span class="hljs-strong"></span><span class="hljs-strong"></span>_ <span class="hljs-bullet"> -</span> itag: 22 <span class="hljs-code"> container: mp4 quality: hd720 size: 37.2 MiB (39023386 bytes) # download-with: you-get --itag=22 [URL]</span></pre></div><div id="ff2c"><pre><span class="hljs-bullet">-</span> <span class="hljs-string">itag: 43</span> <span class="hljs-attribute">container</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> webm</span> <span class="hljs-attribute">quality</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> medium</span> <span class="hljs-comment"># download-with: you-get --itag=43 [URL]</span></pre></div><div id="df60"><pre><span class="hljs-bullet">-</span> <span class="hljs-string">itag: 18</span> <sp

Options

an class="hljs-attribute">container</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> mp4</span> <span class="hljs-attribute">quality</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> medium</span> <span class="hljs-comment"># download-with: you-get --itag=18 [URL]</span></pre></div><div id="9f94"><pre><span class="hljs-bullet">-</span> <span class="hljs-string">itag: 36</span> <span class="hljs-attribute">container</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 3gp</span> <span class="hljs-attribute">quality</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> small</span> <span class="hljs-comment"># download-with: you-get --itag=36 [URL]</span></pre></div><div id="1d93"><pre><span class="hljs-bullet">-</span> <span class="hljs-string">itag: 17</span> <span class="hljs-attribute">container</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> 3gp</span> <span class="hljs-attribute">quality</span><span class="hljs-punctuation">:</span> <span class="hljs-string"> small</span> <span class="hljs-comment"># download-with: you-get --itag=17 [URL]</span></pre></div><p id="e4c6">缺省是使用-itag=22下载720p的mp4文件,下载视频文件和字幕文件(如果自带字幕的话)。1080p的文件不带声音,要跟webm合成才行。</p><div id="662b"><pre> you-get https:<span class="hljs-comment">//www.youtube.com/watch?v=dfnCAmr569k</span> <span class="hljs-symbol">site:</span> YouTube <span class="hljs-symbol">title:</span> Taylor Swift - End Game ft. Ed Sheeran, Future <span class="hljs-symbol">stream:</span> - itag: <span class="hljs-number">22</span> <span class="hljs-symbol"> container:</span> mp4 <span class="hljs-symbol"> quality:</span> hd720 <span class="hljs-symbol"> size:</span> <span class="hljs-number">37.2</span> MiB (<span class="hljs-number">39023386</span> bytes) <span class="hljs-meta"># download-with: you-get --itag=22 [URL]</span></pre></div><div id="5b92"><pre><span class="hljs-attribute">Downloading</span> Taylor Swift - End Game ft. Ed Sheeran, Future.mp4 ... <span class="hljs-attribute">100</span>% ( <span class="hljs-number">37</span>.<span class="hljs-number">2</span>/ <span class="hljs-number">37</span>.<span class="hljs-number">2</span>MB) ├████████████████████████████████████████████████████████████████████████████████┤[<span class="hljs-number">1</span>/<span class="hljs-number">1</span>] <span class="hljs-number">14</span> MB/s</pre></div><div id="87ce"><pre>Saving Taylor Swift - <span class="hljs-keyword">End</span> Game <span class="hljs-built_in">ft</span>. Ed Sheeran, Future.en.srt ... Done. <span class="hljs-variable"></span> <span class="hljs-built_in">ls</span> Taylor Swift - <span class="hljs-keyword">End</span> Game <span class="hljs-built_in">ft</span>. Ed Sheeran, Future.en.srt Taylor Swift - <span class="hljs-keyword">End</span> Game <span class="hljs-built_in">ft</span>. Ed Sheeran, Future.mp4</pre></div><p id="8c3c">在使用过程中,可能会遇到说console不支持unicode的错误,如下:</p><div id="79c9"><pre>you-<span class="hljs-built_in">get</span>: [error] oops, <span class="hljs-keyword">the</span> current environment does <span class="hljs-keyword">not</span> seem <span class="hljs-built_in">to</span> support Unicode. you-<span class="hljs-built_in">get</span>: please <span class="hljs-built_in">set</span> <span class="hljs-keyword">it</span> <span class="hljs-built_in">to</span> <span class="hljs-keyword">a</span> UTF<span class="hljs-number">-8</span>-aware locale <span class="hljs-keyword">first</span>, you-<span class="hljs-built_in">get</span>: so <span class="hljs-keyword">as</span> <span class="hljs-built_in">to</span> save <span class="hljs-keyword">the</span> video (<span class="hljs-keyword">with</span> some Unicode <span class="hljs-keyword">characters</span>) correctly. you-<span class="hljs-built_in">get</span>: you can <span class="hljs-built_in">do</span> <span class="hljs-keyword">it</span> like this: you-<span class="hljs-built_in">get</span>: (Windows) % chcp <span class="hljs-number">65001</span> you-<span class="hljs-built_in">get</span>: (Linux) LC_CTYPE=en_US.UTF<span class="hljs-number">-8</span></pre></div><p id="7ddc">没有关系,只要安装locales就可以了。</p><p id="5702">Check that you have the <code>locales</code> package installed</p><div id="f4e8"><pre><span class="hljs-attribute">dpkg -l locales</span></pre></div><p id="9051">If not, install it</p><div id="661d"><pre>apt-<span class="hljs-built_in">get</span> install locales</pre></div><p id="2b35">Run the <code>locale</code>command ,the output should be similar to this:</p><div id="c5fd"><pre> locale LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE=<span class="hljs-string">"en_US.UTF-8"</span> LC_NUMERIC=<span class="hljs-string">"en_US.UTF-8"</span> LC_TIME=<span class="hljs-string">"en_US.UTF-8"</span> LC_COLLATE=<span class="hljs-string">"en_US.UTF-8"</span> LC_MONETARY=<span class="hljs-string">"en_US.UTF-8"</span> LC_MESSAGES=<span class="hljs-string">"en_US.UTF-8"</span> LC_PAPER=<span class="hljs-string">"en_US.UTF-8"</span> LC_NAME=<span class="hljs-string">"en_US.UTF-8"</span> LC_ADDRESS=<span class="hljs-string">"en_US.UTF-8"</span> LC_TELEPHONE=<span class="hljs-string">"en_US.UTF-8"</span> LC_MEASUREMENT=<span class="hljs-string">"en_US.UTF-8"</span> LC_IDENTIFICATION=<span class="hljs-string">"en_US.UTF-8"</span></pre></div><p id="9155">这样就👌了。要是想把youtube的视频直接转成MP3,可以安装ffmpeg,然后使用youtube-dl这个工具下载和直接转换。</p></article></body>

使用you-get下载视频网站的视频

you-get是一个open source的用python写的工具,支持多个网站视频的下载。包括国内的视频网站像B站,腾讯视频也支持。

安装很容易,可以从github网站直接使用git clone:

git clone git://github.com/soimort/you-get.git

或者可以用pip安装。需要注意的是,必须使用python3带的pip安装。

pip3 install you-get

debian Jessie自带的python3 是3.5,要想安装最新的python 3.6,可以使用如下命令:

$ sudo nano /etc/apt/sources.list
# add
deb http://ftp.de.debian.org/debian testing main
$ echo 'APT::Default-Release "stable";' | sudo tee -a /etc/apt/apt.conf.d/00local
$ sudo apt-get update
$ sudo apt-get -t testing install python3.6
$ python3.6 -V
$ sudo apt-get -t testing install python3-pip
$ pip3 -V

pip3安装了以后,就可以开心安装you-get了。

you-get -i 显示所有可以下载的youtube视频资源选项。

$ you-get -i https://www.youtube.com/watch?v=dfnCAmr569k
site:                YouTube
title:               Taylor Swift - End Game ft. Ed Sheeran, Future
streams:             # Available quality and codecs
    [ DASH ] ____________________________________
    - itag:          137
      container:     mp4
      quality:       1920x1080
      size:          53.1 MiB (55640658 bytes)
    # download-with: you-get --itag=137 [URL]
- itag:          248
      container:     webm
      quality:       1920x1080
      size:          46.1 MiB (48389197 bytes)
    # download-with: you-get --itag=248 [URL]
- itag:          136
      container:     mp4
      quality:       1280x720
      size:          37.2 MiB (39036275 bytes)
    # download-with: you-get --itag=136 [URL]
- itag:          247
      container:     webm
      quality:       1280x720
      size:          30.8 MiB (32341782 bytes)
    # download-with: you-get --itag=247 [URL]
- itag:          135
      container:     mp4
      quality:       854x480
      size:          24.9 MiB (26130838 bytes)
    # download-with: you-get --itag=135 [URL]
- itag:          244
      container:     webm
      quality:       854x480
      size:          20.6 MiB (21562584 bytes)
    # download-with: you-get --itag=244 [URL]
- itag:          134
      container:     mp4
      quality:       640x360
      size:          14.2 MiB (14863399 bytes)
    # download-with: you-get --itag=134 [URL]
- itag:          243
      container:     webm
      quality:       640x360
      size:          13.6 MiB (14308835 bytes)
    # download-with: you-get --itag=243 [URL]
- itag:          242
      container:     webm
      quality:       426x240
      size:          8.9 MiB (9302263 bytes)
    # download-with: you-get --itag=242 [URL]
- itag:          133
      container:     mp4
      quality:       426x240
      size:          8.8 MiB (9266854 bytes)
    # download-with: you-get --itag=133 [URL]
- itag:          278
      container:     webm
      quality:       256x144
      size:          6.5 MiB (6845295 bytes)
    # download-with: you-get --itag=278 [URL]
- itag:          160
      container:     mp4
      quality:       256x144
      size:          6.1 MiB (6445955 bytes)
    # download-with: you-get --itag=160 [URL]
[ DEFAULT ] _________________________________
    - itag:          22
      container:     mp4
      quality:       hd720
      size:          37.2 MiB (39023386 bytes)
    # download-with: you-get --itag=22 [URL]
- itag:          43
      container:     webm
      quality:       medium
    # download-with: you-get --itag=43 [URL]
- itag:          18
      container:     mp4
      quality:       medium
    # download-with: you-get --itag=18 [URL]
- itag:          36
      container:     3gp
      quality:       small
    # download-with: you-get --itag=36 [URL]
- itag:          17
      container:     3gp
      quality:       small
    # download-with: you-get --itag=17 [URL]

缺省是使用-itag=22下载720p的mp4文件,下载视频文件和字幕文件(如果自带字幕的话)。1080p的文件不带声音,要跟webm合成才行。

$ you-get https://www.youtube.com/watch?v=dfnCAmr569k
site:                YouTube
title:               Taylor Swift - End Game ft. Ed Sheeran, Future
stream:
    - itag:          22
      container:     mp4
      quality:       hd720
      size:          37.2 MiB (39023386 bytes)
    # download-with: you-get --itag=22 [URL]
Downloading Taylor Swift - End Game ft. Ed Sheeran, Future.mp4 ...
 100% ( 37.2/ 37.2MB) ├████████████████████████████████████████████████████████████████████████████████┤[1/1]   14 MB/s
Saving Taylor Swift - End Game ft. Ed Sheeran, Future.en.srt ... Done.
$ ls
Taylor Swift - End Game ft. Ed Sheeran, Future.en.srt
Taylor Swift - End Game ft. Ed Sheeran, Future.mp4

在使用过程中,可能会遇到说console不支持unicode的错误,如下:

you-get: [error] oops, the current environment does not seem to support Unicode.
you-get: please set it to a UTF-8-aware locale first,
you-get: so as to save the video (with some Unicode characters) correctly.
you-get: you can do it like this:
you-get:     (Windows)    % chcp 65001 
you-get:     (Linux)      $ LC_CTYPE=en_US.UTF-8

没有关系,只要安装locales就可以了。

Check that you have the locales package installed

dpkg -l locales

If not, install it

apt-get install locales

Run the localecommand ,the output should be similar to this:

$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"

这样就👌了。要是想把youtube的视频直接转成MP3,可以安装ffmpeg,然后使用youtube-dl这个工具下载和直接转换。

Nodejs
Recommended from ReadMedium