如何下载YouTubevideo?

有关如何从YouTube下载video的说明是什么?


注意:TOS违规

请注意,通过以下任何答案,您将违反YouTube的服务条款 。

  • 第5.b节:

    内容按原样提供给您。 您可以通过本服务提供的function以及本服务条款允许的方式,仅根据预期访问内容以供您参考和使用。 除非您在服务上看到YouTube上显示的“下载”或类似链接,否则您不得下载任何内容。 未经YouTube或内容的相应许可方事先书面同意,您不得出于任何其他目的复制,复制,分发,传播,广播,展示,出售,许可或以其他方式利用任何内容。 YouTube及其许可方保留未在服务和内容中明确授予的所有权利。


youtube-dl是下载YouTubevideo的绝佳工具。 使用以下命令安装它:

sudo apt-get install youtube-dl 

然后以这种方式使用它:

 youtube-dl [VIDEO_LINK] 

要了解有关高级选项的更多信息,请运行

 man youtube-dl 

或者查看文档 。

原始答案:

对于Firefox用户:

您可以在Firefox中安装Video DownloadHelper插件并下载任何嵌入的对象,包括YouTubevideo。

在此输入图像描述

在此输入图像描述

 sudo apt-get install youtube-dl 

要么

 sudo pip install youtube-dl 

为YouTube安装命令行模式下载程序。

然后跑

 youtube-dl YouTube-(or-other-website)-video-link 

所以它会下载video。

您还可以查看有关如何使用它的非常深入的文档。

Minitube公司

安装minitube

Minitube是一款YouTube桌面应用程序。 有了它,您可以以全新的方式观看YouTubevideo:您输入关键字,Minitube为您提供无限的video流。 Minitube不是要克隆原始的YouTube网络界面,而是旨在创造一种类似电视的新体验。

它不需要Flash Player 。 在此应用程序中,您可以观看和下载video。


Screenshoot1

Screenshoot2

我认为从YouTube下载video而不安装任何插件或软件的最简单方法是使用savefrom.net 。 以下是使用ss技巧演示如何下载YouTubevideo的video 。 假设您要下载以下video:

视频下载

在地址栏上,在youtube.com前面添加ss ,然后按Enter键

如何

现在,您将被重定向到savefrom.net 。 在您的右侧,单击要下载的video质量。

下载

cclive 安装cclive

我们可以使用这款易于使用的命令行工具从YouTube或其他流媒体网站下载免费内容。

cclive主要是一个“video下载工具”,但它也可以与video播放器软件一起使用,如“mplayer”,用于观看流式video而不是Adobe Flash播放器。

要从指定位置下载video(在YouTube上按“共享”按钮以获取video的url)。 复制此链接并使用以下命令从终端发出clive:

 cclive -s best http://youtu.be/D6z6hn6wZlg 

还有很多其他选项可以控制下载行为,包括选择下载格式的选项,这些选项都在联机帮助页中有详细说明。 我们还可以从文件中排队URL列表。

(已将-f更改为-s; -f已弃用)。

首先,如果你没有wget ,请安装它:

 sudo apt-get install wget 

使用此Perl脚本:

 #!/usr/bin/perl -T use strict; use warnings; # ## Calomel.org ,:, Download YouTube videos and music using wget ## Script Name : youtube_wget_video.pl ## Version : 0.38 ## Valid from : March 2014 ## URL Page : https://calomel.org/youtube_wget.html ## OS Support : Linux, Mac OSX, OpenBSD, FreeBSD or any system with perl # `:` ## Two arguments ## $1 YouTube URL from the browser ## $2 Prefix to the file name of the video (optional) # ############ options ########################################## # Option: what file type do you want to download? The string is used to search # in the YouTube URL so you can choose mp4, webm, avi or flv. mp4 seems to # work on the most players like Android, iPod, iPad, iPhones, VLC media player # and MPlayer. my $fileType = "mp4"; # Option: what visual resolution or quality do you want to download? List # multiple values just in case the highest quality video is not available, the # script will look for the next resolution. You can choose "highres" for 4k, # "hd1080" for 1080p, "hd720" for 720p, "itag=18" which means standard # definition 640x380 and "itag=17" which is mobile resolution 144p (176x144). # The script will always prefer to download the highest resolution video format # from the list if available. my $resolution = "hd720,itag=18"; # Option: How many times should the script retry the download if wget fails for # any reason? Do not make this too high as a reoccurring error will just hit # YouTube over and over again. my $retryTimes = 5; # Option: do you want the resolution of the video in the file name? zero(0) is # no and one(1) is yes. This option simply puts "_hd1080.mp4" or similar at the # end of the file name. my $resolutionFilename = 0; # Option: turn on DEBUG mode. Use this to reverse engineering this code if you are # making changes or you are building your own YouTube download script. my $DEBUG=0; ################################################################# ## Initialize retry loop and resolution variables $ENV{PATH} = "/bin:/usr/bin:/usr/local/bin"; my $prefix = ""; my $retry = 1; my $retryCounter = 0; my $resFile = "unknown"; my $user_url = ""; my $user_prefix = ""; ## Collect the URL from the command line argument chomp($user_url = $ARGV[0]); my $url = "$1" if ($user_url =~ m/^([a-zA-Z0-9\_\-\&\?\=\:\.\/]+)$/ or die "\nError: Illegal characters in YouTube URL\n\n" ); ## Declare the user defined file name prefix if specified if (defined($ARGV[1])) { chomp($user_prefix = $ARGV[1]); $prefix = "$1" if ($user_prefix =~ m/^([a-zA-Z0-9\_\-\.\ ]+)$/ or die "\nError: Illegal characters in filename prefix\n\n" ); } ## Retry getting the video if the script fails for any reason while ( $retry != 0 && $retryCounter < $retryTimes ) { ## Download the html code from the YouTube page suppling the page title and the ## video URL. The page title will be used for the local video file name and the ## URL will be sanitized and passed to wget for the download. my $html = `wget -4Ncq -e convert-links=off --keep-session-cookies --save-cookies /dev/null --no-check-certificate "$url" -O-` or die "\nThere was a problem downloading the HTML file.\n\n"; ## Format the title of the page to use as the file name my ($title) = $html =~ m/(.+)<\/title>/si; $title =~ s/[^\w\d]+/_/g or die "\nError: we could not find the title of the HTML page. Check the URL.\n\n"; $title =~ s/_youtube//ig; $title =~ s/^_//ig; $title = lc ($title); $title =~ s/_amp//ig; ## Collect the URL of the video from the HTML page my ($download) = $html =~ /"url_encoded_fmt_stream_map"(.*)/ig; # Print all of the separated strings in the HTML page print "\n$download\n\n" if ($DEBUG == 1); # This is where we look through the HTMl code and select the file type and # video quality. my @urls = split(',', $download); OUTERLOOP: foreach my $val (@urls) { # print "\n$val\n\n"; if ($val =~ /$fileType/) { my @res = split(',', $resolution); foreach my $ress (@res) { if ($val =~ /$ress/) { print "\n\nGOOD\n\n" if ($DEBUG == 1); print "$val\n" if ($DEBUG == 1); $resFile = $ress; $resFile = "sd640" if ( $ress =~ /itag=18/ ); $resFile = "mobil176" if ( $ress =~ /itag=17/ ); $download = $val; last OUTERLOOP; } } } } ## Clean up the URL by translating unicode and removing unwanted strings $download =~ s/\:\ \"//; $download =~ s/%3A/:/g; $download =~ s/%2F/\//g; $download =~ s/%3F/\?/g; $download =~ s/%3D/\=/g; $download =~ s/%252C/%2C/g; $download =~ s/%26/\&/g; $download =~ s/sig=/signature=/g; $download =~ s/\\u0026/\&/g; $download =~ s/(type=[^&]+)//g; $download =~ s/(fallback_host=[^&]+)//g; $download =~ s/(quality=[^&]+)//g; ## Clean up the URL my ($youtubeurl) = $download =~ /(http?:.+)/; ## URL title additon my ($titleurl) = $html =~ m/(.+)<\/title>/si; $titleurl =~ s/ - YouTube//ig; $titleurl =~ s/ /%20/ig; ## Combine the YouTube URL and title string $download = "$youtubeurl\&title=$titleurl"; ## A bit more cleanup as YouTube $download =~ s/&+/&/g; $download =~ s/&itag=\d+&signature=/&signature=/g; ## Combine file variables into the full file name my $filename = "unknown"; if ($resolutionFilename == 1) { $filename = "$prefix$title\_$resFile.$fileType"; } else { $filename = "$prefix$title.$fileType"; } ## Process check: Are we currently downloading this exact same video? Two of the ## same wget processes will overwrite themselves and corrupt the video. my $running = `ps auwww | grep [w]get | grep -c "$filename"`; print "\nNumber of the same wgets running: $running\n" if ($DEBUG == 1); if ($running >= 1) { print "\nAlready $running process, exiting." if ($DEBUG == 1); exit 0; }; ## Print the long, sanitized YouTube URL for testing and debugging print "\n$download\n" if ($DEBUG == 1); ## Print the file name of the video collected from the web page title for us to see on the cli print "\n Download: $filename\n\n"; ## Background the script. Use "ps" if you need to look for the process ## running or use "ls -al" to look at the file size and date. fork and exit; ## Download the video system("wget", "-4Ncq", "-e", "convert-links=off", "--load-cookies", "/dev/null", "--tries=10", "--timeout=20", "--no-check-certificate", "$download", "-O", "$filename"); ## Print the error code of wget print " error code: $?\n" if ($DEBUG == 1); ## Exit Status: Check if the file exists and we received the correct error code ## from system call. If the download experienced any problems the script will run again and try ## continue the download till the file is downloaded. if ($? == 0 && -e "$filename" && ! -z "$filename") { print " Finished: $filename\n\n" if ($DEBUG == 1); $retry = 0; } else { print STDERR "\n FAILED: $filename\n\n" if ($DEBUG == 1); $retry = 1; $retryCounter++; sleep $retryCounter; } } # while #### EOF ##### 

将此脚本复制到.txt文件并将其重命名为youtube_wget.pl

使用以下命令使其可执行:

 chmod 755 youtube_wget.pl 

如果要在终端中下载,请键入:

 ./youtube_wget.pl http://www.youtube.com/watch?v=ejkm5uGoxs4 

将YouTubeurl更改为您的YouTubevideourl。

保存位置:video将保存在当前目录中。

来源: YouTube下载Wget Perl脚本

对于Firefox用户:

由于我对这个问题的回答在这里可能更有效,为了方便我会在这里提出。

您可以使用flashgot ,这是Firefox的插件,我发现这对于从YouTube和其他网站下载video非常有用。 (但是,您仍然需要在浏览器中使用flash-plugin才能通过flashgot检测video。)

  • 从官方Mozilla插件站点安装flashgot并重启Firefox。 确保已启用插件; 通过菜单工具插件扩展程序进行检查 。 从扩展选项卡中的flashgot条目,您还可以设置许多首选项。

  • 导航到您的YouTubevideo并在YouTubevideo设置中设置质量 ,然后开始播放video几秒钟,然后暂停播放。

  • 右键单击YouTube页面并选择flashgot media ; 可能会有不止一个video; 要么只是简单地下载它们,要么选择更大的文件大小(这将是更高质量的video)。 您可以使用浏览器的下载管理器或通过flashgot options设置的其他程序。

在此输入图像描述

4kdownloader! 除了从URL下载video外,它还可以下载整个播放列表,并根据需要将其转换为MP3或其他格式。

http://www.4kdownload.com/

我使用它很长一段时间,它简单易用,它有一个Ubuntu的GUI界面。

在此输入图像描述

UPDATE

不再维护bytubed。 因此,新的解决方案将采用着名的命令行youtube-dl 。 它定期维护并运行良好。

  1. 要更新它

     youtube-dl -U 
  2. 并下载video或播放列表

     youtube-dl -c -t URL_HERE 
  3. 如果有一个带有URL的文件那么

     youtube-dl -c -t -a urls.txt 

老答案

我知道它已经回答了,但我很震惊,没有人明确提到过Bytubed 。 对于YouTube下载,这对我来说是最好的。 只需安装它然后转到Firefox的菜单工具Bytubed

唯一的缺点是它只适用于Firefox,但对我来说这并不是一个缺点,因为我使用Firefox进行所有浏览…

我想建议一种使用VLC媒体播放器下载YouTubevideo的方法,只需四个步骤:

  1. 在VLC媒体播放器中打开video链接作为网络流媒体。
  2. 选择媒体信息并复制位置
  3. 将其粘贴到浏览器的地址栏中
  4. 保存。

有关屏幕截图的详细信息,请访问此处 – http://www.superpctricks.com/2013/12/download-youtube-videos-easily-with-vlc.html

要安装youtube-dl

  • 推荐方式(最新版):

    1. 使用Ctrl + Alt + T打开终端或在短划线中搜索终端
    2. 使用此命令安装youtube-dl (系统将提示您输入密码):

       sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl && sudo chmod a+x /usr/local/bin/youtube-dl 
  • 不推荐的方式(旧版本):

    1. 使用Ctrl + Alt + T打开终端或在短划线中搜索终端
    2. 使用此命令安装youtube-dl (系统将提示您输入密码):

       sudo apt-get install youtube-dl 

要使用youtube-dl

  1. 要选择保存video的位置,您可以按照以下步骤操作:
    • 在终端上键入cd
    • 新闻空间
    • 从文件管理器中拖动文件夹并将其放在终端上。
    • 如果您跳过此步骤,video将保存在您的主文件夹中。
  2. 要下载video,您可以使用以下过程之一:

    2.1。 运行youtube-dl video_url ,其中video_url是video的url。

    2.2。 如果您要下载许多video,可以按照以下步骤而不是2.1:

    • 运行以下命令:

       xargs youtube-dl 
    • 对每个链接重复以下过程:
      • 粘贴链接。
      • Enter键
    • Ctrl + D.

    2.3。 如果你有一个带有链接列表的纯文本文件,你可以这样下载它们:

    • 在终端上键入cat
    • 新闻空间
    • 从文件管理器拖动文件并将其放在终端上。
    • 新闻空间
    • 输入| xargs youtube-dl | xargs youtube-dl
    • Enter键
  3. 现在video将下载到所选文件夹。


最后的一些想法:

  • 在方法2.3上,最终命令应如下所示:

     cat '/home/foo/Desktop/myawesomevideos.txt' | xargs youtube-dl 
  • 您还可以使用频道的url, youtube-dl将保存整个频道。
  • 您可以使用sudo youtube-dl -U更新youtube-dl
  • 你可以通过youtube-dl --help查看youtube-dl所有选项

感谢用户185719和MichaelGrünewald ,这是对这个答案的贡献。

不需要插件。 这是一个简单而出色的解决方案:

http://code.google.com/p/get-flash-videos/

您也可以尝试使用Clipgrab。 它可以通过剪贴板从YouTube下载video,也可以通过应用程序搜索video。 PPA就在这里 。

您可以使用以下命令:

 sudo add-apt-repository ppa:clipgrab-team/ppa sudo apt-get update && sudo apt-get install clipgrab 

你可以尝试ytd-gtk 。 它是youtube-dl的图形前端,可以从各种video网站下载。

您可以使用Python命令行程序youtube-dl

  1. 要安装程序youtube-dl,请在终端中键入以下命令:

     $ sudo apt-get install python-pip $ sudo pip install --upgrade youtube_dl 
  2. 要从终端下载YouTubevideo,请使用:

     $youtube-dl  
  3. 要查看可用的不同质量和格式,请使用option -F 。 然后使用选项-F后显示的格式代码 ,以所需格式下载。

    $ youtube-dl -F $ youtube-dl -f

  4. 要下载整个播放列表使用

     $ youtube-dl -citw  
  5. 要下载整个频道使用

     $ youtube-dl -citw ytuser: 

下载YouTubevideo的方式有很多种。

应用:

我个人使用MiniTube作为从YouTube获取video的首选应用程序。 这是一个非常简单的方法。 按关键字查找video,然后下载。

命令行:

如果您对终端应用程序中的命令行界面(或已知的CLI)感到满意,请尝试使用youtube-dl命令行方法。

网站:

像MediaConvertor或Vixy Freecoder这样的网站可以做到这一点, 而无需为Firefox或Chrome / Chromium或本机应用程序安装扩展

这两个网站允许您以不同的格式下载。 音频和video格式。 您插入其网站上video的链接并等待转换完成,然后您将获得下载链接。

这些网站的好处是它们是跨平台的,就像扩展方法一样。 但是如果你想让你的浏览器免于额外的东西混乱,那么试试网站或其他人提到的其他建议。

这些答案复杂了,所以我会在没有安装任何东西的情况下帮助你。

首先转到浏览器并在URL选项卡中输入。

接下来,在第一个框中输入YouTubeurl。 例如,我将使用Ubuntu YouTube链接。 YouTube链接图片

然后按继续

现在,一旦你按下继续 ,这将弹出。 YouTube图片

在“ 检测到的媒体”选项卡上,您可以选择video的质量。

720p高清总共480 便士360pSQ3GPMV

每种类型的质量都会占用内存和下载时间,具体取决于您的互联网。 只是乱七八糟,看看你喜欢什么。

现在,在“ 文件名”选项卡上,您可以在下载video时更改video名称。 这是完全可选的,因为您可以在右键单击时使用重命名选项卡更改名称。

接下来,您可以更改所需的video类型 。 例如,您希望它可以放在iPod上,您可以轻松将其更改为MP3。

我强烈建议使用最常用的MP4

文件扩展器

最后,您现在可以按开始! 按钮开始下载! Start button

请享用! =)

截至目前,有一个流行的Youtube-dl的GUI可用。 您可以在哪里手动配置所有设置,只需从链接粘贴和下载。 要安装它:

 sudo apt-add-repository ppa:nilarimogard/webupd8 sudo apt-get update sudo apt-get install youtube-dlg 

在此处输入图像描述

userscripts.org上有这个Greasemonkey脚本 。 但我无法保证。 我也不能断言这种剧本的安全性。

但似乎有效。

您需要安装Greasemonkey 。

用小shell脚本解决:

 #!/bin/bash # # grabflash # # Finds any cached Flash videos in the kernel file handles list # and copies them to the user Videos folder ; this gets around # the new Flash players habit of opening a cache file in /tmp # and immediately deleting it. # # Usage: Play the video until it's all cached. Run script. # The video will be copied to ~/Videos folder as FLV. # for I in $(pgrep -f libflashplayer.so) do ls -l /proc/$I/fd/* | \ grep '/tmp/Flash' | \ grep -o "/proc/$I/fd/\\S*" | \ xargs --no-run-if-empty cp -t ~/Videos/ done 

默认情况下,Google Chrome不支持YouTube下载扩展程序。

但幸运的是,我们可以手动安装Google Chrome扩展程序 ,这就是您将第三方扩展程序(如SaveForm)安装到Chrome的方式,您可以通过点击“下载”按钮下载YouTube(以及许多其他网站)上的任何video,video下方。

此扩展适用于Opera Next,Firefox和Safari浏览器。 它们在最新的Ubuntu操作系统上都很有魅力。

资料来源: Video TutsDB

还有一些选择:

MediaHuman软件

  • YouTube到mp3是专有但免费的(如啤酒)。 在Ubuntu上工作得很漂亮,非常容易使用。 可在Ubuntu软件中心使用 。 在此处输入图像描述
  • YouTube Downloader也是专有但不是免费的。 您可以从首页获取免费试用版。 不适用于南加州大学。

    在此处输入图像描述

  • 还有YouTube到MP3转换器 ,其function与YouTube相同,但支持更多网站。 这个也是免费的。

YouTube中心

YouTube中心是Chrome,Firefox,Opera和其他浏览器的开源扩展程序,可通过许多附加function增强YouTube。 这些function包括能够以各种不同格式直接下载YouTubevideo:

在此处输入图像描述

我总是建议安装扩展的开发者版本 ,因为它附带了最新的错误修复和新function。

对于Firefox用户:

要使用Firefox下载YouTubevideo,只需访问以下网站即可下载适用于Firefox的扩展程序:

https://addons.mozilla.org/en-US/firefox/addon/download-youtube/

下载youtube-dl

 wget https://yt-dl.org/downloads/2014.08.10/youtube-dl chmod a+x youtube-dl 

下载video:

 ./youtube-dl https://www.youtube.com/watch?v=QRPVy_t1_IE 

下载特定格式

查看格式:

 ./youtube-dl https://www.youtube.com/watch?v=QRPVy_t1_IE -F 

使用-f 下载它:

 ./youtube-dl https://www.youtube.com/watch?v=QRPVy_t1_IE -f 38 
  1. 复制您正在观看的YouTubevideo的url
  2. 打开一个新标签,然后点击www.keepvid.com
  3. 您将在页面顶部找到一个文本框。 将已复制的URL粘贴到框中,然后单击“ 下载”
  4. 出现提示时运行Java小程序(您必须在系统上安装Java,否则这将无效)
  5. 完成后,您将拥有各种格式和质量的video,右键单击您认为最合适的video,然后单击“ Save Link As并保存。

我刚刚为我的Ubuntu 14.04(Trusty Tahr)做了这个。

你应该尝试clipgrab 。 除了无法下载超过1080p质量的video这一事实外,它还是一个非常适合YouTube下载的快速GUI。

这是64 版和32 版 。 只需从Ubuntu软件中心下载并安装即可。

然后你直接下载video。 如果你想要其他可用的格式(* .mp3以及更多’有人说它有用’),你将需要FFmpeg和libavcodec-extra-53。

所以跑

 $ sudo apt-get install libavcodec-extra-53 $ sudo apt-get install ffmpeg 

它真的很方便。

我使用的是All Video Downloader

这是我对Linux最了解的。 只需复制video的地址并打开所有video下载程序 ,您将看到URL已经存在。修复输出格式和目标后,只需按下下载并准备就绪;)

来自SM Team的一个很棒的应用程序称为SmTube

您可以通过以下方式安装SmTube:

 sudo add-apt-repository ppa:rvm/smplayer sudo apt-get update sudo apt-get install smtube 

或者从这里下载!!

在此输入图像描述

搜索任何video(您要下载的video),然后右键单击video并单击“录制video”。

在此输入图像描述

通过设置,您可以调整video的质量和保存video的目的地:

在此输入图像描述

在此输入图像描述

在Linux上,您可以轻松下载没有这些限制,等待时间和垃圾邮件的网站。 您可以下载单个video,多个video甚至是播放列表。 正如其他人所说, youtube-dl就是解决方案。 您还可以选择下载媒体文件类型。

观看此video,了解有关安装和使用youtube-dlg的完整教程 – https://www.youtube.com/watch?v=rEDNcs23YAQ&t=11s