How to change the location of Viber downloads folder

Files transferred by Viber are stored on ~/Documents/ViberDownloads by default. How is it possible to change the destination to a location under ~/Downloads?


Solution 1:

This is a complimentary answer to AliNa's.

If you want to move your previously downloaded files to the new location follow below steps:

  1. Backup your downloaded files
  2. Backup .ViberPC folder
  3. Open ~/.ViberPC/{your-phone-number}/viber.db with sqliteman
  4. Paste below query to query edit area:

    Update messages set PayloadPath = replace(PayloadPath, "Documents/ViberDownloads", ".viberdownloads") where PayloadPath is not null and PayloadPath <> '';

What this does is; replaces text Documents/ViberDownloads with .viberdownloads in PayloadPath field of messages table. I typed ".viberdownloads" because I wanted my downloads in /home/user/.viberdownloads folder. Change these strings according to your use.

  1. Click Run(F9)

Make sure you carefully backup .ViberPC folder, if something goes wrong you will lose all your message history on this machine.

Solution 2:

Viber preferences are stored as ".db" files under ~/.ViberPC/. You should have installed an extra application in order to open or edit them; for example, Sqliteman which is available from Software Center.

To edit the location of downloads folder, open the following file:

~/.ViberPC/{your-phone-number}/viber.db

On the left sidebar of Sqliteman, open Tables > Settings. You can see the setting entitled DownloadFolder on the bottom right. Double click on its value to change the location as you wish.

Sqliteman window

If you have downloaded some files before you change the setting, you won't be able to open them from Viber afterwards. To solve this, @HeyYo have a great answer.

Solution 3:

In OSX you can find ViberPC folder here /Users/<Username>/Library/Application Support/ViberPC

Solution 4:

The above didn't work for me (in version 6.5.5), so I temporarily fixed it by hacking the main viber binary, the sed below replaces ViberDownloads with .viberDownload:

sudo -i
cd /opt/viber
cp -a Viber Viber.original
hexdump -ve '1/1 "%.2X"' Viber.original | sed "s/5669626572446F776E6C6F616473/2E7669626572446F776E6C6F6164/g" | xxd -r -p > Viber