[Tool] Saving Your Trial from the "Dropboxalypse"

Learn how to use AAO by reading tutorials, and seek help from the AAO community.

Moderator: EN - Forum Moderators

Post Reply
User avatar
Evo
Posts: 1844
Joined: Sat Jan 08, 2011 12:30 pm
Spoken languages: Deutsch, English

[Tool] Saving Your Trial from the "Dropboxalypse"

Post by Evo »

Dropbox will be shutting down public folders soon. That means links to files in public folders will break. Since a lot of people here hosted custom content on AAO this way, I've made a tool to automatically reupload the files and change the links.


Am I Affected?

If you use custom content in trials you want to keep and some of the links look like this, you are:

Code: Select all

http://dl.dropboxusercontent.com/u/12345678/file_name.png
("12345678" can be any 8-digit number, "https" can be in place of "http" and "dropbox" can be in place of "dropboxusercontent".)
If there aren't too many links, replacing them manually should be fast (I recommend imgur for images and github for the rest), but if there are a lot, especially in multiple trials, I recommend using the tool.


What Does the Tool Do?

Feel free to skip this section if you're not interested in technical details.

If you run it on a certain trial for the first time, it uses Selenium (an automatic browser) to download the trial data. The browser will close at the end of that, and a backup of the trial data will be created ("backup_[id].txt").

Then it searches the data for assets that have "dropbox" in the URL. Evidence, profiles, places, popups and custom sprites will be uploaded to imgur unless the file extension is .svg, while music, sounds and SVGs will be uploaded to github. It then gets the new URLs and replaces them in the trial data.

Imgur allows to upload directly via an URL, so nothing will be downloaded to your computer. To upload to imgur, the program will try to use the imgur API, which is fast and unnoticable to you. However, the API has an upload limit. If it runs out, the program will instead two Selenium tabs to upload to imgur manually. One of these tabs is imgur. Since the imgur interface heavily relies on copypasting, the other tab (which is the AAO login site since that's the first one I came up with) is used to copypaste links. So don't worry if you see things being pasted into the AAO login site - that's lazy programming a feature, not a bug. Since this takes a while and has a high error rate, the new trial data will be saved in "trial_data_id.txt" every 10 image uploads so you don't have to start over if there's a problem.

To upload to github, the program will download the files to the folder you specified in the config file (more on that later.) This should be relatively fast. Then you just have to sync with github and all the links will work.

If everything went well, the program will then use Enthalpy's upload tool (part of Catalysis) to replace your trial with the new trial data in "trial_data_id.txt".

If you have to restart the program due to an error, it will use "trial_data_id.txt" instead of getting the data from the editor to continue where it left off.

Also, to avoid uploading the same content twice (for example in the case of multiple parts), the first time you run the program, a file called "urldict.txt" will be created. With every change to a trial data file, any new pairs of old and new links will be added to "urldict.txt". If an URL to replace is part of "urldict.txt", rather than uploading anything, it will just replace it with the new URL it already has.


How to Use It
  1. This relies on an automatic version of Chrome, so install Chrome if you don't have it already. Also, download the webdriver, which is needed to automatize it.
  2. If you have any sounds, music tracks or SVGs uploaded on dropbox, create a github account if you don't already have one. You can follow this guide by TheDoctor.
  3. Download this configuration file and fill it out. I recommend putting it in an empty folder, since a lot of text files will be created in the same folder.
  4. Download the tool itself and put it in the same folder as the config.
  5. Open the command prompt, enter 'cd "C:\the_path\to the\folder where savemytrail is"' and then "savemytrail". If you feel uncomfortable with using the command prompt, you can also just double click savemytrail.exe. However, the former has the advantage that you can get potential error messages more easily.
  6. Wait for the program to finish. If you have many images on dropbox, this might take a while.
  7. If you have any sounds, music tracks or SVGs uploaded on dropbox, open the github program, commit recent changes and sync.
  8. Done!

Troubleshooting

The program isn't compatible with my OS.
Unfortunately, I don't have any other versions at the moment. In that case, you can add somebody who can run it (Spyromed volunteers) as a collaborator and have them run the program for you. You can also ask me to do it, in which case you don't need to make me a collaborator.

I'm scared that this is a virus.
I understand. It's good that you don't blindly trust executable files from the internet. In that case, you can add somebody who can run it (Spyromed volunteers) as a collaborator and have them run the program for you. You can also ask me to do it, in which case you don't need to make me a collaborator.

I'm scared that this will destroy my trial.
The program makes a backup of the trial before it does anything. A few other users have already used it and nothing like that happened. If you're still worried or if you're uncomfortable with having the backup only in text form, I recommend that you run it on a test trial first.

The console gives me something about a LatencyInfo vector that's too big.
To be quite honest, I'm not exactly sure what this means myself (very trustworthy, I know.) It comes from a module I've imported, not from my own code. In any case, it doesn't seem to influence anything - I've had this a few times myself, but the new trial worked fine, so you can probably ignore it.

"Problem with processing this data".
This means it couldn't download a certain file to upload on github. To fix that, copy-paste the link from the console to download the file manually, put it in the github folder, copy the link from the empty file with the same name (plus the trial ID), delete the empty file and rename the manually downloaded file to the name you just copied.

"An error occurred. Please run the script again!"
It probably had some trouble with imgur. Run the program again and it should continue roughly where it left off. If it crashes again as soon as it gets to where it left off, please contact me.

It suddenly started pasting URLs into the AAO login site. WTF!?
See "How to Use It" - that's lazy programming a feature, not a bug. Nothing went wrong. Just wait for it to finish, which might take a while this way, unfortunately. If you're getting impatient, you could watch the imgur window do its job (that's what I did when I ran it on all my trials.) That will also help you notice a captcha if imgur demands one.

Anything else.
Please contact me. I should fix errors in the code and replace the file on dropbox with a new version rather quickly.
Post Reply