导出 ios 自带的播客 app 订阅列表,之前可以用 itunes,macos 更新后这个功能被取消了,从网上( https://apple.stackexchange.com/questions/374696/exporting-podcasts-from-ios-app-as-opml )找到一个脚本,运行后在桌面生成 opml 文件:
#!/bin/bash
sql() {
sqlite3 "${HOME}/Library/Group Containers/"*.groups.com.apple.podcasts/Documents/MTLibrary.sqlite "select ${1} from ZMTPODCAST ${2:+"where ${2} = '${3}'"};" |\
sed -e 's/&/\&/g' \
-e 's/</\</g' \
-e 's/>/\&lgt;/g' \
-e "s/'/\'/g"
}
opml_export=${HOME}/Desktop/podcasts.opml
cat > ${opml_export} << HEAD
<?xml version="1.0" encoding="utf-8"?>
<opml version="1.0">
<head><title>Podcast Subscriptions</title></head>
<body>
<outline text="feeds">
HEAD
sql ZUUID | while read -r uuid ; do
feed_url=$(sql ZFEEDURL ZUUID "${uuid}")
home_url=$(sql ZWEBPAGEURL ZUUID "${uuid}")
title=$(sql ZTITLE ZUUID "${uuid}")
cat <<EOT
<outline type="rss" text="${title}" title="${title}" xmlUrl="${feed_url}" htmlUrl="${home_url}" />
EOT
done >> ${opml_export}
cat >> ${opml_export} << TAIL
</outline>
</body>
</opml>
TAIL
有需要的自取