centos yum安装后添加ngx_http_sub_module模块

  • 首先,获取本地安装的nginx版本 。
nginx -V
#记录下“configure arguments:”后面所有参数,第三步更新nginx时需要。

 

 

 

 

 

 

 

 

 

  • 其次,下载对应版本的源码。
wget http://nginx.org/download/nginx-1.8.0.tar.gz
tar -xvzf nginx-1.8.0.tar.gz
  • 更新替换nginx
#终止nginx
service nginx stop
#进入源码目录
cd nginx-1.8.0
#编译./configure 后面加上最开始让记录下来的那串字符,并在后面加上你要加的模块安装指令
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx……… --with-http_sub_module
#然后进行make,但是切记别安装
make
#别make_install!!!
#保持了原配置文件位置,所以直接测试nginx
./objs/nginx -t
#替换现有nginx
#备份 
mv /usr/sbin/nginx /usr/sbin/nginx-bak
#更新
cp ./objs/nginx /usr/sbin/nginx
#至此,添加完成,启动nginx。
service nginx start
  • 最后,再次查看nginx信息验证。
nginx -V

edu|edu邮箱|美国社区大学-多雨河社区学院申请教程 by Jaz

分享明尼苏达州的多雨河社区学院申请教程,特点是申请完就可以登录不用等, (现在要等)有两个邮箱,一个是明尼苏达州大学的邮箱,一个是多雨河社区学院的邮箱。使用office365系统,onedrive,office桌面版什么的都会有。

10.31更新:大家看到教程的图片是7月的,最近试了一下申请要审核,但还是通过了,没有申请的可以去申请一下。

申请时间:2017年10月28日(星期六) 凌晨3:37 (UTC-05:00 华盛顿、多伦多、古巴、智利时间)

通过时间:2017年10月31日(星期二) 晚上11:25(这个是北京时间)

Congratulations! You’re accepted to RRCC

  • 介绍

多雨河社区学院(Rainy River Community College,缩写:RRCC)位于明尼苏达州国际瀑布城,是一所小型公立两年制技术学院,成立于1967年,在校学生人数381。

多雨河社区学院隶属于明尼苏达学院及大学系统,提供5个领域的2年制的副学士学位和其他一些文凭课程,开设的专业领域较为广泛,较受欢迎的专业包括:文理科学、通识教育与人文科学,卫生科学及其相关服务,公园、娱乐、休闲与保健科学。

  • 申请大致过程

打开 申请地址

创建startid——记下ID号——填写资料

资料8项,包括
①Personal ——姓名,电子邮件,SSN,出生日期,服役状态,父母学历(自己编吧)
②Citizenship——选美国居民,
③Contact——明尼苏达州居民,居住几年自己编,添加一个Permanent Address(不知怎么找的可以直接搜明尼苏达州的酒店/地产的地址,之后改个门牌号就行了),联系电话(我用Google Voice)
④Education——我选不是在校高中生,有高中文凭,随便选个明尼苏达州的高中,High School Preparation Standards(这个好像是成绩之类的10满分,填高点就没错了),大学留空就可以
⑤Confidential(档案?)——性别,种族(自己编)
⑥Major——选学期,学习目标,选专业
⑦Additional——附加其他的课外活动,随便选几个

⑧Review 确认密码、提交

提交后你会看到result是accepted的,但会要求你付款,不用管它。

下面是部分截图

  • 登录邮箱

学校用的是office365系统

我也是后来才发现,是可以直接登录office365的,

具体参考:http://www.rainyriver.edu/student-services/technology-services.html

登录地址:https://login.microsoftonline.com/?whr=minnstate.edu
username: starid@go.minnstate.edu (enter your starid, example: ab1234cd@go.minnstate.edu)
password: enter your starid password
登录后你会发现没有分配许可证,我也不知道为什么,可能要等等吧,后面会分配的,有office365桌面。虽然还没分配许可证,但经测试邮箱已经可以收邮件的,直接登录outlook就可以了

outlook登录:https://outlook.office.com/

可以看到有两个邮箱地址的,一个是明尼苏达州大学的邮箱,一个是多雨河社区学院的邮箱,干什么用,自己发现吧。

  • 最后

很多人问社区大学的邮箱稳不稳?我个人觉得不稳,毕竟你没来上学,管理员说删你就删你,哪有稳不稳的,如果想用来存文件,请使用多个不同的账号进行备份。

End、

作者:jaz

原文地址:http://blog.jialezi.net/?post=62

【转载】[教程] 华硕路由器官方固件开机自动运行脚本方法

Asuswrt-Merlin (梅林)固件我以前玩过、国人改版的梅林我也玩过,因为没有使用代理隧道的需求,所以很早之前我就不使用第三方固件了。在我使用官方固件的这些时期,我一直很困惑,怎样才能像之前一样运行脚本?当然,我可以使用 telnet 或者 SSH 执行命令,但太费事了,而且没有办法按照我的需求开机自动运行,直到几天前我找到了方法,现在将我的经验分享出来。
以下教程以 “华硕路由器原厂固件开机后自动修改 hosts 文件” 为例。

你需要准备:一个 U盘(移动硬盘也可)一台路由器一台电脑

此教程当然也适用于 Asuswrt-Merlin 固件,Asuswrt-Merlin 拥有断电后仍可保留数据的 JFFS 分区,但是 Asuswrt-Merlin 在 JFFS 百科 中这样写道:

I do not recommend doing frequent writes to this area, as it will prematurely wear out the flash chip. This is a good place to put files that are written once like scripts or kernel modules, or that rarely get written to. Do not put files that get constantly written to (such as high activity logfiles) – store these on a USB disk instead. Replacing a worn out USB flash disk is much cheaper than replacing the whole router if flash sectors get worn out – they have a limited number of write cycles.

大意是:

我不建议经常向 JFFS 分区写入数据,这会使路由器的闪存过早报废,JFFS 分区适合存入如脚本或内核模块等写入量很小的文件,如果你要不断地存储数据(比如大量日志文件)我建议存放到 U盘 上,虽然两者写入量都是有限的,但更换 U盘 要比更换路由器闪存芯片成本更低。

所以,你可以用此教程将需要自启动的脚本等文件统统保存到 U盘 上,对于使用 Asuswrt-Merlin 固件的玩家来说,这是对路由器的一种保护。

在教程开始之前你需要知道:我是一个小白,不懂得如何编写脚本、甚至看不懂脚本,我只会拿别人现成的脚本放到路由器中。为了实现这篇教程的核心思想 “华硕路由器官方固件开机自动运行脚本” 我曾四处寻求帮助,我很高兴通过各种类型的帮助最终实现了目标,没有这些帮助就没有这篇教程,这篇教程将以叙事的形式展现,我将会在本篇教程中注明每一个帮助信息。

本教程重在寻找过程,如果你在意最终结果,请直接看本文最后一段脚本。

在几天前,我看到了这篇文章《ac68等arm迅雷、aria2安装小白教程及官固自启动插件教程》[1],标题中的 “官固自启动” 让我非常感兴趣,通过这篇文章我了解到:华硕路由器的 Download Master(下载大师)功能保存在 U 盘上,而华硕官方固件(或 Asuswrt-Merlin)可以运行 U 盘上的脚本,我们也可以将自己的脚本放在 U 盘上实现开机自动运行。
具体是如何实现的?
我向 52asus 的一位管理者 Master 寻求帮助,收到了如下回复

你尝试一下将任意脚本放到/opt/etc/init.d/ 中,并且以 S 开头

相对于 U 盘,是放到了 asusware.arm/etc/init.d/ 目录下
他建议我参考这篇文章《RT-AC66UB1 开机自动执行脚本》[2],这篇文章初期对我的帮助价值非常大,很贴近最终答案,不过由于后面有更好地解决方法,这篇文章不会被用于本教程。

于是,我就想到,我之前在 Asuswrt-Merlin 固件时用到的屏蔽广告脚本《AdBlocking with combined hosts file》[3] 能否在我当前官方固件上运行?这个脚本主要是基于修改 hosts 文件实现,官方固件也可以修改 hosts,但是每次开机后 hosts 文件都会被刷新重置 [4],所有保存的信息会被清空。那么我能否利用上方发现的自启动脚本方法,在每次开机清空后再重新写入新的信息到 hosts 文件?答案是可行的。

仔细分析《AdBlocking with combined hosts file》文章,我看到了屏蔽广告的 hosts 来源,分别是:
http://winhelp2002.mvps.org/hosts.txt
http://someonewhocares.org/hosts/zero/hosts
http://pgl.yoyo.org/adservers/se … &mimetype=plaintext
不过原文中的命令不适用于我,我首先需要做的是:找一个命令把这些链接中的内容写入到路由器的 hosts 中。

经过了一番寻找,我找到了这两篇文章《分享一个OpenWRT路由器的自动更新hosts方法,无需脚本》[5] 和《路由器自动修改hosts脚本》[6],这两篇文章都是国人写的,里面命令对我十分有用。
借助《wget 指令用法與教學》[7] 对命令进行了简单的修改,我得到了可以用于路由器更新 hosts 的命令:

wget -q "http://winhelp2002.mvps.org/hosts.txt" "http://someonewhocares.org/hosts/zero/hosts" "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext" -O /etc/hosts

并且将其制作为脚本:

#!/bin/sh
wget -q "http://winhelp2002.mvps.org/hosts.txt" "http://someonewhocares.org/hosts/zero/hosts" "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext" -O /etc/hosts

 

命令运行成功,在路由器中 ping 相应网址也得到了正确反馈,但我很快发现,为何我的电脑仍能看到广告?我在电脑中 ping 这些网站发现并没有被屏蔽。于是我开始找原因,在上面那些包含命令的文章中,我注意到了几个关键的命令 service restart_dnsmasq 和 /etc/init.d/dnsmasq restart 这些命令都是用来重启 dnsmasq 的,似乎必须重启后才能对客户端生效,前一个命令重启后会导致 hosts 如同开机般被清空,后者则不适用于华硕路由器。我又重新开始寻找新的命令。

在和《RT-AC66UB1 开机自动执行脚本》作者 右手边 交流中,他为我提供了一个新的命令,并发布了一篇教程《如何更改华硕路由器的 hosts》[8],这个新的命令完美地解决了 hosts 修改后不能生效的问题:

killall -SIGHUP dnsmasq

 

既然有了这个命令,那么就把它加入脚本

#!/bin/sh

wget -q "http://winhelp2002.mvps.org/hosts.txt" "http://someonewhocares.org/hosts/zero/hosts" "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext" -O /etc/hosts

sleep 30

killall -SIGHUP dnsmasq

实践证明脚本完美运行。既然可以运行,那么让我来将其改造为开机启动。在本文开头提到的开机启动方法固然可以,但是过于复杂,因为需要基于各种库,如果用不到 Download Master,那些库就没有必要,毕竟那么多的库会拖慢开机时间。

因此我开始寻找一个更好地方法,在寻找中我看到了一个新的文章《Hacking Functionality into ASUSWRT Routers》[9] 其中这样写道:

When a USB storage device is inserted into the router’s USB port, the rc system daemon mounts the partition and checks for the existence of an asusware/.asusrouter script on the mount point. If it exists, the asusware folder is then symlinked to /tmp/opt (and also /opt) and the script is executed. Since this is all open source, you can find the relevant code in the mount_partition function in release/src/router/rc/usb.c.

大意为:

当 U 盘插入路由器后,rc 系统守护进程将挂载 U 盘,并检查 U 盘 asusware 文件夹下是否存在名为 .asusrouter 的脚本文件,如果存在将会把 asusware 文件夹链接为 /tmp/opt(和 /opt),并且运行脚本。因为是开源固件,可以在源代码 release/src/router/rc/usb.c 的 mount_partition 函数中找到相关信息。

大家明白了吗?这就是为什么之前脚本要放在 asusware.arm/etc/init.d/ 里面,因为 opt/etc/init.d/ 是启动目录,开机后会运行 /init.d/ 目录下所有的脚本。但是会首先运行 asusware.arm/.asusrouter 这个脚本。

.asusrouter 这个脚本后来了解到主要是用来启动各种库的命令 [10],而我不需要 Download Master 也用不到这些库,直接清空 .asusrouter 文件,将自己的脚本写进去即可。《Hacking Functionality into ASUSWRT Routers》文章中也写道:

Put the commands you wish to execute in asusware/.asusrouter on your USB storage device. Like any shell script, make sure it has #!/bin/sh as its first line and that the file uses UNIX line endings. The filesystem can be anything supported by the kernel – ext2, ext3 or fat. If you are using a filesystem that implements Linux permissions (such as ext2 or ext3), be sure to set the script as executable.

大意为:

将你的命令保存到 U盘 asusware 目录下的 .asusrouter 文件中,和任何 shell 脚本一样,确保脚本第一行内容为 #!/bin/sh,并且以 UNIX 作为换行符,内核支持 ext2、ext3 或 fat 格式的 U 盘,如果使用 Linux 的 ext2 或 ext3 文件系统,请确保脚本拥有执行权限。

他写的这篇文章文件夹目录是不完全正确的,因为 ARM CPU 的路由器文件夹目录是 asusware.arm,一共有四种对应不同架构 CPU 的目录,分别是:asusware、asusware.arm、asusware.big 和 asusware.mipsbig,要确定你的路由器是哪种请在 telnet 下输入命令 [11]

nvram get apps_install_folder

 

接下来需要注意的是 U 盘不一定是  ext2、ext3 或 fat 格式,经过我的测试 NTFS 和 FAT32 也可以。最重要的是 FAT、FAT32 和 NTFS 这三种格式不需要修改权限,因此我推荐使用这三种格式。

继续看《Hacking Functionality into ASUSWRT Routers》文章

One caveat when running network programs (like DHCP forwarder or mDNS repeater) is that you need to wait until everything has been initialized. ASUS does that by polling the success_start_service NVRAM variable with this bash snippet:

i=0

while [ $i -le 20 ]; do

      success_start_service=`nvram get success_start_service`

      if [ "$success_start_service" == "1" ]; then

              break

      fi

      i=$(($i+1))

      echo "autorun APP: wait $i seconds...";

      sleep 1

done

 

大意是:

运行和网络有关的脚本,需要等待路由器所有程序初始化完成。因此华硕使用如下命令保证这一点。
这段命令大意是:不断查询程序是否初始化完成,如果没有完成就等待,如果完成了就运行接下来的命令。

由于 hosts 是和网络有关的脚本,因此我必须等待所有程序初始化完成。

所以,最终的开机修改 hosts 脚本为:

#!/bin/sh

i=0

while [ $i -le 20 ]; do

      success_start_service=`nvram get success_start_service`

      if [ "$success_start_service" == "1" ]; then

              break

      fi

      i=$(($i+1))

      echo "autorun APP: wait $i seconds...";

      sleep 1

done

wget -q "http://winhelp2002.mvps.org/hosts.txt" "http://someonewhocares.org/hosts/zero/hosts" "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext" -O /etc/hosts

sleep 30

killall -SIGHUP dnsmasq

将这段脚本保存为 .asusrouter 文件,然后放到 U 盘的 asusware 或者 asusware.arm 或者 asusware.big 或者 asusware.mipsbig 文件夹中,我的路由器则是放到 asusware.arm 目录中。

好了,这就可以开机运行了

对于你,你也可以将任何 shell 脚本写在 .asusrouter 里面(以 UNIX 作为换行符),并且保存在 U 盘上 asusware 或者 asusware.arm 或者 asusware.big 或者 asusware.mipsbig 文件夹中,具体是哪一个文件夹,上方有查询方法。
我建议 .asusrouter 里面应该至少包含以下内容:

#!/bin/sh

i=0

while [ $i -le 20 ]; do

      success_start_service=`nvram get success_start_service`

      if [ "$success_start_service" == "1" ]; then

              break

      fi

      i=$(($i+1))

      echo "autorun APP: wait $i seconds...";

      sleep 1

done

#从下方开始你的脚本

 

如果你有多个脚本,我建议将多个脚本独立保存为随意文件名,然后放入 asusware 或者 asusware.arm 或者 asusware.big 或者 asusware.mipsbig 文件夹中,在 .asusrouter 文件里面直接写一段代码引导到你的脚本,例如我有名为 test1、test2 和 test3 脚本保存在 U 盘的 asusware.arm 文件夹里面,我想要他们几乎同时启动,我需要这样写:

#!/bin/sh

i=0

while [ $i -le 20 ]; do

      success_start_service=`nvram get success_start_service`

      if [ "$success_start_service" == "1" ]; then

              break

      fi

      i=$(($i+1))

      echo "autorun APP: wait $i seconds...";

      sleep 1

done

/opt/test1

sleep 1

/opt/test2

sleep 1

/opt/test3

如果你不需要同时运行这些脚本,而是上一个脚本运行结束、再运行下一个,你只要将 test1 写在启动命令里面,然后编辑 test1 文件,在最后一行加入 /opt/test2 启动 test2,test2 脚本最后一行加入 /opt/test3 启动 test3,如同多米诺骨牌一样。

特别感谢:
来自 koolshare 的 konglang_616,来自 52asus 的 Master 和 右手边

参考资料:
[1] ac68等arm迅雷、aria2安装小白教程及官固自启动插件教程
[2] RT-AC66UB1 开机自动执行脚本
[3] AdBlocking with combined hosts file(利用 hosts 文件过滤广告 英文)
[4] 請問RT-N16以及N66U的hosts修改
[5] 分享一个OpenWRT路由器的自动更新hosts方法,无需脚本
[6] 路由器自动修改hosts脚本
[7] wget 指令用法與教學
[8] 如何更改华硕路由器的 hosts
[9] Hacking Functionality into ASUSWRT Router(将脚本运行在华硕路由器上 英文)
[10] 与 @Jack- 讨论开机脚本的问题
[11] 上海电信4K盒子+华硕路由器原厂固件/R7000实现拨号

其他资料:
[12] Asuswrt-Merlin 開機時未執行 init.d 腳本的問題
[13] User scripts · RMerl/asuswrt-merlin Wiki(用户脚本 梅林百科 英文)
[14] ASUSWRT原廠固件安裝 entware

转载自http://www.52asus.com/thread-3692-1-1.html

© 如果需要以学习目的转载、复制这篇教程,请出于尊重保留所有的段落,以及每一个注明信息。此篇教程禁止用于任何商业形式。

Ubuntu VPS挂载WebDAV网盘 TransIP 1T

前几天注册了TransIP 1T网盘不利用有点可惜,故通过WebDAV挂载到VPS。然后可以做的事就比较多了,比如做个备份,上传一些视频等等。

TransIP其实是有教程的,不过全荷兰语,代码发的也凌乱,故重新整理发出来。https://www.transip.nl/vragen/756

  1. 首先安装davfs2
    apt-get update
    apt-get install davfs2
  2. 挂载到VPS
    mkdir /stack
    #手动挂载(XXXX改成你的stack地址前缀),并按提示输入用户名、密码。
    mount -t davfs https://XXXX.stackstorage.com/remote.php/webdav/ /stack
    #通过命令df -h查看挂载结果。出现最后一排的情形表明成功,否则请重新挂载。
    df -h
    
    root@myscis.cn:~# mkdir /stack
    root@myscis.cn:~# mount -t davfs https://XXXX.stackstorage.com/remote.php/webdav/ /stack
    Please enter the username to authenticate with server
    https://XXXX.stackstorage.com/remote.php/webdav/ or hit enter for none.
      Username: XXXX
    Please enter the password to authenticate user XXXX with server
    https://XXXX.stackstorage.com/remote.php/webdav/ or hit enter for none.
      Password:
    root@myscis.cn:~# df -h
    Filesystem                                            Size  Used Avail Use% Mounted on
    udev                                                  227M     0  227M   0% /dev
    tmpfs                                                  49M  5.6M   43M  12% /run
    /dev/xvda1                                             20G   19G 1019M  95% /
    tmpfs                                                 242M   96K  242M   1% /dev/shm
    tmpfs                                                 5.0M     0  5.0M   0% /run/lock
    tmpfs                                                 242M     0  242M   0% /sys/fs/cgroup
    tmpfs                                                  49M   24K   49M   1% /run/user/112
    tmpfs                                                  49M     0   49M   0% /run/user/0
    https://XXXX.stackstorage.com/remote.php/webdav/  1.0T   48K  1.0T   1% /stack
    
    
    #卸载WebDAV
    umount /stack
  3. 开机自动挂载
    sed -i 's/# use_locks       1/use_locks       0/g' /etc/davfs2/davfs2.conf
    echo "https://XXXX.stackstorage.com/remote.php/webdav/ 用户名 密码" > /etc/davfs2/secrets
    echo "https://XXXX.stackstorage.com/remote.php/webdav/ /stack davfs user,rw,noauto" > /etc/fstab
    mount /stack

Ubuntu VPS利用youtube-dl下载youtube视频

写这个的原因其实是这几天在看CCTV纪录片《将改革进行到底》,但苦于没有在cctv.com找到超清版地址,就到Youtube.com找一找,结果发现CCTV有发布1080P版,遂尝试利用VPS下载之并记录下来过程。

youtube-dl简介

youtube-dl是一个跨平台的Python命令行程序,用于从YouTube.com等网站下载视频。youtube-dl不仅可以在Unix、Mac OS X上使用,还包含有Windows版可执行exe文件。youtube-dl的源码托管在GitHub上,地址:https://github.com/rg3/youtube-dl

youtube-dl安装

  • 由于youtube-dl基于Python编写,故先安装Python。
##安装python
apt-get install python -y
##查看python版本,要求:2.6, 2.7, or 3.2+
python -V
  • Youtube上1080P及以上的音视频是分开的,需要用ffmpeg或者avconv合并,在此仅用ffmpeg示例。
#Ubuntu 14.04需要额外添加PPA源才能安装
apt-get install software-properties-common
add-apt-repository ppa:mc3man/trusty-media
apt-get update -y
apt-get dist-upgrade -y
apt-get install ffmpeg -y

#ubuntu 16.04直接安装
apt-get install ffmpeg -y

 

  • 下载youtube-dl并赋予可执行权限。
wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
chmod a+rx /usr/local/bin/youtube-dl

youtube-dl使用

查看使用帮助:

youtube-dl -h

常用参数:

youtube-dl --extractor-descriptions  #查看支持网站简介
youtube-dl -U  #升级youtube-dl
youtube-dl -F URL #获取所有格式
youtube-dl -F https://www.youtube.com/watch?v=bJIJCz62h-s
[youtube] bJIJCz62h-s: Downloading webpage
[youtube] bJIJCz62h-s: Downloading video info webpage
[youtube] bJIJCz62h-s: Extracting video information
[youtube] bJIJCz62h-s: Downloading MPD manifest
[info] Available formats for bJIJCz62h-s:
format code  extension  resolution note
139          m4a        audio only DASH audio   51k , m4a_dash container, mp4a.40.5@ 48k (22050Hz), 16.65MiB
249          webm       audio only DASH audio   54k , opus @ 50k, 16.20MiB
250          webm       audio only DASH audio   69k , opus @ 70k, 20.12MiB
171          webm       audio only DASH audio   98k , vorbis@128k, 29.78MiB
251          webm       audio only DASH audio  126k , opus @160k, 36.60MiB
140          m4a        audio only DASH audio  130k , m4a_dash container, mp4a.40.2@128k (44100Hz), 44.45MiB
160          mp4        256x144    DASH video  124k , avc1.4d400c, 25fps, video only, 25.97MiB
278          webm       256x144    144p  133k , webm container, vp9, 25fps, video only, 34.39MiB
133          mp4        426x240    DASH video  290k , avc1.4d4015, 25fps, video only, 73.00MiB
242          webm       426x240    240p  300k , vp9, 25fps, video only, 71.23MiB
243          webm       640x360    360p  578k , vp9, 25fps, video only, 130.93MiB
134          mp4        640x360    DASH video  656k , avc1.4d401e, 25fps, video only, 133.06MiB
244          webm       854x480    480p 1017k , vp9, 25fps, video only, 232.06MiB
135          mp4        854x480    DASH video 1334k , avc1.4d401e, 25fps, video only, 258.69MiB
247          webm       1280x720   720p 2189k , vp9, 25fps, video only, 471.07MiB
136          mp4        1280x720   DASH video 2663k , avc1.4d401f, 25fps, video only, 496.15MiB
248          webm       1920x1080  1080p 3584k , vp9, 25fps, video only, 879.78MiB
137          mp4        1920x1080  DASH video 4412k , avc1.640028, 25fps, video only, 875.47MiB
17           3gp        176x144    small , mp4v.20.3, mp4a.40.2@ 24k
36           3gp        320x180    small , mp4v.20.3, mp4a.40.2
43           webm       640x360    medium , vp8.0, vorbis@128k
18           mp4        640x360    medium , avc1.42001E, mp4a.40.2@ 96k
22           mp4        1280x720   hd720 , avc1.64001F, mp4a.40.2@192k (best)

从1080P及以上的音视频分开了,需要合并成一个文件,youtube-dl自带这个功能只需执行

##youtube-dl -f bestvideo+bestaudio URL  下载最好的视频音频合并
youtube-dl -f best https://www.youtube.com/watch?v=bJIJCz62h-s
##或者
youtube-dl -f bestvideo+bestaudio https://www.youtube.com/watch?v=bJIJCz62h-s

##也可以下载指定id视频音频合并,但是视频id需要在音频id前,如 
youtube-dl -f 137+140 https://www.youtube.com/watch?v=bJIJCz62h-s

 

 

附所有参数列表:

-h, --help                       Print this help text and exit
--version                        Print program version and exit
-U, --update                     Update this program to latest version. Make
                                 sure that you have sufficient permissions
                                 (run with sudo if needed)
-i, --ignore-errors              Continue on download errors, for example to
                                 skip unavailable videos in a playlist
--abort-on-error                 Abort downloading of further videos (in the
                                 playlist or the command line) if an error
                                 occurs
--dump-user-agent                Display the current browser identification
--list-extractors                List all supported extractors
--extractor-descriptions         Output descriptions of all supported
                                 extractors
--force-generic-extractor        Force extraction to use the generic
                                 extractor
--default-search PREFIX          Use this prefix for unqualified URLs. For
                                 example "gvsearch2:" downloads two videos
                                 from google videos for youtube-dl "large
                                 apple". Use the value "auto" to let
                                 youtube-dl guess ("auto_warning" to emit a
                                 warning when guessing). "error" just throws
                                 an error. The default value "fixup_error"
                                 repairs broken URLs, but emits an error if
                                 this is not possible instead of searching.
--ignore-config                  Do not read configuration files. When given
                                 in the global configuration file
                                 /etc/youtube-dl.conf: Do not read the user
                                 configuration in ~/.config/youtube-
                                 dl/config (%APPDATA%/youtube-dl/config.txt
                                 on Windows)
--config-location PATH           Location of the configuration file; either
                                 the path to the config or its containing
                                 directory.
--flat-playlist                  Do not extract the videos of a playlist,
                                 only list them.
--mark-watched                   Mark videos watched (YouTube only)
--no-mark-watched                Do not mark videos watched (YouTube only)
--no-color                       Do not emit color codes in output
Network Options:

--proxy URL                      Use the specified HTTP/HTTPS/SOCKS proxy.
                                 To enable experimental SOCKS proxy, specify
                                 a proper scheme. For example
                                 socks5://127.0.0.1:1080/. Pass in an empty
                                 string (--proxy "") for direct connection
--socket-timeout SECONDS         Time to wait before giving up, in seconds
--source-address IP              Client-side IP address to bind to
-4, --force-ipv4                 Make all connections via IPv4
-6, --force-ipv6                 Make all connections via IPv6
Geo Restriction:

--geo-verification-proxy URL     Use this proxy to verify the IP address for
                                 some geo-restricted sites. The default
                                 proxy specified by --proxy (or none, if the
                                 options is not present) is used for the
                                 actual downloading.
--geo-bypass                     Bypass geographic restriction via faking
                                 X-Forwarded-For HTTP header (experimental)
--no-geo-bypass                  Do not bypass geographic restriction via
                                 faking X-Forwarded-For HTTP header
                                 (experimental)
--geo-bypass-country CODE        Force bypass geographic restriction with
                                 explicitly provided two-letter ISO 3166-2
                                 country code (experimental)
Video Selection:

--playlist-start NUMBER          Playlist video to start at (default is 1)
--playlist-end NUMBER            Playlist video to end at (default is last)
--playlist-items ITEM_SPEC       Playlist video items to download. Specify
                                 indices of the videos in the playlist
                                 separated by commas like: "--playlist-items
                                 1,2,5,8" if you want to download videos
                                 indexed 1, 2, 5, 8 in the playlist. You can
                                 specify range: "--playlist-items
                                 1-3,7,10-13", it will download the videos
                                 at index 1, 2, 3, 7, 10, 11, 12 and 13.
--match-title REGEX              Download only matching titles (regex or
                                 caseless sub-string)
--reject-title REGEX             Skip download for matching titles (regex or
                                 caseless sub-string)
--max-downloads NUMBER           Abort after downloading NUMBER files
--min-filesize SIZE              Do not download any videos smaller than
                                 SIZE (e.g. 50k or 44.6m)
--max-filesize SIZE              Do not download any videos larger than SIZE
                                 (e.g. 50k or 44.6m)
--date DATE                      Download only videos uploaded in this date
--datebefore DATE                Download only videos uploaded on or before
                                 this date (i.e. inclusive)
--dateafter DATE                 Download only videos uploaded on or after
                                 this date (i.e. inclusive)
--min-views COUNT                Do not download any videos with less than
                                 COUNT views
--max-views COUNT                Do not download any videos with more than
                                 COUNT views
--match-filter FILTER            Generic video filter. Specify any key (see
                                 the "OUTPUT TEMPLATE" for a list of
                                 available keys) to match if the key is
                                 present, !key to check if the key is not
                                 present, key > NUMBER (like "comment_count
                                 > 12", also works with >=, <, <=, !=, =) to
                                 compare against a number, key = 'LITERAL'
                                 (like "uploader = 'Mike Smith'", also works
                                 with !=) to match against a string literal
                                 and & to require multiple matches. Values
                                 which are not known are excluded unless you
                                 put a question mark (?) after the operator.
                                 For example, to only match videos that have
                                 been liked more than 100 times and disliked
                                 less than 50 times (or the dislike
                                 functionality is not available at the given
                                 service), but who also have a description,
                                 use --match-filter "like_count > 100 &
                                 dislike_count <? 50 & description" .
--no-playlist                    Download only the video, if the URL refers
                                 to a video and a playlist.
--yes-playlist                   Download the playlist, if the URL refers to
                                 a video and a playlist.
--age-limit YEARS                Download only videos suitable for the given
                                 age
--download-archive FILE          Download only videos not listed in the
                                 archive file. Record the IDs of all
                                 downloaded videos in it.
--include-ads                    Download advertisements as well
                                 (experimental)
Download Options:

-r, --limit-rate RATE            Maximum download rate in bytes per second
                                 (e.g. 50K or 4.2M)
-R, --retries RETRIES            Number of retries (default is 10), or
                                 "infinite".
--fragment-retries RETRIES       Number of retries for a fragment (default
                                 is 10), or "infinite" (DASH, hlsnative and
                                 ISM)
--skip-unavailable-fragments     Skip unavailable fragments (DASH, hlsnative
                                 and ISM)
--abort-on-unavailable-fragment  Abort downloading when some fragment is not
                                 available
--keep-fragments                 Keep downloaded fragments on disk after
                                 downloading is finished; fragments are
                                 erased by default
--buffer-size SIZE               Size of download buffer (e.g. 1024 or 16K)
                                 (default is 1024)
--no-resize-buffer               Do not automatically adjust the buffer
                                 size. By default, the buffer size is
                                 automatically resized from an initial value
                                 of SIZE.
--playlist-reverse               Download playlist videos in reverse order
--playlist-random                Download playlist videos in random order
--xattr-set-filesize             Set file xattribute ytdl.filesize with
                                 expected file size (experimental)
--hls-prefer-native              Use the native HLS downloader instead of
                                 ffmpeg
--hls-prefer-ffmpeg              Use ffmpeg instead of the native HLS
                                 downloader
--hls-use-mpegts                 Use the mpegts container for HLS videos,
                                 allowing to play the video while
                                 downloading (some players may not be able
                                 to play it)
--external-downloader COMMAND    Use the specified external downloader.
                                 Currently supports
                                 aria2c,avconv,axel,curl,ffmpeg,httpie,wget
--external-downloader-args ARGS  Give these arguments to the external
                                 downloader
Filesystem Options:

-a, --batch-file FILE            File containing URLs to download ('-' for
                                 stdin)
--id                             Use only video ID in file name
-o, --output TEMPLATE            Output filename template, see the "OUTPUT
                                 TEMPLATE" for all the info
--autonumber-start NUMBER        Specify the start value for %(autonumber)s
                                 (default is 1)
--restrict-filenames             Restrict filenames to only ASCII
                                 characters, and avoid "&" and spaces in
                                 filenames
-w, --no-overwrites              Do not overwrite files
-c, --continue                   Force resume of partially downloaded files.
                                 By default, youtube-dl will resume
                                 downloads if possible.
--no-continue                    Do not resume partially downloaded files
                                 (restart from beginning)
--no-part                        Do not use .part files - write directly
                                 into output file
--no-mtime                       Do not use the Last-modified header to set
                                 the file modification time
--write-description              Write video description to a .description
                                 file
--write-info-json                Write video metadata to a .info.json file
--write-annotations              Write video annotations to a
                                 .annotations.xml file
--load-info-json FILE            JSON file containing the video information
                                 (created with the "--write-info-json"
                                 option)
--cookies FILE                   File to read cookies from and dump cookie
                                 jar in
--cache-dir DIR                  Location in the filesystem where youtube-dl
                                 can store some downloaded information
                                 permanently. By default
                                 $XDG_CACHE_HOME/youtube-dl or
                                 ~/.cache/youtube-dl . At the moment, only
                                 YouTube player files (for videos with
                                 obfuscated signatures) are cached, but that
                                 may change.
--no-cache-dir                   Disable filesystem caching
--rm-cache-dir                   Delete all filesystem cache files
Thumbnail images:

--write-thumbnail                Write thumbnail image to disk
--write-all-thumbnails           Write all thumbnail image formats to disk
--list-thumbnails                Simulate and list all available thumbnail
                                 formats
Verbosity / Simulation Options:

-q, --quiet                      Activate quiet mode
--no-warnings                    Ignore warnings
-s, --simulate                   Do not download the video and do not write
                                 anything to disk
--skip-download                  Do not download the video
-g, --get-url                    Simulate, quiet but print URL
-e, --get-title                  Simulate, quiet but print title
--get-id                         Simulate, quiet but print id
--get-thumbnail                  Simulate, quiet but print thumbnail URL
--get-description                Simulate, quiet but print video description
--get-duration                   Simulate, quiet but print video length
--get-filename                   Simulate, quiet but print output filename
--get-format                     Simulate, quiet but print output format
-j, --dump-json                  Simulate, quiet but print JSON information.
                                 See the "OUTPUT TEMPLATE" for a description
                                 of available keys.
-J, --dump-single-json           Simulate, quiet but print JSON information
                                 for each command-line argument. If the URL
                                 refers to a playlist, dump the whole
                                 playlist information in a single line.
--print-json                     Be quiet and print the video information as
                                 JSON (video is still being downloaded).
--newline                        Output progress bar as new lines
--no-progress                    Do not print progress bar
--console-title                  Display progress in console titlebar
-v, --verbose                    Print various debugging information
--dump-pages                     Print downloaded pages encoded using base64
                                 to debug problems (very verbose)
--write-pages                    Write downloaded intermediary pages to
                                 files in the current directory to debug
                                 problems
--print-traffic                  Display sent and read HTTP traffic
-C, --call-home                  Contact the youtube-dl server for debugging
--no-call-home                   Do NOT contact the youtube-dl server for
                                 debugging
Workarounds:

--encoding ENCODING              Force the specified encoding (experimental)
--no-check-certificate           Suppress HTTPS certificate validation
--prefer-insecure                Use an unencrypted connection to retrieve
                                 information about the video. (Currently
                                 supported only for YouTube)
--user-agent UA                  Specify a custom user agent
--referer URL                    Specify a custom referer, use if the video
                                 access is restricted to one domain
--add-header FIELD:VALUE         Specify a custom HTTP header and its value,
                                 separated by a colon ':'. You can use this
                                 option multiple times
--bidi-workaround                Work around terminals that lack
                                 bidirectional text support. Requires bidiv
                                 or fribidi executable in PATH
--sleep-interval SECONDS         Number of seconds to sleep before each
                                 download when used alone or a lower bound
                                 of a range for randomized sleep before each
                                 download (minimum possible number of
                                 seconds to sleep) when used along with
                                 --max-sleep-interval.
--max-sleep-interval SECONDS     Upper bound of a range for randomized sleep
                                 before each download (maximum possible
                                 number of seconds to sleep). Must only be
                                 used along with --min-sleep-interval.
Video Format Options:

-f, --format FORMAT              Video format code, see the "FORMAT
                                 SELECTION" for all the info
--all-formats                    Download all available video formats
--prefer-free-formats            Prefer free video formats unless a specific
                                 one is requested
-F, --list-formats               List all available formats of requested
                                 videos
--youtube-skip-dash-manifest     Do not download the DASH manifests and
                                 related data on YouTube videos
--merge-output-format FORMAT     If a merge is required (e.g.
                                 bestvideo+bestaudio), output to given
                                 container format. One of mkv, mp4, ogg,
                                 webm, flv. Ignored if no merge is required
Subtitle Options:

--write-sub                      Write subtitle file
--write-auto-sub                 Write automatically generated subtitle file
                                 (YouTube only)
--all-subs                       Download all the available subtitles of the
                                 video
--list-subs                      List all available subtitles for the video
--sub-format FORMAT              Subtitle format, accepts formats
                                 preference, for example: "srt" or
                                 "ass/srt/best"
--sub-lang LANGS                 Languages of the subtitles to download
                                 (optional) separated by commas, use --list-
                                 subs for available language tags
Authentication Options:

-u, --username USERNAME          Login with this account ID
-p, --password PASSWORD          Account password. If this option is left
                                 out, youtube-dl will ask interactively.
-2, --twofactor TWOFACTOR        Two-factor authentication code
-n, --netrc                      Use .netrc authentication data
--video-password PASSWORD        Video password (vimeo, smotri, youku)
Adobe Pass Options:

--ap-mso MSO                     Adobe Pass multiple-system operator (TV
                                 provider) identifier, use --ap-list-mso for
                                 a list of available MSOs
--ap-username USERNAME           Multiple-system operator account login
--ap-password PASSWORD           Multiple-system operator account password.
                                 If this option is left out, youtube-dl will
                                 ask interactively.
--ap-list-mso                    List all supported multiple-system
                                 operators
Post-processing Options:

-x, --extract-audio              Convert video files to audio-only files
                                 (requires ffmpeg or avconv and ffprobe or
                                 avprobe)
--audio-format FORMAT            Specify audio format: "best", "aac",
                                 "flac", "mp3", "m4a", "opus", "vorbis", or
                                 "wav"; "best" by default; No effect without
                                 -x
--audio-quality QUALITY          Specify ffmpeg/avconv audio quality, insert
                                 a value between 0 (better) and 9 (worse)
                                 for VBR or a specific bitrate like 128K
                                 (default 5)
--recode-video FORMAT            Encode the video to another format if
                                 necessary (currently supported:
                                 mp4|flv|ogg|webm|mkv|avi)
--postprocessor-args ARGS        Give these arguments to the postprocessor
-k, --keep-video                 Keep the video file on disk after the post-
                                 processing; the video is erased by default
--no-post-overwrites             Do not overwrite post-processed files; the
                                 post-processed files are overwritten by
                                 default
--embed-subs                     Embed subtitles in the video (only for mp4,
                                 webm and mkv videos)
--embed-thumbnail                Embed thumbnail in the audio as cover art
--add-metadata                   Write metadata to the video file
--metadata-from-title FORMAT     Parse additional metadata like song title /
                                 artist from the video title. The format
                                 syntax is the same as --output. Regular
                                 expression with named capture groups may
                                 also be used. The parsed parameters replace
                                 existing values. Example: --metadata-from-
                                 title "%(artist)s - %(title)s" matches a
                                 title like "Coldplay - Paradise". Example
                                 (regex): --metadata-from-title
                                 "(?P<artist>.+?) - (?P<title>.+)"
--xattrs                         Write metadata to the video file's xattrs
                                 (using dublin core and xdg standards)
--fixup POLICY                   Automatically correct known faults of the
                                 file. One of never (do nothing), warn (only
                                 emit a warning), detect_or_warn (the
                                 default; fix file if we can, warn
                                 otherwise)
--prefer-avconv                  Prefer avconv over ffmpeg for running the
                                 postprocessors (default)
--prefer-ffmpeg                  Prefer ffmpeg over avconv for running the
                                 postprocessors
--ffmpeg-location PATH           Location of the ffmpeg/avconv binary;
                                 either the path to the binary or its
                                 containing directory.
--exec CMD                       Execute a command on the file after
                                 downloading, similar to find's -exec
                                 syntax. Example: --exec 'adb push {}
                                 /sdcard/Music/ && rm {}'
--convert-subs FORMAT            Convert the subtitles to other format
                                 (currently supported: srt|ass|vtt)