How to change the location of Viber downloads folder

54,714

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

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

Solution 3

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
Share:
54,714

Related videos on Youtube

AliN
Author by

AliN

Ubuntu user since late 2011, also interested in Firefox », SailfishOS », writer of Linux Season », an Iranian website of GNU/Linux news. Language passionate, EO-isto, technical translator EV geek », mechanical engineer.

Updated on September 18, 2022

Comments

  • AliN
    AliN almost 2 years

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

  • muru
    muru over 6 years
    You could probably do sudo sed -i.original 's/ViberDownloads/.viberDownload/g' /opt/viber/Viber; the string exists as-is in the executable.
  • nightshift
    nightshift over 6 years
    Yes, the straight sed works too. Note to anyone attempting this: the replacement string must not be longer than the original. But it can be shorter, just pad with NULLs.
  • Sasha
    Sasha over 4 years
    I made it to use ~/Downloads/V (referred as ~/Documents/../Downloads/V) instead of ~/Documents/ViberDownloads by invoking sudo sed -i.original 's/ViberDownloads/..\/Downloads\/V/g' /opt/viber/Viber.