標籤

2024年1月15日 星期一

下載香港電台節目重温

 最近在幫婆婆下載她很喜歡的港台節目,舊日的足跡。

記錄一下方法,我用的是ffmpeg程式,在網站按F12看代碼,按Crtl+F找"m3u8".

最後用以下的代碼以ffmpeg執行就可。

ffmpeg -i https://rthkaod2022.akamaized.net/m4a/radio/archive/radio1/hkfootpath/m4a/20230129.m4a/master.m3u8 -acodec mp3 -ab 257k hkfootpath_20230129.mp3                                                                                         

最後我用chatgpt 寫了這python code

import os

sundays_in_2023 = [
'20230101', '20230108', '20230115',
'20230205', '20230212', '20230219', '20230226',
'20230305', '20230312', '20230319', '20230326',
'20230402', '20230409', '20230416', '20230423', '20230430',
'20230507', '20230514', '20230521', '20230528',
'20230604', '20230611', '20230618', '20230625',
'20230702', '20230709', '20230716', '20230723', '20230730',
'20230806', '20230813', '20230820', '20230827',
'20230903', '20230910', '20230917', '20230924',
'20231001', '20231008', '20231015', '20231022', '20231029',
'20231105', '20231112', '20231119', '20231126',
'20231203', '20231210', '20231217', '20231224', '20231231'
]

for date in sundays_in_2023:
command = (
"C:\\Users\\terre\\Documents\\00_Applications\\ffmpeg-2021-10-18-git-d04c005021-full_build\\bin\\ffmpeg "
"-i https://rthkaod2022.akamaized.net/m4a/radio/archive/radio1/hkfootpath/m4a/"
+ date + ".m4a/master.m3u8 -acodec mp3 -ab 257k hkfootpath_" + date + ".mp3 "
)
os.system(command)

自動化下載了2023的每一集