tomgross / pcloud

A Python implementation of the pCloud API
MIT License
94 stars 28 forks source link

Download file from public link #51

Closed chrisdkolloff closed 2 years ago

chrisdkolloff commented 2 years ago

Is there a way to download the content of a file via its public link? I want to access the file without having to log into my account.

Thanks!

tomgross commented 2 years ago

Hi @chrisdkolloff

pCloud has a (restricted) API for handling public links. Some of the methods are only accessible with pcloud.com referrers. There is a public method for downloading public items as zip (https://docs.pcloud.com/methods/public_links/getpubzip.html)

This method is currently not implemented in pyCloud API. You have several options:

If you use and ❤️ my software, consider buying me a coffee ☕ https://www.paypal.com/paypalme/tomgross42

tomgross commented 2 years ago

Implemented for 1.0b1: https://pypi.org/project/pcloud/1.0b1/

mrahjoo commented 2 years ago

Thank you Tom, would you please give me a hint how to get the "code" for use with this method?

All below ways described in the website need referrer that is restricted to pcloud.com.

The code could be obtained from: getfilepublink - link to a single file getfolderpublink - link to a folder gettreepublink - link to a tree getcollectionpublink - link to a collection

tomgross commented 2 years ago

Hi @mrahjoo

Since these API calls are restricted the only way I know is to get the code from the web UI of pcloud (https://my.pcloud.com/) manually.

Screenshot 2021-12-07 at 21 59 52