kbl 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +117 -0
- data/Rakefile +1 -0
- data/kbl.gemspec +25 -0
- data/lib/kbl.rb +13 -0
- data/lib/kbl/version.rb +3 -0
- metadata +94 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 73abc7025129ec8803f02d292b4c2de0f0fb9f9d
|
4
|
+
data.tar.gz: 994c849b5b69b728d069909f3e0823fa1b251240
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ad74dea81d0e2264bf620a123164ceb167d3b909877c151588491a3417bc2e9e71db201e4364a512ff1de2a1de8bfd634ade4a79909ff9dc2722b1c34d25973a
|
7
|
+
data.tar.gz: d1720e1506bb0f198d7037e355cf3e2d97edd99603a7e90986328303ad4ab0348c4f9e554ce34e436bb8b1ad049703401045fe0619657f6444c4f885e96db9bf
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Yu-Cheng Chuang
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
# KKBOX Playlist Library (KBL) Generator
|
2
|
+
|
3
|
+
A simple gem to generate KKBOX Playlist Library (KBL) files.
|
4
|
+
|
5
|
+
:warning: **[WARNING]** This program is made by reverse-engineering the KBL files. It does not guarantee that the generated KBL files is fully-compatible with KKBOX client. Use it AT YOUR OWN RISK!.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'kbl'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install kbl
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
**Important**: Read **Required Song Meta Data** section before you start generating a KBL file.
|
24
|
+
|
25
|
+
```rb
|
26
|
+
kbl = KBL::Package.new do |package|
|
27
|
+
package.add_playlist do |playlist|
|
28
|
+
playlist.name = "Playlist A"
|
29
|
+
playlist.description = "A Sample Playlist"
|
30
|
+
|
31
|
+
playlist.add_song do |song|
|
32
|
+
song.name = "君の知らない物語"
|
33
|
+
song.pathname = "3665602"
|
34
|
+
song.artist = "Supercell"
|
35
|
+
song.artist_id = "197227"
|
36
|
+
song.album = "Today Is A Beautiful Day"
|
37
|
+
song.album_id = "314546"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
puts kbl.to_kbl #=> the KBL source code (in XML)
|
43
|
+
```
|
44
|
+
|
45
|
+
## Required Song Meta Data
|
46
|
+
|
47
|
+
To generate a working KBL file, the following data for every song must be provided.
|
48
|
+
|
49
|
+
* **pathname** - The Song ID
|
50
|
+
* **album_id** - The Album ID
|
51
|
+
* **artist_id** - The Artist ID
|
52
|
+
|
53
|
+
If there is only `pathname`, the User Interface will work in strange behavior, if these songs has never been played in your KKBOX client, or was removed from your KKBOX client library before.
|
54
|
+
|
55
|
+
Additionally, add these data to avoid blank name, album and artist names, when importing unknown songs to the KKBOX client:
|
56
|
+
|
57
|
+
* **name** - The name of that song.
|
58
|
+
* **album** - The album name.
|
59
|
+
* **artist** - The artist name.
|
60
|
+
|
61
|
+
## Glossary
|
62
|
+
|
63
|
+
### Package
|
64
|
+
|
65
|
+
A package of KBL.
|
66
|
+
|
67
|
+
Can contain multiple playlists, which will be imported as individual playlists when the KBL file is imported to KKBOX client.
|
68
|
+
|
69
|
+
### Playlist
|
70
|
+
|
71
|
+
A playlist entry containing one or more songs.
|
72
|
+
|
73
|
+
It is recommended to assign name for it so that when importing, it will be showed up in the playlists sidebar.
|
74
|
+
|
75
|
+
### Song
|
76
|
+
|
77
|
+
A song entry.
|
78
|
+
|
79
|
+
Can exist multiple times across multiple playlists.
|
80
|
+
|
81
|
+
## Contributing
|
82
|
+
|
83
|
+
1. Fork it ( http://github.com/chitsaou/kbl-generator/fork )
|
84
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
85
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
86
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
87
|
+
5. Create new Pull Request
|
88
|
+
|
89
|
+
## TODO
|
90
|
+
|
91
|
+
* Make a CLI tool for generating KBL files.
|
92
|
+
* Scraping meta data from KKBOX client database from given Song IDs.
|
93
|
+
* A workflow for how to build a KBL file from Song IDs.
|
94
|
+
|
95
|
+
## License
|
96
|
+
|
97
|
+
The MIT License (MIT)
|
98
|
+
|
99
|
+
Copyright (c) 2014 Yu-Cheng Chuang
|
100
|
+
|
101
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
102
|
+
of this software and associated documentation files (the "Software"), to deal
|
103
|
+
in the Software without restriction, including without limitation the rights
|
104
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
105
|
+
copies of the Software, and to permit persons to whom the Software is
|
106
|
+
furnished to do so, subject to the following conditions:
|
107
|
+
|
108
|
+
The above copyright notice and this permission notice shall be included in
|
109
|
+
all copies or substantial portions of the Software.
|
110
|
+
|
111
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
112
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
113
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
114
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
115
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
116
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
117
|
+
THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/kbl.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'kbl/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "kbl"
|
8
|
+
spec.version = Kbl::VERSION
|
9
|
+
spec.authors = ["Yu-Cheng Chuang"]
|
10
|
+
spec.email = ["ducksteven@gmail.com"]
|
11
|
+
spec.summary = %q{KKBOX Playlist Builder}
|
12
|
+
spec.description = %q{Building KKBOX Playlist and serialize to KBL format.}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency 'nokogiri', '~> 1.6.1'
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
end
|
data/lib/kbl.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require "kbl/version"
|
2
|
+
|
3
|
+
module KBL
|
4
|
+
autoload :Package, "kbl/package"
|
5
|
+
autoload :Playlist, "kbl/playlist"
|
6
|
+
autoload :Song, "kbl/song"
|
7
|
+
|
8
|
+
module Serializable
|
9
|
+
autoload :Package, "kbl/serializable/package"
|
10
|
+
autoload :Playlist, "kbl/serializable/playlist"
|
11
|
+
autoload :Song, "kbl/serializable/song"
|
12
|
+
end
|
13
|
+
end
|
data/lib/kbl/version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kbl
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Yu-Cheng Chuang
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-05-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: nokogiri
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.6.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.6.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.5'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Building KKBOX Playlist and serialize to KBL format.
|
56
|
+
email:
|
57
|
+
- ducksteven@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- .gitignore
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- kbl.gemspec
|
68
|
+
- lib/kbl.rb
|
69
|
+
- lib/kbl/version.rb
|
70
|
+
homepage: ''
|
71
|
+
licenses:
|
72
|
+
- MIT
|
73
|
+
metadata: {}
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options: []
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
requirements: []
|
89
|
+
rubyforge_project:
|
90
|
+
rubygems_version: 2.2.2
|
91
|
+
signing_key:
|
92
|
+
specification_version: 4
|
93
|
+
summary: KKBOX Playlist Builder
|
94
|
+
test_files: []
|