GithubHelp home page GithubHelp logo

kbl-generator's People

Contributors

yorkxin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kbl-generator's Issues

Serializer 遇到有特殊字元的曲目會爆掉

字串欄位如果有 <>& 等沒有 escape 的文字,餵給 Nokogiri 會 parse error。

試過用 CDATA 包起來,但這樣的話匯進 KKBOX 會出現那些 CDATA 文字。

幾個解法:

  • 找看有沒有選項可以容忍這種 unescaped entities
  • 用別的 Parser
  • 改回 ERB

genkbl.rb 缺少歌單標題

是在這裡:

        <playlist>
                <playlist_id>1</playlist_id>
                <playlist_name>Playlist</playlist_name><!-- 這裡 -->
        </playlist>

可能的做法是從 genkbl.rb 的 command line args 丟進來。

缺 Artist ID 的話,一直往後播,「歌手」會顯示異常

所謂異常是,後播的會查詢它的歌手資訊,並且蓋掉某些前面播過的。

可能跟「從來沒在 KKBOX 裡播過這首歌」這個問題有關。


可能的解法

取得所有 Artist ID ,但這不存在網頁上所以比較難抓,只知道可以從匯出的 playlist 抓到。

那麼就有暴力解:

  1. 我們知道曲目 ID
  2. 可以強迫 OS 打開一堆 kkbox://play_song_xxxxxxx
  3. 這樣會灌到 Temporary Playlist (?) 和 All Songs ,再整理成 Playlist 匯出就行了。

這樣也可以解決「只知道 Song ID 不知道 Album ID」的問題。

不過應該是需要一個 KBL parser (XML parser) 來讓「從 KBL 檔抽出 Artist / Album ID」這件事自動化。

另外 Step 3 是沒辦法自動化的。

考慮直接 access sqlite3 db 來取得曲目的 meta data

做夢夢到 sqlite3 db 裡面有曾經播過的曲目資料,所以可以直接對它下 query 來取出 meta data。

那樣的話流程變成

  • open 一堆 kkbox://play_song_xxxxxxx
  • 停止播歌
  • access sqlite3 db 來取得上面一堆 song id 的 meta data

到這裡突然發現這招是 mac only,我就嚇醒了。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.