Skip to content

Instantly share code, notes, and snippets.

@tomgross

tomgross/README.md

Last active Sep 14, 2020
Embed
What would you like to do?
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
@p-vernaeckt

This comment has been minimized.

Copy link

@p-vernaeckt p-vernaeckt 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 ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.