New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send(upload) an image twice will cause error. #422

Closed
ghost opened this Issue Apr 20, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@ghost

ghost commented Apr 20, 2017

I tried the MediaMessage.say("path.jpg"),it worked perfect when I send a picture to one contact.
But if I send a pic to more people ,it dosen't work.
when upload the same pic more than one times, the MediaId cannot get currectly.

And I suggest that add this function in Room and Contact class ,same as say text.

ps: forgive my poor English!

@zixia

This comment has been minimized.

Show comment
Hide comment
@zixia

zixia Apr 20, 2017

Member

Hello,

  1. You are luck: Room/Contact say(MediaMessage) support had just implemented by @mukaiu by PR #420 , which just merged to the code base at yesterday.

You can try it by update your docker to the latest version.

  1. According to what you had described:

when uploading the same pic more than one times, the MediaId cannot get correctly.

I guess this might because Wechat Server does not allow to upload the same media twice in one Session.

I think the solution should be not to upload the same media file twice by caching the MediaId of the Uploaded File and reuse it in the future.

There also has a very interesting project that we could have a look: 微信表情轰炸器

It can send emoticon by MediaId directly, no need to upload anything.

The configuration file is like a md5/mediaId map, which is very useful at here:

https://github.com/spacelan/wechat-emoticon/blob/master/emoticons.json

[
{
  "url": "http://emoji.qpic.cn/wx_emoji/ic6hURX8DEDW5he0vo7kK1YR74EiafuDsezGNwibZU7RA7wXoia6WOs5FQ/",
  "md5": "54fa992dfff691c63879682f3d141e46"
}, {
  "url": "http://emoji.qpic.cn/wx_emoji/aL7ySfk4WblG1giaGl7haADVFpxgZfjhwVR1ycGOVfJ9ickDNTd7QgqQ/",
  "md5": "725019d0ad8622a972052475793ec17d"
},
]

@mukaiu How do you think about this?

Member

zixia commented Apr 20, 2017

Hello,

  1. You are luck: Room/Contact say(MediaMessage) support had just implemented by @mukaiu by PR #420 , which just merged to the code base at yesterday.

You can try it by update your docker to the latest version.

  1. According to what you had described:

when uploading the same pic more than one times, the MediaId cannot get correctly.

I guess this might because Wechat Server does not allow to upload the same media twice in one Session.

I think the solution should be not to upload the same media file twice by caching the MediaId of the Uploaded File and reuse it in the future.

There also has a very interesting project that we could have a look: 微信表情轰炸器

It can send emoticon by MediaId directly, no need to upload anything.

The configuration file is like a md5/mediaId map, which is very useful at here:

https://github.com/spacelan/wechat-emoticon/blob/master/emoticons.json

[
{
  "url": "http://emoji.qpic.cn/wx_emoji/ic6hURX8DEDW5he0vo7kK1YR74EiafuDsezGNwibZU7RA7wXoia6WOs5FQ/",
  "md5": "54fa992dfff691c63879682f3d141e46"
}, {
  "url": "http://emoji.qpic.cn/wx_emoji/aL7ySfk4WblG1giaGl7haADVFpxgZfjhwVR1ycGOVfJ9ickDNTd7QgqQ/",
  "md5": "725019d0ad8622a972052475793ec17d"
},
]

@mukaiu How do you think about this?

@zixia zixia changed the title from Send same Image to many concat error! to Send(upload) an image twice will cause error. Apr 20, 2017

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Apr 20, 2017

@zixia Thanks for your comment.

ghost commented Apr 20, 2017

@zixia Thanks for your comment.

@mukaiu

This comment has been minimized.

Show comment
Hide comment
@mukaiu

mukaiu Apr 20, 2017

Contributor

@iRabbit What is the interval between sending two times?

Contributor

mukaiu commented Apr 20, 2017

@iRabbit What is the interval between sending two times?

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Apr 24, 2017

@mukaiu I want to send the same image to different contacts, so I think send message in the same times will be better.

In my mind, if the MediaId of MediaMessage can be remembered after Image uploaded ,that will be usefull.

ghost commented Apr 24, 2017

@mukaiu I want to send the same image to different contacts, so I think send message in the same times will be better.

In my mind, if the MediaId of MediaMessage can be remembered after Image uploaded ,that will be usefull.

@mukaiu

This comment has been minimized.

Show comment
Hide comment
@mukaiu

mukaiu Apr 25, 2017

Contributor

@iRabbit I can not reproduce this problem. Can be paste the send code?

Contributor

mukaiu commented Apr 25, 2017

@iRabbit I can not reproduce this problem. Can be paste the send code?

@lijiarui

This comment has been minimized.

Show comment
Hide comment
@lijiarui

lijiarui Apr 25, 2017

Member

@iRabbit I can send the same image to different contacts, it works well, my interval is 1 second

Member

lijiarui commented Apr 25, 2017

@iRabbit I can send the same image to different contacts, it works well, my interval is 1 second

@mukaiu

This comment has been minimized.

Show comment
Hide comment
@mukaiu

mukaiu May 2, 2017

Contributor

@iRabbit see #439 #470

Contributor

mukaiu commented May 2, 2017

@iRabbit see #439 #470

@zixia

This comment has been minimized.

Show comment
Hide comment
@zixia

zixia Aug 18, 2017

Member

@iRabbit I'll close this issue because we have lots of related PR merged recently.

Please feel free to reply to reopen it if you can reproduce the problem with the latest code.

Member

zixia commented Aug 18, 2017

@iRabbit I'll close this issue because we have lots of related PR merged recently.

Please feel free to reply to reopen it if you can reproduce the problem with the latest code.

@zixia zixia closed this Aug 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment