cenkalti / putio.py

A python wrapper for put.io APIv2
http://put.io
MIT License
72 stars 41 forks source link

Add a method to get download url of a File #41

Closed jlejeune closed 6 years ago

jlejeune commented 6 years ago

Just a little method to get download url of a File object.

jlejeune commented 6 years ago

What do you think @cenkalti ? I need this method to send downloadable links to another job in charge of downloading files and it's better to get these links directly from lib.

cenkalti commented 6 years ago

Hello @jlejeune.

Sorry for the delayed answer.

The link itself as returned from your proposed method won't work itself because there is no authentication token in it. You can use get_stream_link link method if you want to pass it to another workflow.

Let me know if you have further questions.

jlejeune commented 6 years ago

Agree with you, without token, the download link doesn't work, but the token has to be used to define an instance of Client class, so on customer side, and the lib doesn't have this information. The complete link has to be generated on customer side, concating BASE_URL + /files//download + token but it should be better if we can have BASE_URL + path from lib (if BASE_URL change in future for eample). But if you told me, I have to use stream_link, I will try but I'm quite sure I'll have to reformat URL because stream_link is not downloadable.

jlejeune commented 6 years ago

Hi, I answered you on pull request, dunno if you receive a notification because pull request is closed.

Julien

Le lun. 14 mai 2018 à 15:04, Cenk Altı notifications@github.com a écrit :

Closed #41 https://github.com/cenkalti/putio.py/pull/41.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cenkalti/putio.py/pull/41#event-1624746684, or mute the thread https://github.com/notifications/unsubscribe-auth/ABbH0phyO_pOjLygPiDTxp5fSjWBDPOGks5tyYDRgaJpZM4T45YW .

cenkalti commented 6 years ago

Hi @jlejeune. I got the notification from GitHub.

What do you mean by "stream_link is not downloadable"?

jlejeune commented 6 years ago

Hi,

Indeed, It works with stream_link, I can download file with it, my fault. Just little annoying thing is that downloaded file with it doesn't keep the name of the file but its id.