Linux桌面環境下收看ViuTV

  1. 安裝mpv軟件包。
  2. 加入以下文字到~/.bashrc~/.zshrc等文件:
    function viutv() { index=$(curl -s 'http://api.viu.now.com/p8/1/getLiveURL' --data '{"channelno":"099","mode":"prod","deviceId":"0000anonymous_user","format":"HLS"}' | python -c 'import json,sys; print(json.load(sys.stdin)["asset"]["hls"]["adaptive"][0])') && curl -s $index > /dev/null && base=$(echo $index | sed "s/\/index.*//g") && mpv "$base/Stream(04)/index.m3u8" --audio-file "$base/Stream(06)/index.m3u8" }
    
  3. $ viutv

Recommendations

Last modified: 2016-04-08 14:29:46
Powered by Simple Blog