Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle

Notices

Reply
 
Thread Tools Search this Thread
Old 05-13-2011, 12:33 PM   #31
m0ngr31
Connoisseur
m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.
 
Posts: 66
Karma: 3056
Join Date: Dec 2010
Device: Kindle Paperwhite
Can you send me the file(s) your trying to get to sync? The only way I've tried it with iOS is with a jailbroken iPod touch using iPhone Explorer to sideload it. I'll try copying it over via iTunes.

I'm wondering if iTunes removes the meta info for the file? If you go really far in the book on the iPhone, sync it, then pull it up on your Kindle/PC, will it sync that way?
m0ngr31 is offline   Reply With Quote
Old 05-13-2011, 12:38 PM   #32
m0ngr31
Connoisseur
m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.
 
Posts: 66
Karma: 3056
Join Date: Dec 2010
Device: Kindle Paperwhite
I was just doing some digging... Try using DiskAid or iPhone Explorer. You should be able to use those without jailbraking...
m0ngr31 is offline   Reply With Quote
Advert
Old 05-13-2011, 01:44 PM   #33
Nokturnal
Junior Member
Nokturnal began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2011
Device: Kindle3
Oh dear ...
I found out that (as you mention) i needed to use a 3rd party util to put the books on the iPhone. The point is that using iTunes will put the book in the wrong directory.

It seems to work now - except now my iPhone has decided to sync only one-way. I.e. it seems to only receive the furthest read mark from the server and not return it, but this seems to be for all books - even books purchased from Amazon. :-(
Nokturnal is offline   Reply With Quote
Old 08-09-2011, 02:52 PM   #34
jayrads
Junior Member
jayrads began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Aug 2011
Device: iPad 2, iPhone 4, Moto Atrix on GB
Would this script edit work?

m0ngr31,

Thanks for your work on this script.

Let me start by saying: I'm terrible at windows scripting...

My calibre library directory structure uses author name as sub-directories under my main library directory. I'm trying to make this script to run on all mobi files recursively below my main library directory. If I add recursive switch to both for loops, will it run this script on all my mobi files?

I would change both for loops from
Code:
('dir /b *.mobi')
to
Code:
('dir /b /s *.mobi')
As long as mobi2mobi.exe can handle full paths instead of relative, I don't see why this wouldn't work.

Any thoughts?

Thanks,

jayrads
jayrads is offline   Reply With Quote
Old 09-11-2011, 05:56 PM   #35
m0ngr31
Connoisseur
m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.
 
Posts: 66
Karma: 3056
Join Date: Dec 2010
Device: Kindle Paperwhite
jayrads,

I'm not sure it'd work, but you can give it a shot! I think calibre will add a garbage ASIN number to your books now if you reconvert them to mobi, so unless you want the legit number you probably don't need this script anymore...
m0ngr31 is offline   Reply With Quote
Advert
Old 09-15-2011, 11:24 AM   #36
coondognd
Junior Member
coondognd began at the beginning.
 
coondognd's Avatar
 
Posts: 1
Karma: 10
Join Date: May 2008
Location: Tarrytown, NY
Device: none (yet!)
m0ngr31, thanks for these instructions. This worked swimmingly for me. I'm in the same position as Nokturnal, where the sync seems to be one-way (progress on my Kindle is picked up by my iPhone, but not vice-versa), but one-way is better than no-way, so thanks again!
coondognd is offline   Reply With Quote
Old 09-16-2011, 07:44 PM   #37
m0ngr31
Connoisseur
m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.
 
Posts: 66
Karma: 3056
Join Date: Dec 2010
Device: Kindle Paperwhite
Are you checking for updates on your kindle?
m0ngr31 is offline   Reply With Quote
Old 09-26-2011, 01:38 AM   #38
m0ngr31
Connoisseur
m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.
 
Posts: 66
Karma: 3056
Join Date: Dec 2010
Device: Kindle Paperwhite
Quote:
Originally Posted by jayrads View Post
m0ngr31,

Thanks for your work on this script.

Let me start by saying: I'm terrible at windows scripting...

My calibre library directory structure uses author name as sub-directories under my main library directory. I'm trying to make this script to run on all mobi files recursively below my main library directory. If I add recursive switch to both for loops, will it run this script on all my mobi files?

I would change both for loops from
Code:
('dir /b *.mobi')
to
Code:
('dir /b /s *.mobi')
As long as mobi2mobi.exe can handle full paths instead of relative, I don't see why this wouldn't work.

Any thoughts?

Thanks,

jayrads
Turns out that does work great
m0ngr31 is offline   Reply With Quote
Old 10-26-2011, 02:35 AM   #39
robcohen
Enthusiast
robcohen began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Jun 2008
Device: Kindle and Kindle Touch
think script is choking on special chars in file names

Hi,
This looks very promising but I'm having a problem that looks to me (!) as if it may be because Calibre names my .mobi files with special characters in the name. Output is at end of post. What do you think?

If this is indeed the case can you please suggest what changes I might make to the .bat file to escape them or perhaps it might be easier to change the preferences in Calibre and just run a mass conversion of my library to get names that won't choke the .bat file. And if adjusting Calibre is the easiest that's okay by me but I might take some coaching to get through it. Last time I changed from defaults in Calibre I had a big mess to clean up. This time I've got a good backup so if you can just supply me with the template info you're using for Calibre to avoid the messy file names.

Looks to me like the place to change is in Calibre/Preferences/Import-Export/Saving books to disk/Save template (right?). Mine is set to {author_sort}/{title}/{title} - {authors}. Change the last part after the final / to what? Or is there some other, better way around this issue?

Thanks!
Rob
Attached Files
File Type: txt output from bat.txt (5.7 KB, 257 views)
robcohen is offline   Reply With Quote
Old 10-26-2011, 09:33 PM   #40
robcohen
Enthusiast
robcohen began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Jun 2008
Device: Kindle and Kindle Touch
My mistake - at least part of my issue was a failure to change my Path variable. That's fixed but I'm having a little trouble following the instructions about "-If you can't do the "easy_install" download and install this". What does easy_install refer to? There are four different items to install ahead of this instruction and I can't recall seeing the words "easy_install" anywhere.

I did download and run
http://users.skynet.be/sbi/libxml-py...in32-py2.7.exe
but I'm still getting the message "ImportError: No module named lxml".

Going to reboot and see if anything changes.



Quote:
Originally Posted by robcohen View Post
Hi,
This looks very promising but I'm having a problem that looks to me (!) as if it may be because Calibre names my .mobi files with special characters in the name. Output is at end of post. What do you think?
...
Rob
robcohen is offline   Reply With Quote
Old 10-26-2011, 11:51 PM   #41
robcohen
Enthusiast
robcohen began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Jun 2008
Device: Kindle and Kindle Touch
So when I rebooted I realized I had Python 2.6 & 2.7 installed so I uninstalled everything and started fresh, keeping only the .bat and the asin_search.py.

When I got to the Easy_install step here's what I got:
C:\Python27\Scripts>easy_install-2.7.exe lxml
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.3.1
Downloading http://lxml.de/files/lxml-2.3.1.tgz
Processing lxml-2.3.1.tgz
Running lxml-2.3.1\setup.py -q bdist_egg --dist-dir c:\users\robert\appdata\loca
l\temp\easy_install-szv_tw\lxml-2.3.1\egg-dist-tmp-v0qz3v
Building lxml version 2.3.1.
Building without Cython.
ERROR: 'xslt-config' is not recognized as an internal or external command,
operable program or batch file.

** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt
warning: no files found matching 'lxml.etree.c' under directory 'src\lxml'
warning: no files found matching 'lxml.objectify.c' under directory 'src\lxml'
warning: no files found matching 'lxml.etree.h' under directory 'src\lxml'
warning: no files found matching 'lxml.etree_api.h' under directory 'src\lxml'
warning: no files found matching 'etree_defs.h' under directory 'src\lxml'
warning: no files found matching 'pubkey.asc' under directory 'doc'
warning: no files found matching 'tagpython*.png' under directory 'doc'
warning: no files found matching 'Makefile' under directory 'doc'
error: Setup script exited with error: Unable to find vcvarsall.bat


So I figured I must have missed something and so I downloaded and installed
http://users.skynet.be/sbi/libxml-py...in32-py2.7.exe
instead.

Now when I run the .bat file it's still complaining about missing the lxml:

C:\Users\Robert\Calibre Library>scr.bat
Number of files: 997
The filename, directory name, or volume label syntax is incorrect.
Traceback (most recent call last):
File "asin_search.py", line 6, in <module>
api = API(AWS_KEY, SECRET_KEY, "us")
File "build\bdist.win32\egg\amazonproduct\api.py", line 142, in __init__
File "build\bdist.win32\egg\amazonproduct\processors.py ", line 24, in __init__

ImportError: No module named lxml
Gave a fake ASIN number to: ~11. It's new number is B005703890
The filename, directory name, or volume label syntax is incorrect.
Traceback (most recent call last):
File "asin_search.py", line 6, in <module>
api = API(AWS_KEY, SECRET_KEY, "us")
File "build\bdist.win32\egg\amazonproduct\api.py", line 142, in __init__
File "build\bdist.win32\egg\amazonproduct\processors.py ", line 24, in __init__

ImportError: No module named lxml
Gave a fake ASIN number to: . It's new number is B005703891
The filename, directory name, or volume label syntax is incorrect.
Traceback (most recent call last):
File "asin_search.py", line 6, in <module>
api = API(AWS_KEY, SECRET_KEY, "us")
File "build\bdist.win32\egg\amazonproduct\api.py", line 142, in __init__
File "build\bdist.win32\egg\amazonproduct\processors.py ", line 24, in __init__

ImportError: No module named lxml
Gave a fake ASIN number to: ~11. It's new number is B005703892
The filename, directory name, or volume label syntax is incorrect.
Traceback (most recent call last):
File "asin_search.py", line 6, in <module>
api = API(AWS_KEY, SECRET_KEY, "us")
File "build\bdist.win32\egg\amazonproduct\api.py", line 142, in __init__
File "build\bdist.win32\egg\amazonproduct\processors.py ", line 24, in __init__

ImportError: No module named lxml
Gave a fake ASIN number to: . It's new number is B005703893
^CThe I/O operation has been aborted because of either a thread exit or an appli
cation request.
Terminate batch job (Y/N)?


Have I missed something here? Not at all familiar with Python... Also tried downloading the gzipped tarball from http://pypi.python.org/pypi/lxml/2.3.1. When I open a Cmd window and type buildlibxml.py it ends quickly without any feedback. This file, buildlibxml.py appears to be a python program that downloads the necessary files from ftp://ftp.zlatkovic.com/pub/libxml/ but I have no idea how to make it do that nor can I decipher where to locate the files if I download them directly from zlatkovic.com. If I had some knowledge of Python I might be able to figure this out but have to admit I'm stuck for now.

Can you please tell me what to do to get the library installed so I can run the batch file?

Thanks so much,
Rob
robcohen is offline   Reply With Quote
Old 10-27-2011, 12:48 AM   #42
m0ngr31
Connoisseur
m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.m0ngr31 could sell banana peel slippers to a Deveel.
 
Posts: 66
Karma: 3056
Join Date: Dec 2010
Device: Kindle Paperwhite
Rob,

I'm not sure what's causing the lxml error, but try this instead... It won't put the data automatically from Amazon, but it'll assign an ASIN number, and that's what we're going for here...

Code:
@echo off & setLocal EnableDELAYedExpansion

del temp*.txt>null 2>&1
set "asin1=B00"
set /a count=0

for /f %%a IN ('dir /b *.mobi') do (set /a count=count+1)
echo Number of files: %count%

set /a diff=((9999-%count%) - 1000) + 1
set /a divisor = 32767 / %diff%
set /a diff2=(999 - 100) + 1
set /a divisor2 = 32767 / %diff2%

:Random1
set /a asin2=%random% / %divisor%
if /i %asin2% GTR 9999 goto Random1
if /i %asin2% LSS 1000 goto Random1

:Random2
set /a asin3=%random% / %divisor2%
if /i %asin3% GTR 999 goto Random2
if /i %asin3% LSS 100 goto Random2
set /a temp1=!asin2!

for /f "delims=  " %%b IN ('dir /b *.mobi') do (

C:\Users\m0ngr31\desktop\kindle\mobi2mobi.exe --outfile "%%b" --delexthtype 113 "%%b">null 2>&1
C:\Users\m0ngr31\desktop\kindle\mobi2mobi.exe --outfile "%%b" --delexthtype 501 "%%b">null 2>&1

C:\Users\m0ngr31\desktop\kindle\mobi2mobi.exe "%%b" > temp1.txt
findstr /i "longtitle" temp1.txt > temp2.txt
set /p title1=<temp2.txt
set title1=!title1:~11!

find /i "item: 100" temp1.txt > temp3.txt

for /f "tokens=* delims= " %%a in (temp3.txt) do (
set var=%%a
)

set author1=!var!
set author1=!author1:~33!

set filename=%%b
call :movement %%b
)

:movement

if "!tempfile!"=="!filename!" goto :end

C:\Users\m0ngr31\desktop\kindle\mobi2mobi.exe --outfile "!filename!" --exthtype 113 --exthdata "!asin1!!asin3!!temp1!" "!filename!">null 2>&1
echo Gave a fake ASIN number to: !title1!. It's new number is !asin1!!asin3!!temp1!
set /a temp1=!temp1!+1

C:\Users\m0ngr31\desktop\kindle\mobi2mobi.exe --outfile "!filename!" --addexthtype 501 --exthdata "EBOK" "!filename!">null 2>&1
set tempfile=!filename!

:end
del temp*.txt>null 2>&1
del null*
I don't have Windows on my laptop right now (just Linux atm), so I can't say that this will work for sure.. Let me know.

For what this does though, I think calibre does automatically when you convert your .mobi files to .mobi files. It should assign a fake ASIN number so that it'll work over whispersync. So if this script won't work, try using calibre to do it. I've been spending time working on getting sideloading working on the HP Touchpad, but sometime soon I'll rewrite this script so that it won't have so many dependencies...
m0ngr31 is offline   Reply With Quote
Old 10-27-2011, 12:55 AM   #43
robcohen
Enthusiast
robcohen began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Jun 2008
Device: Kindle and Kindle Touch
m0ngr31
Thanks for the quick response - where do I put this code? In the batch file some place file I guess but where?

Rob
robcohen is offline   Reply With Quote
Old 10-27-2011, 12:59 AM   #44
robcohen
Enthusiast
robcohen began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Jun 2008
Device: Kindle and Kindle Touch
Oops, now I look at it, must be a complete replacement for the batch file. Will give it a quick try. I am using the change to the for loops to run on entire Calibre directory, FWIW.

rob
robcohen is offline   Reply With Quote
Old 10-27-2011, 01:13 AM   #45
robcohen
Enthusiast
robcohen began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Jun 2008
Device: Kindle and Kindle Touch
Here's what I get when I run your code above with just the mods to change the for loops and the directory for the mobi2mobi.exe.


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Windows\system32>cd /users/robert/calibre library

C:\Users\Robert\Calibre Library>scr2.bat
Number of files: 998
Gave a fake ASIN number to: Cutting for Stone. It's new number is B005752642
'I' is not recognized as an internal or external command,
operable program or batch file.
Gave a fake ASIN number to: The Christ Conspiracy: The Greatest Story Ever Sold.
It's new number is B005752643
'I' is not recognized as an internal or external command,
operable program or batch file.
Gave a fake ASIN number to: In Fifty Years We'll All Be Chicks. It's new number
is B005752644
'I' is not recognized as an internal or external command,
operable program or batch file.
Gave a fake ASIN number to: Go the Fuck to Sleep. It's new number is B005752645
'I' is not recognized as an internal or external command,
operable program or batch file.
bogus database name! is this really a PalmOS file? at Palm/PDB.pm line 537.
Gave a fake ASIN number to: to Sleep. It's new number is B005752646
'I' is not recognized as an internal or external command,
operable program or batch file.
Record 77 has same offset as previous one: 168238
Gave a fake ASIN number to: Suppliant Maidens and Other Plays by Aeschylus. It's
new number is B005752647
'I' is not recognized as an internal or external command,
operable program or batch file.
Gave a fake ASIN number to: The House of Atreus by Aeschylus. It's new number is
B005752648
'I' is not recognized as an internal or external command,
operable program or batch file.
Gave a fake ASIN number to: An Improvised Life: A Memoir. It's new number is B00
5752649
'I' is not recognized as an internal or external command,
operable program or batch file.
Gave a fake ASIN number to: Spies of the Balkans. It's new number is B005752650
'I' is not recognized as an internal or external command,
operable program or batch file.
Gave a fake ASIN number to: The Foreign Correspondent. It's new number is B00575
2651
'I' is not recognized as an internal or external command,
operable program or batch file.
Gave a fake ASIN number to: Moods. It's new number is B005752652
'I' is not recognized as an internal or external command,
operable program or batch file.
Gave a fake ASIN number to: The World That Never Was: A True Story of Dreamers,
Schemers, Anarchists, and Secret Agents. It's new number is B005752653
'I' is not recognized as an internal or external command,
operable program or batch file.

Rob
robcohen is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ePub meta data brudigia ePub 4 07-26-2010 12:58 PM
set meta data with ebook-meta and ebook-convert krischik Calibre 6 01-19-2010 11:40 AM
Setting meta data with ebook_meta. krischik Calibre 6 01-15-2010 11:17 AM
Meta data problems melhall Sony Reader 1 03-31-2008 10:58 PM
PRS-500 Meta Data in Vista not available Gamgee72 Sony Reader Dev Corner 2 09-12-2007 05:12 PM


All times are GMT -4. The time now is 08:36 AM.


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