是的,我又搞自己了。
好好的 windows 不用,非要用 mac 來搞自己。
而且,明明就是不讓非 IE 聽的網路廣播,我就是要聽。
所以,陸陸續續搞了這幾個星期,今晚的收穫最多。
就是,我可以用 shell script 的方式,呼叫 VLC 來播放了。
這個 script 需要 mac 用的 wget。對,又是一個搞自己的東西。
google 一下之後,有個 zip 檔的,但是我不知道如何把執行檔放到 /usr/local/bin 所以放棄。
還好還有個日本人好心包成 pkg 檔,所以就要抓那個來用。
然後,從 fourdollar 那裡(http://fourdollars.blogspot.com/2007/05/hinet-radio.html),偷他的 script 來用,
------------------------------
#!/bin/sh wmp_get() { wget -q --user-agent 'Windows Media Player' --referer=http://hichannel.hinet.net -O - $* } URL=$(wmp_get $(wmp_get http://hichannel.hinet.net/api/streamradio.jsp?id=177 | grep mms | cut -d '"' -f 2) | grep 203 | cut -d '"' -f 2) mplayer $URL --------------------------------
明明人家的就可以用,可我就愛搞到自己,試了一圈之後,程式變成一大沱。
看了就討厭,反正可以用,就這樣啦。今天又搞到晚睡了。
-------------這是分隔線 上面的-------------------
#!/bin/sh wmp_get() { wget -q --user-agent 'Windows Media Player' --referer=http://hichannel.hinet.net -O - $* } #URL=$(wmp_get $(wmp_get http://hichannel.hinet.net/api/streamradio.jsp?id=206 | grep mms | cut -d '"' -f 2) | grep 203 | cut -d '"' -f 2) URL=$(wmp_get $(wmp_get http://radio.hinet.net/api/streamRadio.jsp?id=206| grep mms | cut -d '"' -f 2) | grep 203 | cut -d '"' -f 2) /Applications/VLC.app/Contents/MacOS/VLC $URL #echo $URL > result.html #first step # #second step # # # # # # # #last url #mms://203.69.144.203/203.69.144.202/live.media.hinet.net/Radio_BCC-MUSIC%3Fhich06F428A1-8C41-4A04-984E-ED6103F83975 -------------這是分隔線 下面的-------------------

打完這篇,又搞到自己。 因為用 mac 打,分行符號跟 windows 不一樣。所以排版上,自己不會斷行。 真的是 e04 到底了!!!
創作者介紹
創作者 betaparticle的部落格 的頭像
betaparticle

betaparticle的部落格

betaparticle 發表在 痞客邦 留言(0) 人氣( 76 )