refactor(etl): 优化音频转存与歌词上传流程,支持音频 MD5 计算和歌词换行处理
- 移除 audit_hk_songs_duplicates.py 中删除零时长歌曲的逻辑 - 新增 utils.py 工具模块,提供音频 MD5 计算、歌词处理、OSS 上传等函数 - etl_to_crawler/oss.py 添加 transfer_url_with_md5 函数,用于下载音频、计算 MD5 并上传 OSS - etl_to_crawler/lyric.py 增加 ensure_newlines 函数,确保歌词内容行间带换行符 - etl_to_crawler/runner.py 改进音频转存调用,返回音频 MD5 值 - 通过 safe_upload_lyric 函数上传去时间戳的纯文本歌词,失败时使用原始歌词 URL - etl_to_crawler/writer.py 在歌曲数据写入中新增 audio_md5 字段支持 - 重构 yinyan_song_records 逻辑,新增初始化函数 initialize_yinyan_song_records - run_etl.py 增加 --init-yinyan-records 命令行参数支持仅初始化状态表 - 优化 ETL 运行流程,从预标记状态表中拉取待处理歌曲逐批处理,提高效率 - 新增相关单元测试以覆盖音频 MD5 计算和任务处理逻辑修改
Showing
11 changed files
with
553 additions
and
109 deletions
This diff is collapsed.
Click to expand it.
etl_to_crawler/utils.py
0 → 100644
-
Please register or sign in to post a comment