Coder Social home page Coder Social logo

xmly-download's Introduction

依赖环境

本工具依赖于 Ruby 执行环境。

LinuxOS X 环境,可以通过 RVM 或者 rbenv 来安装 Ruby,当然,如果只是临时使用,也可以用系统自带的。

RVM

RVM 官方地址

# 安装
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable

rvm reload
rvm list known
rvm install 2.5.1
rvm use 2.5.1 —default

# 更新
rvm get stable

rbenv

rbenv 官方地址,下面以 OS X 平台来演示如何安装 Ruby

# 安装
brew update
brew install rbenv ruby-build

rbenv init
rbenv versions
rbenv install 2.5.1

# 更新
brew upgrade rbenv ruby-build

了解更多 Ruby 相关知识,可以参考 Ruby 编程手札

本工具依赖的 gem

gem install nokogiri
gem install faraday
gem install thor

下载喜马拉雅付费音频

本工具只能下载你本人已经付费过的喜马拉雅专辑,也就是指定的 uid 已经购买了该专辑。

如何获取你的 uidtoken

在电脑 Chrome 上随便打开一个喜马拉雅付费音频,并打开开发者工具(Developer Tools),点击音频播放按钮, 在网络 XHR 中锁定检查支付的请求 URL,该 URLhttps://mpay.ximalaya.com/mobile/track/pay/ 开始。 此 URL 就包含你想要的 uidtoken

注意:VIP 和 自购是不同的 token

uid_token.png

export XMLY_UID=YOUR_UID
export XMLY_TOKEN=YOUR_TOKEN

激活工具

chmod +x xmly
./xmly

# Commands:
#   xmly album <album_id> <category> <dir>  # xmly album 4417201 keji /tmp
#   xmly download <audio_ids> <dir>         # xmly download 26903700,27251627 /tmp
#   xmly help [COMMAND]                     # Describe available commands or one specific command

示例演示

下载专辑

下载卓老板聊科技第二季

mkdir ~/keji4417201
./xmly album 4417201 keji ~/keji4417201

批量下载多个音频

这个命令适合某些音频下载失败时候使用,音频 ID 可以从专辑下载的失败日志中拿到。

音频ID 名称 URL
45213979 发现天使粒子是怎么回事 https://www.ximalaya.com/keji/4417201/45213979
37492676 认识人类的语言和手势 https://www.ximalaya.com/keji/4417201/37492676
38739420 绘画和音乐是大脑发育的副产品 https://www.ximalaya.com/keji/4417201/38739420
./xmly download 45213979,37492676,38739420 /tmp

xmly-download's People

Contributors

jameszhan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

xmly-download's Issues

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.