-
-
Save bczhc/ad58a291895f701839098e4b403a521a to your computer and use it in GitHub Desktop.
QQ音乐新版ekey从数据库中获取脚本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'sqlite3' | |
| argv = ARGV | |
| if argv.empty? | |
| puts "Usage: #{File.basename $0} <database> <path-key>" | |
| return | |
| end | |
| database = argv[0] | |
| path_key = argv[1] | |
| # @type [String] | |
| record = nil | |
| count = 0 | |
| database = SQLite3::Database.new database | |
| database.execute('SELECT ekey FROM audio_file_ekey_table WHERE file_path IS ?', [path_key]) do |row| | |
| record = row | |
| count += 1 | |
| end | |
| throw "No record" if record == nil | |
| throw "Duplicated records" unless count == 1 | |
| puts record |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
配合https://github.com/bczhc/qmc-decode 使用