Sunday, April 18

下载youtube音乐

 Copyright disclaimer: 本文介绍开源工具YOUTUBE-DL,可以从YOUTUBE下载音乐、视频。仅用于个人娱乐用。


我经常在YOUTUBE看到好的音乐,下载下来刻在CD里,开车的时候播放。每次需要下载时就在Google临时搜索“ YOUTUBE MP3",在找到的链接里操作。这些链接大多充满广告,而且经常改变,我都忍下来了,理解他们谋生不易。可是我上次辛苦找到的一个能够让我下载部分音频(比如把前面的21秒广告、后面的1分钟语音切掉)的链接,今天果然失效了,连着翻了1屏幕的google链接都没有能够找到能够用的,我知道,我需要修改方法了。


youtube-dl 是一个很成熟的下载youtube的开源软件,命令行操作,你可以下载源代码编译,也可以在它页面上找到WINDOWS版本的链接;如果你用MacBook,可以执行


brew install youtube-dl
或者
sudo port install youtube-dl
安装。
安装后,如果要下载整个视频:
youtube-dl https://www.youtube.com/watch?v=lWwmYn0nXLE
视频就被存在本地一个 MP4 文档里了。
如果只要音乐(音频),指定用MP3格式:
youtube-dl -x --audio-format mp3   https://www.youtube.com/watch?v=lWwmYn0nXLE
这个音频里,我只要1分5秒之后,到5分15秒,共4分钟10秒的音频:
youtube-dl -x --audio-format mp3 --postprocessor-args "-ss 00:1:05 -t 00:04:10"   https://www.youtube.com/watch?v=lWwmYn0nXLE


Saturday, April 10

陋室铭

周末早上起来,自己坐在客厅里,忽然想起了刘禹锡的这首《陋室铭》: 


山不在高,有仙則名。水不在深,有龍則靈。斯是陋室,惟吾德馨。

苔痕上階綠,草色入簾青。談笑有鴻儒,往來無白丁。

可以調素琴,閱金經。無絲竹之亂耳,無案牘之勞形。

南陽諸葛廬,西蜀子雲亭。

孔子云:「何陋之有?」


这么多年没有想起过它,现在一想起来,也许这短短81字,一直在牵引着我,在潜意识里提醒自己应该过着什么样的生活:物质追求放在其次,与“有趣的灵魂”结识、交友,摆脱“案牍之劳形”。


最后一句话“孔子云:「何陋之有?」” 以前没有注意到,现在一查,在《论语。子罕》里有这句:


子欲居九夷。或曰:「陋,如之何!」子曰:「君子居之,何陋之有?」



孔子真是坦率:有我在的地方,怎么会陋呢?我到了哪里,光明就到了哪里。










Wednesday, April 7

Say no to SB-82:

 California is proposing SB-82, to make some crimes that would be felony in the current law, into misdemeanor. The summary text of the bill is:

This bill would define the crime of petty theft in the first degree as taking the property from the person of another or from a commercial establishment by means of force or fear without the use of a deadly weapon or great bodily injury.


Previously (currently), if somebody use force or fear to "take" money from others, that is robbery. He doesn't have to use gun or sharp knife, he can just say "I am making an offer you can't refuse", or put one hand in his pocket, pretending that is a gun.  In the proposed new law, this is no longer a robbery, it is a "petty theft" now!

Only if the person is using gun or sharp knife (It's hard to say whether a metal baseball bat is "deadly weapon" or not), or the target is dead or bleeding (great bodily injury), then this becomes a robbery, a felony that has longer jail time and criminal record.


I object to this change. Whenever the person is using force or fear to attack others, take away the valuables, that is no longer a theft. The force or fear brings nightmare to the innocent receiver, creates insecurity to the community, it definitely should be a felony.