星期一, 2月 20, 2017

Tools to download videos from websites - youtube-dl

Tools to download videos from websites - youtube-dl



very powerful and easy to use

# Download YouTube playlist videos in separate directory indexed by video order in a playlist
$ youtube-dl -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re

#Download single YouTube video
$youtube-dl -f mp4 https://www.youtube.com/watch?v=Ezf_JiMilP4&list=FLJmUih3PSbm6HY73nBOjxBg&index=1 -o '%(title)s.%(ext)s'


說明文件﹕
https://github.com/rg3/youtube-dl/blob/master/README.md#readme

***
在一些舊版本的Linux上執行會有error, 懷疑是python相關的library版本和新版的youtube-dl不合造成,在新版本的Linux上執行都可以順利完成。

***





星期五, 2月 17, 2017

How to install software or upgrade from an old unsupported release?

How to install software or upgrade from an old unsupported release?



sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

Why are we facing 404 errors

Ubuntu follows the approach of two different release cycles:
Normal Ubuntu releases are supported for 9 months. LTS releases are supported for 5 years.
Past releases may have different support schedules (for example, normal releases (before 13.04) used to be supported for 18 months, while LTS releases (before 12.04) used to be supported for 3 years on the desktop and 5 years on the server).
EOL: Once the support period for a particular release is over; they are called End Of Life (EOL) and all the updates and package repositories for that Release are transferred to a different server which results in 404 errors while running sudo apt-get update. You can confirm if your release has become EOL by going to this page. If your Ubuntu release is mentioned under "End Of Life (EOL)" Table, then the release is no longer supported and you should try to upgrade to a newer supported release. However, if you wish to continue using this unsupported release, you would have to make necessary modifications in /etc/apt/sources.list to point to the old-releases server of Ubuntu.
There you go. No 404 Errors this time. You can now install all the available packages for your Ubuntu Release. You can also run sudo apt-get dist-upgrade to install any Security/Bug-fix updates which have not yet been installed but you won't get any further Security/Bug-fix updates from Ubuntu.