Spotify和Tunefind Bridge Simple CLI
spotifind的Python项目详细描述
spotifind公司
结合Spotify和Tunefind的简单命令行工具
Tunefind is a music search website这有助于查找电视剧和电影中的音乐。用户可以推荐与电视节目相关的歌曲或电影。如果批准后,歌曲将列在该页上。在
Spotify is a digital music streaming service可以让您访问来自世界各地艺术家的数百万首歌曲、播客和视频,如Apple Music和Amazon Music Unlimited。在
在过去的一周里,当人们被关在家里工作时,我认为这是一个有趣的项目,去考虑配乐。我刚刚得到了一个新的spotify高级帐户,虽然你可能可以找到几乎任何电视剧的公共播放列表,但我认为将Tunefind和spotify链接到用户生成的电视节目列表中会很有趣。在
Spotify(Spotify+Tunefind)是一个工具,旨在首先授权和验证您的Spotify API,并与Tunefind一起搜索和创建播放列表。在
此工具有两个要求:
- 你有一个spotify帐户
- 新建[spotify客户端]
Spotify客户端安装需要两个主要步骤
- 客户端ID和客户端密码
- 设置重定向URI时,可以使用它重定向Spotify的授权流。简而言之,一旦你授权了你的应用程序,重定向URI将与允许授权的代码一起打开。在本例中,我使用“http://google.com”,但您可以使用任何您想要的。在
让我们回到问题和设置
> spotifind -h
usage: spotifind [-h] {spot_init,spot_auth,spot_refresh,spot_tune} ...
Spotify and Tunefind Bridge Simple CLI
positional arguments:
{spot_init,spot_auth,spot_refresh,spot_tune}
spot_init Initialize Spotify & setup client credentials
spot_auth Authorize Spotify Client and get access and refresh
tokens
spot_refresh Refresh spotify token
spot_tune Tunefind playlist to spotify playlist
optional arguments:
-h, --help show this help message and exit
立即安装
^{pr2}$点初始化
你只需要做一次。这需要考虑一些事情,您的客户机id,您的客户机机密(不要担心您的客户机机密不会以明文或直接存储在任何地方)。它存储了三种特定的东西
- 你的客户id
- base64编码客户端ID:clientsecret(由于base64编码不是加密,因此可以对其进行解码,因此请尝试在您的个人计算机或虚拟机上使用此应用程序:别担心,您可以随时重置您的客户端密码)
- 重定向我们先前设置的URI
简单地跑
spotifind spot_init
点验证
这是授权设置,它使用您的客户端id和您使用spot_init设置的客户端机密文件。复制并粘贴重定向URI,您应该能够创建认证.json具有以下设置的凭据文件。该设置包括所有作用域,将来用户只需发送他们想要访问的作用域。我把所有可能的望远镜都激活了。在
{
"access_token": "BQzxzRkNgSxJm0mEc..............lq74SenuW0lFEIqKjJF",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "AQD80AT2u..............85j2Hk579vTQkstZG-dinGDK7L4",
"scope": "playlist-read-private playlist-read-collaborative user-follow-read playlist-modify-private user-read-email user-read-private user-follow-modify user-modify-playback-state user-library-read user-library-modify playlist-modify-public user-read-playback-state user-read-currently-playing user-read-recently-played user-top-read"
}
工具设置如下
> spotifind spot_auth -h
usage: spotifind spot_auth [-h] [--overwrite OVERWRITE]
optional arguments:
-h, --help show this help message and exit
Optional named arguments:
--overwrite OVERWRITE
Type yes to overwrite existing
如果您已经完成了这一步,但想使用不同的客户机或不同的帐户,您可以使用安装程序
spotifind spot_auth --overwrite "yes"
点刷新
这将一直使用,尽管您的访问令牌每一小时过期一次,但刷新令牌可用于生成新的访问令牌。您不一定需要此工具,但它是内置的,并用作spot_tune工具的模块,通过首先刷新访问令牌来生成播放列表。设置很简单
spotifind spot_refresh
点调谐
这是一个主要工具,将用于将Tunefind系列URL转换为spotify播放列表并将其添加到您的帐户。该工具添加了一些功能,如
- 检查现有播放列表,以防使用现有播放列表
- 检查播放列表中是否存在歌曲,因此相同的歌曲不会添加两次
- 因为一次只能添加100首歌曲,所以它也会遍历歌曲列表并将其分块添加到播放列表中。在
工具设置为
> spotifind spot_tune -h
usage: spotifind spot_tune [-h] --url URL --name NAME --desc DESC --playlist
PLAYLIST
optional arguments:
-h, --help show this help message and exit
Required named arguments.:
--url URL Tunefind series url
--name NAME Spotify playlist name
--desc DESC Spotify Playlist Description
--playlist PLAYLIST public or private
设置是
spotifind spot_tune --url "https://www.tunefind.com/show/self-made-inspired-by-the-life-of-madam-cj-walker" --name "walker" --desc "playlist-test"
这是一个周末项目,实施起来非常有趣。目前,这将是特别维护,我希望添加更多的spotify工具的灵感,一些惊人的项目在那里,既然你授权你自己所有的范围,为什么不探索更多:)
变更日志
0.0.4
- 将fuzzyfuzzy替换为rapidfuzz
0.0.3
- 添加分页以获取所有轨迹列表
- 总体改进
- 应用模糊歌曲搜索
- 项目
标签: