从LastFM用户收听的唱片集生成封面拼贴。
lastfm-cg的Python项目详细描述
lastfm_cg:lastfm拼贴生成器
从LastFM用户收听的相册生成封面拼贴。
此实用程序需要一个有效的配置文件,其中包含~/.config/lastfm_cg/config.ini中的lastfm api键(在https://www.last.fm/api获取它们)(请参见config_sample.ini以获取示例)。
它还缓存了由于请求缓存库而请求的图像文件。如果不希望脚本在~/.local/share/lastfm_cg/文件夹中创建sqlite文件,则必须使用-d/--disable_cache标志启动脚本。
还提供了一个Twitter机器人和一个乳齿象帖子。
要求
- Pylast
- 努比
- 枕头
- 请求
- 请求缓存
- 全面质量管理
安装
pip install lastfm_cg
如果您是archlinux用户,可以安装aur包lastfm_cg-git。
在virtualenv中安装
git clone https://github.com/dbeley/lastfm_cg
cd lastfm_cg
pipenv install '-e .'
用法
显示帮助和可用选项。
lastfm_cg -h
usage: lastfm_cg [-h] [--debug] [--timeframe TIMEFRAME] [--rows ROWS]
[--columns COLUMNS] [--username USERNAME] [-d]
Create lastfm album collage for an user
optional arguments:
-h, --help show this help message and exit
--debug Display debugging information
--timeframe TIMEFRAME, -t TIMEFRAME
Timeframe (Accepted values : 7day, 1month, 3month,
6month, 12month, overall. Default : 7day).
--rows ROWS, -r ROWS Number of rows (Maximum value : 31. Default : 5).
--columns COLUMNS, -c COLUMNS
Number of columns (Maximum value : 31. Default :
number of rows).
--username USERNAME, -u USERNAME
Usernames to extract (separated by comma)
-d, --disable_cache Disable the cache
为用户用户生成过去7天5x5大小的拼贴(默认值)。
lastfm_cg -u USER
lastfm_cg -u USER -t 7day -r 5
为用户用户和大小为3x30的用户2生成所有侦听历史记录的拼贴。
lastfm_cg -u USER,USER2 -t overall -r 3 -c 30
lastfm_cg --username USER,USER2 --timeframe overall --rows 3 --columns 30