Skip to content

Instantly share code, notes, and snippets.

@tomgross
Last active May 9, 2022 07:58
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomgross/bae4f30023272d8c8c0d920b62720c6b to your computer and use it in GitHub Desktop.
Save tomgross/bae4f30023272d8c8c0d920b62720c6b to your computer and use it in GitHub Desktop.
Homebrew Cask for installing pCloud on a Mac

Installing pCloud with Homebrew Cask

Since this recipe was rejected because of the volatile nature of pCloud links (see homebrew-cask#57634) I try to maintain this myself because it is useful to me and might be for others.

  • Download pcloud-drive.rb.
  • Run brew cask install pcloud-drive.rb.

To uninstall run brew cask uninstall pcloud-drive.rb.

cask 'pcloud-drive' do
version '3.7.9'
sha256 '0f251933096e44cdcc15334d6d27fec347dad5d66134f1dc93e21a152a2a163c'
url do
require 'net/http'
require 'json'
api = 'https://api.pcloud.com/'
code = 'XZNF4C7Zrqw256sL45jrAn7RhtDVnkKAlOw7'
uri = URI(api + 'getpublinkdownload?code=' + code)
response = Net::HTTP.get(uri)
data = JSON.parse(response)
data['hosts'][0] + data['path']
end
name 'pCloud Drive'
homepage 'https://www.pcloud.com/'
depends_on cask: 'osxfuse'
pkg 'pCloud Drive 3.7.9.pkg'
uninstall quit: 'com.pcloud.pcloud.macos',
pkgutil: 'com.mobileinno.pkg.pCloudDrive'
end
@XNinety9
Copy link

XNinety9 commented Sep 14, 2020

To retrieve the API code:

apicode=$(curl -s https://www.pcloud.com/how-to-install-pcloud-drive-mac-os.html\?download\=mac | grep "'Mac':" | sed "s/[ ,:']*//g;s/Mac//g" | tr -d '\t')

I use it in my reinstall.sh script. It's a full-zsh script (no python nor anything else), and with a bit of sed, tr, grep and curl it retrieves the latest version of pCloud and installs it. Not as easy as a Cask though ^^

@aclark4life
Copy link

Thanks! Added to my setup: aclark4life/setup-macos@672e00a

@tomgross
Copy link
Author

Hi @p-vernaeckt @aclark4life thanks for your feedback! I created a tap for my and your convenience 😄 https://github.com/tomgross/homebrew-pcloud

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