如何将网易云音乐的歌单同步到spotify

为什么要用Spotify?

1、网易云的弊端
1).网易云大量用户涌入,鱼龙混杂,有目共睹。
2).成也评论,败也评论。带上社交属性的音乐还是音乐吗?
3).我不喜欢网易云的一系列行为。
2、Spotify的优势
1).全球用户量最大的流媒体播放平台
2).曲库丰富,最先吵起来音乐版权的美国乡村歌手Taylor Swift的音乐,在这个平台上也是免费在线播放的。
3).版权
4).ui设计优秀,简洁便利。黑色背景配合amoled屏幕很爽。
5).推送比网易云精准,更合口味。

用Spotify之后,我网易云的歌单怎么办?

这就是教程里要说的了,如果你听英文歌多,那就没问题了,因为spotify没有英文曲库。

如何将网易云音乐的歌单同步到spotify?

步骤
1.获取歌单的id:从浏览器进入到你的歌单,复制地址栏中”music.163.com/#/playlist?id=”后面的数字。
2.到后面下载自己可以用的py文件,请确保电脑上已经正确安装Python。随后,双击.py文件,输入步骤一获得的歌单id。
3.运行.py文件后,在与源码同一文件夹里会出现一个.txt文件,这就是生成的歌单信息了。
4.点开这里并粘贴.txt中的全部内容,等待其自动识别并创建歌单。(自行登录spotify帐号)
注意
一个歌单在一千首以内,api只提供这么多。
部分音乐因为版权问题,无法添加。(这种情况比较少)

源码 python2

import json
import sys
from urllib import urlopen

enterId = 'Enter the playlist id (Enter ? to get help):'
help = 'To get the id of the playlist, go to the page\
of it and look at the address bar.\
 \nPlaylist id is the numbers after \
 "http://music.163.com/#/playlist?id="'
errRetrive = 'No data retrived. \nPlease check the playlist id again.'

while 1:
    playlistId = raw_input(enterId)

    #change the playlistId variable 
    if playlistId == '?':
        print
    urladd = "http://music.163.com/api/playlist/detail?id="\
        + str(playlistId) + "&updateTime=-1"
    # Your code where you can use urlopen
    response = urlopen(urladd).read()
    data = json.loads(response)

    output = ""

    if "result" not in data:
        print(errRetrive)
        print(help)
        continue

    tracks = data["result"]["tracks"]
    for track in tracks:
        trackName = track["name"]
        artist = track["artists"][0]["name"]
        output += trackName + ' - ' + artist + '\n'
    playlistName = data["result"]["name"]

    with open(playlistName + '.txt', 'w') as file:
        file.write(output.encode('utf8'))

    print('Success.\nCheck the directory of this file and find the .kgl file!')

源码python3

# -*- coding: utf-8 -*-
import json
import sys, io
from urllib.request import urlopen

enterId = 'Enter the playlist id (Enter ? to get help):'
help = 'To get the id of the playlist, go to the page\
of it and look at the address bar.\
 \nPlaylist id is the numbers after \
 "http://music.163.com/#/playlist?id="'
errRetrive = 'No data retrived. \nPlease check the playlist id again.'

while 1:
    playlistId = input(enterId)

    #change the playlistId variable 
    if playlistId == '?':
        print
    urladd = "http://music.163.com/api/playlist/detail?id="\
        + str(playlistId) + "&updateTime=-1"
    # Your code where you can use urlopen
    with urlopen(urladd) as url:
        response = url.read().decode('utf-8')
    data = json.loads(response)

    output = ""

    if "result" not in data:
        print(errRetrive)
        print(help)
        continue

    tracks = data["result"]["tracks"]
    for track in tracks:
        trackName = track["name"]
        artist = track["artists"][0]["name"]
        output += trackName + ' - ' + artist + '\n'
    playlistName = data["result"]["name"]


    with open(playlistName+'.txt', 'w',encoding='utf-8') as file:
        file.write(output)

    print('Success.\nCheck the directory of this file and find the .kgl file!')
  • 7
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值