It's a common problem while travelling or on vacation. There are many solutions. Here is my solution. This is for Linux people with an Android mobile device who are running a Linux computer somewhere (home, office, in the cloud, or a Raspberry Pi). I'll refer to this computer as the 'server'.
So the idea is I use Bit Torrent Sync to communicate between the mobile device and the server. BTSync is handy because it's peer-to-peer and doesn't require any firewall configuration.
- Install Bit Torrent Sync on the server and run it (you'll probably want to configure the server to start this automatically on boot).
- Create a directory and generate a shared key for the directory.
- Install Bit Torrent Sync for Android on the mobile device
- Create a directory and assign the key created in step 2. You can do this using QR codes.
- Install a simple text editor app on the Android device if you don't already have one. I use Jota.
- Download and install youtube-dl tool on the server if you don't already have it.
- Download the youtube_fetch_daemon.sh script. Review it and satisfy yourself it does what you expect it to (it's less than a screen of code). Then run it and let it continue to run. Or set it up to start on boot.
So let's say you're in an airport waiting to board. You have access to moderate WiFi, but would like to download a few videos to watch on the flight. This is how to do it:
- Navigate to the video in the YouTube app.
- From the menu chose 'Copy URL'.
- In the Android text editor paste the URL and save the file as a .txt file in the directory created in step 4. This file will now transfer to your server and will cause that YouTube video to download.
- After allowing a suitable amount of time (depending on the quality of the connection on the server and the size of the video), use the BTSync app to view remote files. If you see the video there, touch that video and it will start to download to your device.
- Use your video player to play off local storage.
28 July 2013: Link to youtube_fetch_daemon.sh script fixed.