dsmid Linux devotee



Posts: 598 Karma: 2069047 Join Date: Feb 2011 Device: Kindle 3, Kindle 4B, Kindle PW2

FreeDownload hack FreeDownload



EDIT: Uninstall this hack before upgrading the firmware or the upgrade would fail. After upgrade you can install it again.



This hack is a workaround for Kindle browser extension/mime type restrictions.

The browser permits downloading only .prc, .mobi, .azw and .azw1 files. Yet it may be handy to download other file types as well, e.g. .pdf, .epub, .rtf, .zip, .cbz ...



FreeDownload doesn't modify the browser itself, instead it turns on logging of some interesting info the browser is able to produce.

Then it processes the info generated by the browser, i.e. the complete URIs the browser is about to download. If the URI has one of the specified extensions, FreeDownload passes it to curl for download.

At the same time it tries to inform user about downloading at the bottom of the screen. Despite the nagging message box being displayed, your file WILL be downloaded. Works over Wi-Fi only ATM.



FreeDownload's behaviour can be controlled by modifying freedownload.conf located in [USER STORE]/freedownload/ directory.



Default contents of freedownload.conf :



Code: # List extensions you want to have downloaded by FreeDownload # Make sure you don't specify permitted extensions like azw or mobi, your files would be downloaded twice ALLOWED_EXTENSIONS='pdf epub rtf zip cbz mp3' # Where should FreeDownload put your files ? The directory will be created if not present # If / is missing at the beginning of the path, "/mnt/base-us/" (AKA user store) is prepended DOWNLOAD_DIR=documents/Downloaded # Where should FreeDownload put files with 'mp3' extension ? The directory will be created if not present # You can specify separate download directory for any extension in a similar way DOWNLOAD_DIR_mp3=music # Where should FreeDownload put files with 'aax' extension DOWNLOAD_DIR_aax=audible # Resume previous download if a local file with the same name exists # Target files are overwritten if this option is disabled RESUME_DOWNLOADS=yes # Unzip any file with .zip extension into its own subdirectory after download # ZIP archives containing illegal (non-utf8) file names won't be unzipped #AUTO_UNZIP=yes # Log all downloads and errors to freedownload/freedownload.log #LOG=yes

Changelog:

0.4

- Tried to fix CPU overload occuring in some situations



0.3

- Fixed serious issue causing damaged user store (redesigned, autosuspend the service when USB connection is detected)

- Curl now tries to use browser's cookies file

- Reporting now works in landscape mode

- Progress is displayed when downloading

- ZIP archives containing filenames with FAT32-illegal and non-ascii characters are not autounzipped

- Separate download directory can be defined for each extension

- No need to specify full paths for download directories

- In freedownload.conf Windows line endings are converted to UNIX line endings on start

- Added option that controls resuming/overwriting downloads



0.2

- Used curl instead of wget to support https (DropBox Public files download fixed)

- Added option AUTO_UNZIP



0.1

- Initial release EDIT: Uninstall this hack before upgrading the firmware or the upgrade would fail. After upgrade you can install it again.This hack is a workaround for Kindle browser extension/mime type restrictions.The browser permits downloading only .prc, .mobi, .azw and .azw1 files. Yet it may be handy to download other file types as well, e.g. .pdf, .epub, .rtf, .zip, .cbz ...FreeDownload doesn't modify the browser itself, instead it turns on logging of some interesting info the browser is able to produce.Then it processes the info generated by the browser, i.e. the complete URIs the browser is about to download. If the URI has one of the specified extensions, FreeDownload passes it to curl for download.At the same time it tries to inform user about downloading at the bottom of the screen. Despite the nagging message box being displayed, your file WILL be downloaded. Works over Wi-Fi only ATM.FreeDownload's behaviour can be controlled by modifying freedownload.conf located in [USER STORE]/freedownload/ directory.Default contents of freedownload.conf :Changelog:0.4- Tried to fix CPU overload occuring in some situations0.3- Fixed serious issue causing damaged user store (redesigned, autosuspend the service when USB connection is detected)- Curl now tries to use browser's cookies file- Reporting now works in landscape mode- Progress is displayed when downloading- ZIP archives containing filenames with FAT32-illegal and non-ascii characters are not autounzipped- Separate download directory can be defined for each extension- No need to specify full paths for download directories- In freedownload.conf Windows line endings are converted to UNIX line endings on start- Added option that controls resuming/overwriting downloads0.2- Used curl instead of wget to support https (DropBox Public files download fixed)- Added option AUTO_UNZIP0.1- Initial release Attached Files freedownload_0.4.zip (68.8 KB, 4283 views) freedownload_0.4_src.tar.gz (10.4 KB, 1840 views) Last edited by dsmid; 10-31-2011 at 04:34 AM .