Skip to content

How to download file/image on message #253

Closed Answered by Terrance
kingprapop asked this question in Q&A
Discussion options

You must be logged in to vote

As noted already in #252, you should be using SkypeFileMsg.fileContent:

with open('temp.png', 'wb') as image_file:
    image_file.write(event.msg.fileContent)

If that's not retrieving the content you expect, it would be useful to know what you are expecting instead.

If a file offers multiple URLs and you need to fetch a different one, see the definition of fileContent for how it authenticates:

SkPy/skpy/msg.py

Lines 602 to 603 in 00797b1

return self.skype.conn("GET", self.urlContent,
auth=SkypeConnection.Auth.Authorize).content

You should be able to pass in an alternate URL and have it authenticate in the same way. (See also: Auth.Authorize)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kingprapop
Comment options

Answer selected by kingprapop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants