注意:本项目源代码目前只托管在 Github 平台,该平台的logo是一只“直立着、有一只触手的章鱼猫”,若您在其他地方看到本项目,请勿相信。
gggggggggggggggggggggggggggggggggggggggggggggggpppbbbbbbbbbbbbbbbpppggggggggggggggggggggggggggggggggggggggggggggggg
ggggggggggggggggggggggggggggggggggggggpbmhb7 77hhbbpgggggggggggggggggggggggggggggggggggggg
ggggggggggggggggggggggggggggggggpbh7 77hbpgggggggggggggggggggggggggggggggg
gggggggggggggggggggggggggggpph7 7hpgggggggggggggggggggggggggggg
gggggggggggggggggggggggpph 7hpgggggggggggggggggggggggg
ggggggggggggggggggggpmb hbggggggggggggggggggggg
gggggggggggggggggppb hpgggggggggggggggggg
gggggggggggggggpb hgggggggggggggggg
gggggggggggggpb hpggggggggggggg
gggggggggggpm 7pggggggggggg
gggggggggpb ggggggggggg gggggggggg hgggggggggg
ggggggggm ggggggggggggggg ggggggggggggggggggg ggggggggggggggg bgggggggg
ggggggpm gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg 7ggggggg
gggggm gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg gggggg
ggggm ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg qgggg
gggm ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggp qggg
ggm ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ggg
gp gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg 7gg
g ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg jg
p gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg g
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg g
m ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg 7
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggm
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
iggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg g
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggp g
g 7gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggm g
g 7ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggpm gg
gg bgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggm ggg
ggg bpgggggggggggggggggggggggggggggggggggggggggggggggggggggggggpm ggg
gggg 7bpgggggggggggggggggggggggggggggggggggggggggggggggggggpmb gggg
ggggg ggggggg 7hbppgggggggggggggggggggggggggggggggggggggggppbh7 ggggg
gggggg 7bgggggggg 77hhhbbpgggggggggggggggggggggpbbhhb7 gggggg
ggggggg 7bggggggg ggggggggggggggggggggggggg gggggggg
ggggggggg bggggggg ggggggggggggggggggggggggggg ggggggggg
ggggggggggg 7ggggggggg gggggggggggggggggggggggggggggg ggggggggggg
gggggggggggg 7gggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggg
ggggggggggggggg bgggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggg
gggggggggggggggggggggggggggggggggggg gggggggggggggggggggggggggggggg ggggggggggggggggggggggggggggggggggggg
_______ __ .___________. __ __ __ __ .______
/ _____|| | | || | | | | | | | | _
| | __ | | `---| |----`| |__| | | | | | | |_) |
| | |_ | | | | | | __ | | | | | | _ <
| |__| | | | | | | | | | | `--' | | |_) |
______| |__| |__| |__| |__| ______/ |______/
透過命令列使用執行命令:本程序可执行文件 [url] [filepath] [--image]
url
微信公眾號文章網頁的urlfilepath
makedown檔案的儲存位置,若該值為目錄,則以文章標題作為文件名保存在該目錄下;若以.md
結尾,則以輸入的檔案名稱作為檔案名稱儲存; ./
為儲存到目前目錄--image
任選參數,文章內圖片的儲存方式,格式為--image=xxx
, xxx
為參數值,有三個提供選擇(預設值為base64):url
圖片引用原src值,一般在網路上(不推薦,微信哪天把它ban掉就寄了);save
圖片存在本地,在與markdown同一個目錄中,若為web伺服器模式,則一併壓縮成zip下載;base64
圖片編碼成base64字串放在markdown檔內例如:windows環境,想把url為https://mp.weixin.qq.com/s/a=1&b=2
的文章(假設定文章標題為「gitcode操你媽」)轉成markdown存到D:wechatmp_bak
下,文章內的圖片儲存到本地
則cmd執行:
wechatmp2makrdown_win64.exe https://mp.weixin.qq.com/s/a=1&b=2 D:wechatmp_bak --image=save
markdown和圖片檔將保存在D:wechatmp_bakgitcode操你妈
下
Windows環境下,檔案或路徑名不能包含以下任何字元:「(雙引號)、*(星號)、<(小於)、>(大於)、?斜線)、/(正斜線)、|(垂直線)、:(冒號)。此時,本程式將以相似的Unicode字元進行替換,具體替換規則為:
"<" -> "≺" ">" -> "≻" ":" -> "∶" """ -> "“" "/" -> "∕" "" -> "∖" "|" -> "∣" "?" -> "?" "*" -> "⁎"
chmod +xw wechatmp2markdown-v1.1.9_linux_amd64
透過web服務使用
執行指令:本程序可执行文件 server [port]
port
監聽的端口當看到wechatmp2markdown server listening on :[port]
時,開啟瀏覽器(或curl工具)存取: localhost:[port]?url=[url]&image=[image]
url
微信公眾號文章網頁的urlimage
可選參數,文章內圖片的保存方式,參數值與其他CLI模式的相同傳回的資料即為該文章的markdown檔(若image=save,則傳回的是zip格式的壓縮包)
例如:windows環境,服務啟動並監聽8964端口,想把url為https://mp.weixin.qq.com/s/a=1&b=2
的文章轉成markdown下載,文章內的圖片儲存到本地
則cmd執行: wechatmp2makrdown_win64.exe server 8964
瀏覽器訪問: localhost:8964?url=https://mp.weixin.qq.com/s/a=1&b=2&image=save
,將傳回一個zip文件
在linux環境下,使用網頁伺服器模式,需要為程式賦予執行權限,例如:
chmod +x wechatmp2markdown-v1.1.9_linux_amd64
去1.20
# 编译目标平台: linux
make build-linux
# 编译目标平台: mac
make build-osx
# 编译目标平台: windows 64位
make build-win64
# 编译目标平台: windows 32位
make build-win32
需gcc,建議安裝tdm64-gcc, mingw64/bin
加入系統環境變量
# 编译目标平台: linux
mingw32-make win-build-linux
# 编译目标平台: mac
mingw32-make win-build-osx
# 编译目标平台: windows 64位
mingw32-make win-build-win64
# 编译目标平台: windows 32位
mingw32-make win-build-win32
(沒裝gcc也無妨,去Makefile找對應的指令執行)
編譯好的檔案在./build
目錄下
抓緊時間窗口。