5

【教程】UHost部署爬虫下载网易云音乐到US3上

 3 years ago
source link: https://zhuanlan.zhihu.com/p/337349265
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

【教程】UHost部署爬虫下载网易云音乐到US3上

首先,从git上拉取项目

git clone https://github.com/money666-sxy/msc_crawler

然后,依次安装以下依赖

pip3 install pipreqs

pipreqs . --encoding=utf8 --force

pip3 install -r requirements.txt

pip3 install pycryptodome

cd ufile-sdk-python/

python3 setup.py install

pip3 install ufile

之后配置ufileup.py的以下字段

public_bucket = '' #公共空间名称(不加后缀)
private_bucket = '' #私有空间名称(不加后缀) 二选一
localfile = '' #本地文件名
put_key = '' #上传文件在空间中的名称
region = ''
public_key = ''
private_key = ''

一切配置完成之后开始使用,方法如下:

python3 down_music.py #按提示输入歌曲名称下载歌曲

效果展示:

下载之后的歌曲可以在down_music文件夹中查看

本文源自UCloud用户社区,原文链接:uhost部署爬虫下载网易云音乐到us3上-UCloud优刻得中立云计算用户问答社区


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK