wechaty / puppet-wechat

Wechaty Puppet Provider for WeChat
https://www.npmjs.com/package/wechaty-puppet-wechat
Apache License 2.0
408 stars 68 forks source link

发送一个网路图片,但是url地址中没有文件类型,提示no MIME Type found on mediaMessage #158

Open leochen-g opened 2 years ago

leochen-g commented 2 years ago

示例图片地址: http://p3-webcast.douyinpic.com/img/webcast/6927462391257500419~tplv-resize:0:0.image 问题:

image

解决思路:

file-box包中,我看到对mimeType是有多种取值方式的,那么在wechaty-puppet-wechat中是否可以也进行多种判断来赋值mimeType呢,例如传入的file对象name里能解析出mimeType就使用,解析不出就用file对象中mimeType属性。不知这种方法能否可行呢 @huan ,是否会影响到其他地方

file-box处理方式 image

猜测处理方式

image

huan commented 2 years ago

在file-box包中,我看到对mimeType是有多种取值方式的,那么在wechaty-puppet-wechat中是否可以也进行多种判断来赋值mimeType呢,例如传入的file对象name里能解析出mimeType就使用,解析不出就用file对象中mimeType属性。不知这种方法能否可行呢 @huan ,是否会影响到其他地方

I believe it will be a good solution. PR will welcome.

Good catch and thank you very much for the contribution!