Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-11-2011, 05:11 PM   #1
dsmid
Linux devotee
dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.
 
dsmid's Avatar
 
Posts: 598
Karma: 2069047
Join Date: Feb 2011
Device: Kindle 3, Kindle 4B, Kindle PW2
Post 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
Attached Files
File Type: zip freedownload_0.4.zip (68.8 KB, 6008 views)
File Type: gz freedownload_0.4_src.tar.gz (10.4 KB, 3566 views)

Last edited by dsmid; 10-31-2011 at 04:34 AM.
dsmid is offline   Reply With Quote
Old 02-12-2011, 12:20 PM   #2
xlendi
Member
xlendi began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2010
Device: Kindle 3G, Nokia N810
Dsmid, that's great! Good job!
xlendi is offline   Reply With Quote
Advert
Old 02-12-2011, 03:17 PM   #3
dsmid
Linux devotee
dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.
 
dsmid's Avatar
 
Posts: 598
Karma: 2069047
Join Date: Feb 2011
Device: Kindle 3, Kindle 4B, Kindle PW2
New version 0.2 :
  • Used curl instead of wget to support https (DropBox Public files download fixed)
  • Added option AUTO_UNZIP
dsmid is offline   Reply With Quote
Old 02-13-2011, 12:21 AM   #4
stasenko
Junior Member
stasenko began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2010
Device: Amazon Kindle
Thank you for your work. Can you make different download directory for different file extension? For example, '/mnt/us/documents' - 'mobi', '/mnt/us/music' - 'mp3', etc.
stasenko is offline   Reply With Quote
Old 02-13-2011, 05:05 AM   #5
ewandeep
Zealot
ewandeep , Klaatu Barada Niktu!ewandeep , Klaatu Barada Niktu!ewandeep , Klaatu Barada Niktu!ewandeep , Klaatu Barada Niktu!ewandeep , Klaatu Barada Niktu!ewandeep , Klaatu Barada Niktu!ewandeep , Klaatu Barada Niktu!ewandeep , Klaatu Barada Niktu!ewandeep , Klaatu Barada Niktu!ewandeep , Klaatu Barada Niktu!ewandeep , Klaatu Barada Niktu!
 
Posts: 110
Karma: 5368
Join Date: Apr 2010
Location: Italy
Device: Sony PRS-T1 Sony PRS-350 Nook Touch Glow
Graphite

I wonder if it works with the kindle dx graphite.
ewandeep is offline   Reply With Quote
Advert
Old 02-13-2011, 06:54 AM   #6
Wild Rat
Junior Member
Wild Rat began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Amazon Kindle 3 WiFi+3G
Warning! if you download and unzip the archive containing the files whose names contain non Latin characters, then:
1) Unzip the files will have incorrect names
2) Kindle will not see them
3) some files will not delete!
Wild Rat is offline   Reply With Quote
Old 02-13-2011, 12:28 PM   #7
xlendi
Member
xlendi began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2010
Device: Kindle 3G, Nokia N810
I had also problems to uninstal the first version (0.1).
xlendi is offline   Reply With Quote
Old 02-13-2011, 04:19 PM   #8
dsmid
Linux devotee
dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.
 
dsmid's Avatar
 
Posts: 598
Karma: 2069047
Join Date: Feb 2011
Device: Kindle 3, Kindle 4B, Kindle PW2
Exclamation

Please don't install this hack (versions 0.1 and 0.2), it will disable copying files over USB storage and as a result installing any hacks or updates (UPDATE ERROR: 3).
I didn't find out because I don't use the USB connection at all, I use sftp over Wi-Fi instead. Sorry for any inconvenience.

If you already did install it, here's how to get rid of it and make the user store usable again:
  1. Delete the whole directory 'freedownload' in user store
  2. Restart your Kindle
  3. Copy appropriate update_freedownload_0.*_k3*_uninstall.bin to user store then go to Settings and select 'Update your Kindle' in the menu.
  4. Restart the Kindle again
  5. Now your Kindle's user store should be OK again, you can check the filesystem for errors from your PC to make sure everything is all right

Last edited by dsmid; 02-14-2011 at 02:06 AM.
dsmid is offline   Reply With Quote
Old 02-13-2011, 04:29 PM   #9
dsmid
Linux devotee
dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.
 
dsmid's Avatar
 
Posts: 598
Karma: 2069047
Join Date: Feb 2011
Device: Kindle 3, Kindle 4B, Kindle PW2
Quote:
Originally Posted by Wild Rat View Post
Warning! if you download and unzip the archive containing the files whose names contain non Latin characters, then:
1) Unzip the files will have incorrect names
2) Kindle will not see them
3) some files will not delete!
The problem is, that sometimes the ZIP archive contains filenames that use some obscure Windows language-specific encoding. Your Kindle isn't able to find out what encoding Windows uses in your country.
If the filenames are encoded in UTF-8 (the only reasonable standard today), everything's OK.
dsmid is offline   Reply With Quote
Old 02-13-2011, 04:45 PM   #10
dsmid
Linux devotee
dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.
 
dsmid's Avatar
 
Posts: 598
Karma: 2069047
Join Date: Feb 2011
Device: Kindle 3, Kindle 4B, Kindle PW2
Quote:
Originally Posted by stasenko View Post
Thank you for your work. Can you make different download directory for different file extension? For example, '/mnt/us/documents' - 'mobi', '/mnt/us/music' - 'mp3', etc.
When I properly fix the issues with user store access, I'll implement this feature. Stay tuned.
dsmid is offline   Reply With Quote
Old 02-13-2011, 09:04 PM   #11
otichy
Connoisseur
otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!
 
Posts: 82
Karma: 5072
Join Date: Nov 2010
Device: KPW
Maybe the freedownloader should run from somewhere else than /mnt/us ? Or it could stay stored there but run from a temporary location? I don't think the non-unicode characters are the only problem.
otichy is offline   Reply With Quote
Old 02-14-2011, 01:41 AM   #12
dsmid
Linux devotee
dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.
 
dsmid's Avatar
 
Posts: 598
Karma: 2069047
Join Date: Feb 2011
Device: Kindle 3, Kindle 4B, Kindle PW2
Quote:
Originally Posted by otichy View Post
Maybe the freedownloader should run from somewhere else than /mnt/us ?
Yes, it shouldn't open any files on the user store (including its own executable) and this is quite tricky because downloading file usually means opening a file in the user store for writing. Any open files would prevent unmounting the user store on Kindle side when the USB cable is connected to host.
Another option is to stop the service whenever the USB connection is detected - I suppose usbnetwork's ssh daemon is working like that.

Last edited by dsmid; 02-14-2011 at 08:57 AM.
dsmid is offline   Reply With Quote
Old 02-14-2011, 06:05 AM   #13
otichy
Connoisseur
otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!otichy , Klaatu Barada Niktu!
 
Posts: 82
Karma: 5072
Join Date: Nov 2010
Device: KPW
Stopping the service would be the best solution. Otherwise, it should run from somewhere else and it might download the file to some temp location and once it's finished, copy it over to the /mnt/us. The only problem would be if somebody started to download stuff with the hack while having the USB plugged in.
otichy is offline   Reply With Quote
Old 02-14-2011, 09:04 AM   #14
dsmid
Linux devotee
dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.
 
dsmid's Avatar
 
Posts: 598
Karma: 2069047
Join Date: Feb 2011
Device: Kindle 3, Kindle 4B, Kindle PW2
I agree. Stopping the service would be the safest solution.
I had the idea with temp location for downloads before but I was afraid the tmpfs partition is not big enough to hold large downloads and I don't support the idea of dowloading anything to the system partition (running out of disk space there doesn't sound safe).
dsmid is offline   Reply With Quote
Old 02-14-2011, 09:19 AM   #15
Tiersten
Guru
Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.
 
Posts: 987
Karma: 8641
Join Date: Aug 2010
Device: Kindle 3G+WiFi
Running out of space on the user store makes the Kindle go nuts so filling the other partitions is a really bad idea!
Tiersten is offline   Reply With Quote
Reply

Tags
hacks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
want to use Chinese hack on 1.0.02 sujin Sony Reader 0 08-29-2010 07:52 PM
Book titles hack? Time delay hack? re838uk Sony Reader 0 10-08-2009 05:29 AM
.lit hack Cutter74 Sony Reader Dev Corner 7 12-24-2008 12:38 PM
Hack Attack! Esquire wants us to hack their e-paper cover TadW News 26 10-22-2008 03:51 AM
iLiad still possible to hack iliad? joblack iRex Developer's Corner 2 02-06-2007 10:27 AM


All times are GMT -4. The time now is 06:20 AM.


MobileRead.com is a privately owned, operated and funded community.