跳转到主要内容

将Spotify播放列表转移到YouTube音乐

项目描述

PyPI Downloads Ask questions at Discussions Code coverage Latest release Commits since latest release

一个简单的命令行脚本,用于克隆Spotify播放列表到YouTube音乐。

  • 转移单个Spotify播放列表

  • 喜欢Spotify播放列表中的所有歌曲

  • 在YouTube音乐中更新已转移的播放列表

  • 转移Spotify用户的全部播放列表

  • 喜欢Spotify用户所有播放列表中的所有歌曲

  • 从YouTube音乐中删除播放列表

安装

pip install spotify_to_ytmusic

设置

  1. https://developer.spotify.com/dashboard上生成一个新的应用

  2. 运行

spotify_to_ytmusic setup

为了与旧版本兼容,您也可以创建自己的文件并使用 --file settings.ini 传递它。

如果您想从Spotify转移私人播放列表(例如,喜欢的歌曲),则选择“是”进行OAuth身份验证,否则选择“否”。对于OAuth身份验证,您应在Spotify的开发者仪表板中将应用的重定向URI设置为 http://localhost

用法

设置完成后,您可以从命令行简单地使用以下命令运行脚本:

spotify_to_ytmusic create <spotifylink>

其中 <spotifylink> 是类似 https://open.spotify.com/playlist/0S0cuX8pnvmF7gA47Eu63M 的链接

脚本将记录其进度并将找不到的YouTube音乐的曲目输出到 noresults_youtube.txt

转移Spotify用户的全部播放列表

出于迁移目的,可以使用Spotify用户的ID(唯一的用户名)转移用户的所有公共播放列表。

spotify_to_ytmusic all <spotifyuserid>

传输Spotify用户的喜欢曲目

传输喜欢的歌曲时必须使用oAuth身份验证。

spotify_to_ytmusic liked

此命令将打开浏览器,您应在其中授权您的账户(如果您之前还没有这样做)。授权后,您将被重定向到localhost,复制您被重定向到的链接(看起来像localhost/?code=…),并将其粘贴到命令行。

命令行选项

有一些额外的命令行选项用于设置播放列表名称以及确定其是否公开。要查看它们,请运行

spotify_to_ytmusic -h

要查看子命令帮助,请运行,例如

spotify_to_ytmusic setup -h

可用子命令

positional arguments:
  {setup,create,update,remove,all}
                        Provide a subcommand
    setup               Set up credentials
    create              Create a new playlist on YouTube Music.
    update              Delete all entries in the provided Google Play Music playlist and update the playlist with entries from the Spotify playlist.
    remove              Remove playlists with specified regex pattern.
    all                 Transfer all public playlists of the specified user (Spotify User ID).

options:
  -h, --help            show this help message and exit

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

spotify_to_ytmusic-0.4.0.tar.gz (26.6 kB 查看散列)

上传时间

构建分布

spotify_to_ytmusic-0.4.0-py3-none-any.whl (13.2 kB 查看散列)

上传时间 Python 3

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面