Order it now! Amazon prioritizes orders on a first come, first served basis.


View Full Version : Calibre now includes MS LIT converter: lit2lrf


Pages : [1] 2

kovidgoyal
06-22-2007, 03:25 PM
Calibre (http://calibre.kovidgoyal.net/) v0.3.55 now has a Microsoft LIT to LRF converter, named, you guessed it, lit2lrf. It's a thin wrapper around html2lrf which takes care of unpacking LIT files for you.

Note that it will only work on non-DRMed files. Linux users will have to manually install ConvertLit (http://www.convertlit.com/).

Since I don't have any LIT files at the moment, I'd appreciate some testing.

Enjoy.

aleandre
06-22-2007, 06:09 PM
Hi kovidgoyal,

I am new to Mobileread and to Linux in general, and I use your libprs500 to transfer books from my laptop running Ubuntu to my Sony Reader. Everything works fine apart from some odd error message when I transfer files to the Reader, telling me there was a series of errors during the transfer, but without negative effect in practice (the same happens when I delete files on the Reader via libprs500, btw).

Still, I'm willing to give your new version a go to see what you've changed, but reinstalling libprs500 following the operations on your website still gets me version 0.3.37, not 0.3.55.

Am I doing something wrong or missing something ?

By the way, let this be the occasion to thank you for your fantastic contribution for the cause of Linux and free data exchange in general ! I am (slowly) learning Python, and I can see what amount of work you must have put in this :2thumbsup !

kovidgoyal
06-22-2007, 08:16 PM
Hi aleandre,

Welcome to mobileread and to Linux! Hopefully this will be the start of a long and fruitful acquaintance with both :-)

Thanks for the kind words, they're always much appreciated.

To upgrade libprs500 you need the command

easy_install-2.5 -U libprs500


EDIT: And I should say that you will enjoy Python. Let me recommend ipython as a great tool to ease python development.
Note the -U it means upgrade.

Can you post the error message you get while transferring files, it shouldn't be showing any errors at all.

aleandre
06-23-2007, 06:14 PM
Thank you for your help, kovidgoyal !

I did what you suggested, and the installation script does indicate I am installing version 0.3.55 :

root@Fidelio3-Ubuntu:~# easy_install-2.5 -U libprs500
Searching for libprs500
Reading http://cheeseshop.python.org/pypi/libprs500/
Reading http://libprs500.kovidgoyal.net
Reading http://cheeseshop.python.org/pypi/libprs500/0.3.55
Best match: libprs500 0.3.55
Downloading http://cheeseshop.python.org/packages/2.5/l/libprs500/libprs500-0.3.55-py2.5.egg#md5=94f85c1b8dc1e129f97562ce178082d8
Processing libprs500-0.3.55-py2.5.egg
Moving libprs500-0.3.55-py2.5.egg to /usr/lib/python2.5/site-packages
Removing libprs500 0.3.27 from easy-install.pth file
Adding libprs500 0.3.55 to easy-install.pth file
Installing lrf-meta script to /usr/bin
Installing markdown script to /usr/bin
Installing rtf-meta script to /usr/bin
Installing html2lrf script to /usr/bin
Installing prs500 script to /usr/bin
Installing txt2lrf script to /usr/bin
Installing lit2lrf script to /usr/bin
Installing libprs500 script to /usr/bin

Installed /usr/lib/python2.5/site-packages/libprs500-0.3.55-py2.5.egg



I thought I still had version 0.3.27, because, even after the install, that's what the GUI displays... :D

Now, about this error message, you will find it in the attached file. This happens still after the upgrade, but as I wrote earlier this doesn't seem to impact the results : the books are transfered to the Reader all the same.

Thank you for your mentioning of ipython : I am at the moment using DrPython, and that seems to be what I need just now. I just would like to learn a "modern" programming language to exercise this skill during my free time : not that I've got that much, but I still have fond memories of programming in Pascal and C as a teenager in the 80's-early 90's.

I will try sometimes next week to find a .lit file to transfer to the Reader using libprs500. I understand I should just add it to the library and then transfer it to the Reader like any other file, shouldn't I ?

Regards,

aleandre.

kovidgoyal
06-23-2007, 06:58 PM
Released v0.3.56 with a bugfix. The bug was preventing lit2lrf from picking up the metadata from the lit file.

kovidgoyal
06-23-2007, 07:19 PM
You have to convert the lit file to an lrf first with lit2lrf. As for that error message, it's pretty weird as far as I can tell it should not be happening, looks like a bug in your python installation. If it doesn't cause any ill effect though, I wouldn't worry about it.

kovidgoyal
06-29-2007, 01:18 PM
Released v0.3.62 with a bunch of bug fixes for bugs that crawled in the the previous couple of releases.

markiehill
06-30-2007, 04:56 AM
i am getting the following error on a lit file

it2lrf_wtuzhn/".
Traceback (most recent call last):
File "convert_from.py", line 104, in <module>
File "convert_from.py", line 96, in main
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 1142, in process_file
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 1220, in try_opf
File "libprs500\ebooks\BeautifulSoup.pyo", line 946, in __init__
File "libprs500\ebooks\BeautifulSoup.pyo", line 971, in _feed
File "sgmllib.pyo", line 99, in feed
File "sgmllib.pyo", line 133, in goahead
File "sgmllib.pyo", line 285, in parse_starttag
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 0: ordinal
not in range(128)

any ideas ...

kovidgoyal
06-30-2007, 05:47 AM
Send me the lit file.

JSWolf
06-30-2007, 06:35 AM
i am getting the following error on a lit file

it2lrf_wtuzhn/".
Traceback (most recent call last):
File "convert_from.py", line 104, in <module>
File "convert_from.py", line 96, in main
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 1142, in process_file
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 1220, in try_opf
File "libprs500\ebooks\BeautifulSoup.pyo", line 946, in __init__
File "libprs500\ebooks\BeautifulSoup.pyo", line 971, in _feed
File "sgmllib.pyo", line 99, in feed
File "sgmllib.pyo", line 133, in goahead
File "sgmllib.pyo", line 285, in parse_starttag
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 0: ordinal
not in range(128)

any ideas ...

Released v0.3.62 with a bunch of bug fixes for bugs that crawled in the the previous couple of releases.

Are you actually running 0.3.62? I had the same sort of error before 0.3.62 and now it seems to work.

JSWolf
06-30-2007, 06:37 AM
kovidgoyal, I do have what seems like an oddity. With 0.3.62, the last line in a paragraph seems to have more spacing between it and the line above. The other lines in the same paragraph look ok. Any idea wjat might be doing it? It does it witht he LIT file I sent you before if you still have it (as an example).

kovidgoyal
06-30-2007, 12:49 PM
Unfortunately, I don't have that lit file any more send it to me again and I'll take a look, though I can't think of anything that could be causing this behavior.

kovidgoyal
06-30-2007, 08:15 PM
@markiehill
It seems this bug is caused by an error in the python std library.
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1651995&group_id=5470

I'll fix it in the next release of libprs500 for windows and OSX. If you're on linux, you'll have to patch it manually.

markiehill
07-01-2007, 03:54 AM
i have windows so will wait for your release :)

Thanks for looking

Mark

Raventhon
07-01-2007, 06:11 AM
kovid: Transferring files via the libprs GUI to a memory card results in the metainformation being removed and the file being renamed libprs500 (or libprs500_2, or libprs500_3, and so on). Transferring files via the GUI to the reader's normal memory does not do this.

Advice?

kovidgoyal
07-01-2007, 02:34 PM
The files are renamed libprs500_id when transferred to either main memory or the storage card. What do you mean by they lose meta-information?

imanlhakim
07-19-2007, 06:04 AM
great jobs, how about automatically converting chm to lrf. I wish I can help but I can not do python.

kovidgoyal
07-19-2007, 11:36 AM
I dont have any ebooks in chm format, so I don't care about chm2lrf, but I'm sure there are other chm2html converter that can be easily combined with html2lrf.

ashkulz
07-19-2007, 03:15 PM
You can look at a quick guide to converting convert from CHM to HTML (http://en.wikipedia.org/wiki/HTML_help#Extracting_to_HTML) at Wikipedia.

dkosburn
07-20-2007, 10:49 PM
Is there a way to use libprs500 from the cli in OSX?

kovidgoyal
07-20-2007, 10:53 PM
Yes just run the command line programs just as you would in any other OS. You have to run the GUI once first.

bingle
07-21-2007, 03:50 PM
Hi, I like the concept behind libprs500... Unfortunately, I can't get it to work at all. When I add a book to the library, either with the button or by dragging and dropping, the file doesn't show up in the library. I briefly see some metadata displayed below the file list, but the file never shows up. Any ideas?

kovidgoyal
07-21-2007, 04:33 PM
Best wait a few weeks, there's a whole new GUI on the way.

bingle
07-21-2007, 10:01 PM
Best wait a few weeks, there's a whole new GUI on the way.

Excellent, I'll suffer through Connect for a while longer, then. Thanks!

JSWolf
07-29-2007, 06:29 PM
I've just emailed you a bug report that happens converting a LIT file. Might have to do with drop caps. I've attached the file in question.

Xsavior
07-29-2007, 11:24 PM
This is my first jump into using the command line, but i'm trying to expand my horizons :) I'm on Mac OS 10.4.10 and i've run the GUI. when i open up the terminal i get into the application directory where i placed the program then this happens:

[quote]
Dragon:~/applications zomalloch$ lit2lrf --help Traceback (most recent call last):
File "/Applications/libprs500.app/Contents/Resources/lit2lrf.py", line 8, in <module>
from libprs500.ebooks.lrf.lit.convert_from import main
File "/Applications/libprs500.app/Contents/Resources/libprs500.py", line 8, in <module>
from libprs500.gui.main import main
ImportError: No module named gui.main
[quote]

It's probably pure newbie error, but can anyone point me in the right direction?

kovidgoyal
07-29-2007, 11:29 PM
try doing it from a non application directory.

kovidgoyal
07-29-2007, 11:50 PM
I've just emailed you a bug report that happens converting a LIT file. Might have to do with drop caps. I've attached the file in question.

Interestingly it was a negative font size specification that was causing the problem. Will be fixed in next release.

Xsavior
07-29-2007, 11:57 PM
try doing it from a non application directory.

I tried going up a few directories, but still same error. DId you mean move the program out of the app directory?


Dragon:~/documents zomalloch$ lit2lrf --helpTraceback (most recent call last):
File "/Applications/libprs500.app/Contents/Resources/lit2lrf.py", line 8, in <module>
from libprs500.ebooks.lrf.lit.convert_from import main
File "/Applications/libprs500.app/Contents/Resources/libprs500.py", line 8, in <module>
from libprs500.gui.main import main
ImportError: No module named gui.main

kovidgoyal
07-30-2007, 12:04 AM
Hmm odd. Try deleting and redownloading. Then run the GUI and then try lit2lrf.

JSWolf
07-30-2007, 01:39 AM
Interestingly it was a negative font size specification that was causing the problem. Will be fixed in next release.
In the CSS, how would I go about fixing that until the next release is available?

kovidgoyal
07-30-2007, 01:44 AM
Remove the .small declaration

JSWolf
07-30-2007, 02:23 AM
Remove the .small declaration
Thank you very much. It worked.

JSWolf
07-31-2007, 10:20 AM
In Book Designer, there is an option to control the word spacing. And for one of the books I am reading, lowering the amount of word spacing is a good thing to have.

Can all the 2LRF converters please have an option to control the word spacing? I would love to sometimes have less of a word spacing then the default.

I don't know if this is a bug ot not, but I'm finding another drop caps issue. The drop cap is fine, but the spacing between the drop cap and the rest of the word is too much. Can the drop cap be placed next to the rest of the word please? This is using lit2lrf. I'm assuming it also affects html2lrf as well. Anyway, the lIT I sent for the previous bug (now fixed) shows this issue as well.

Thanks!

kovidgoyal
07-31-2007, 01:40 PM
Open a bug report and I'll get around to it.

JSWolf
07-31-2007, 04:45 PM
Two reports filed.

JSWolf
08-02-2007, 10:36 PM
In that same LIT file, where there are supposed to be graphics as part of the chapter heading, it just says image.

Also, how long till a new version that fixes that ToC bug is relased not that it is in SVN?

kovidgoyal
08-02-2007, 10:41 PM
That's cause the images are missing from the lit file. I have a few piled up fixes I need to do before releasing the next version.

EDIT: Actually it's because the img tag is inside an <a> tag which html2lrf doesn't support for technical reasons

JSWolf
08-03-2007, 12:37 AM
That's cause the images are missing from the lit file. I have a few piled up fixes I need to do before releasing the next version.

EDIT: Actually it's because the img tag is inside an <a> tag which html2lrf doesn't support for technical reasons
Can't you ignore the <a> tag and just deal with the img tag?

kovidgoyal
08-03-2007, 12:42 AM
No because there are other situations where that would be the wrong thing to do. Unfortunately LRS doesn't support images in links, so this is the best compromise.

JSWolf
08-03-2007, 12:44 AM
So the answer is to just ignore the image?

kovidgoyal
08-03-2007, 12:50 AM
No it's to use the text in the alt field.

JSWolf
08-03-2007, 03:06 AM
Is there any reason you cannot use the graphic without trying to make it a link?

kovidgoyal
08-03-2007, 01:13 PM
It would be odd to have both the graphic and its text next to each other.

Liviu_5
08-03-2007, 07:36 PM
After I got my Reader with the cc offer, I started testing how to put books on it, and I found that I like best the lrf format so I converted about 60 reflowable books.

For reflowable books, I used lit2lrf for anything I had in lit form (maybe about 40 of the 60 books) and it worked unbelievably fast with excellent output.

Great, great program.

pcinfoman
08-13-2007, 12:27 PM
I just downloaded libprs500 (Windows version) from the Microsoft site and installed it. I run the program and nothing happens. It shows up in memory but I see nothing on my screen. No GUI, no messages, no errors, NOTHING.

Ideas?

JSWolf
08-13-2007, 12:39 PM
I just downloaded libprs500 (Windows version) from the Microsoft site and installed it. I run the program and nothing happens. It shows up in memory but I see nothing on my screen. No GUI, no messages, no errors, NOTHING.

Ideas?
You downloaded this from Microsoft?

The software for doing book conversions are all command line based. You'll need to open a command line to use them.

pcinfoman
08-13-2007, 04:05 PM
You downloaded this from Microsoft?

The software for doing book conversions are all command line based. You'll need to open a command line to use them.
My mistake. I downloaded it from https://libprs500.kovidgoyal.net/ (the link provided in the first post of this thread). There is nothing on that page that I saw for a command line requirement. There was a command line version and a Windows version. I chose the latter. There are even features listed and screen shots.

pcinfoman
08-13-2007, 08:27 PM
I am mistaken, I did not download it from Microsoft, I download the windows version from the link that was provided in the first post of this thread.

There was a command line link as well as a GUI windows version. They even had screen shots and a feature list. That is what I am having problems with. It does not work.

JSWolf
08-13-2007, 10:46 PM
I am mistaken, I did not download it from Microsoft, I download the windows version from the link that was provided in the first post of this thread.

There was a command line link as well as a GUI windows version. They even had screen shots and a feature list. That is what I am having problems with. It does not work.
The GUI is not for content conversion at the moment.

You need to use the command line.

Read back on all the threads dealing with the conversion utilities. They are all stickies. All the info is in them someplace.

Excalibur
08-14-2007, 10:05 PM
Going to add this to the bug tracker, but converted a multi-file LIT (that decompiles into several html files) to LRF that had a cover. Now, the LRF shows the cover between every chapter, or between every html file that made up the original LIT. So instead of this:
Cover
html 1
html 2
html ...
html n

it does this:

Cover
html 1
Cover
html 2
Cover
html ...
Cover
html n

Just thought I'd mention it here in case there was something I was missing. I'll add it to the bug tracker if you want me to. It could be that this is an issue with html2lrf instead of lit2lrf...

kovidgoyal
08-14-2007, 10:07 PM
yeah its a regression already fixed in svn.

Excalibur
08-14-2007, 10:18 PM
Cool, looking forward to the new version :) (Perhaps I should check your bug tracker or search before posting... man, still making newb mistakes like that ;)

kovidgoyal
08-14-2007, 10:25 PM
Not a problem. You're probably going to have to wait a while as I'm in the middle of a major refactor and svn is a mess.

JSWolf
08-14-2007, 10:27 PM
Going to add this to the bug tracker, but converted a multi-file LIT (that decompiles into several html files) to LRF that had a cover. Now, the LRF shows the cover between every chapter, or between every html file that made up the original LIT. So instead of this:
Cover
html 1
html 2
html ...
html n

it does this:

Cover
html 1
Cover
html 2
Cover
html ...
Cover
html n

Just thought I'd mention it here in case there was something I was missing. I'll add it to the bug tracker if you want me to. It could be that this is an issue with html2lrf instead of lit2lrf...
In the meanwhile you could try loading this LIT into Book Designer and formating it from there. That is until the next version of libprs500 is released.

Excalibur
08-15-2007, 02:33 PM
Yeah, but that's yet *another* piece of software to install. I'll just wait till the next version of libprs500 :)

JSWolf
08-15-2007, 02:35 PM
Yeah, but that's yet *another* piece of software to install. I'll just wait till the next version of libprs500 :)
Of you could convert the LIT to HTML and then edit out the cover images from the successive HTML files. Then use html2lrf to convert it.

kovidgoyal
08-15-2007, 02:37 PM
that wont work the bug is in html2lrf

JSWolf
08-15-2007, 04:08 PM
that wont work the bug is in html2lrf
Oh well. That idea's no good then. Just have to get you to release the fixed version then.

ahintz
08-16-2007, 07:21 PM
First of all - great utility! Thanks so much! It made it really easy to convert my Baen .lit files so I can read them on my Sony Reader.

Two questions: when I add a header to the file, I don't seem to be able to change the top margin at all. Ideally I'd like more space between the header and the start of the body text. Am I missing something in the command-line parameters or is this not possible in the current version? Second, out of almost 200 .lit files from Baen, only one of them refuses to convert. I can live without it, but would it be helpful for you to have a copy of that file?

Again - thanks so much for making this utility. It really has allow me to get up to speed very quickly with my new Reader.

kovidgoyal
08-16-2007, 07:24 PM
Try --margin-top. Not sure if it's overriden by --header, try it and see.

Yeah send me the lit file.

ZeBuddha
08-16-2007, 08:09 PM
OK, probably a really stupid question, but just want to make sure.

It's not possible to convert from within the GUI (libprs500.exe)?

So I have to use the command prompt (with the various separate converters individually) to convert files to lrf?

- Again, sorry for the (probably dumb) question. I just ordered my PRS500 from the US (can't get it in shops here in europe) and need to convert hundreds & hundreds of ebooks in various formats all mixed together (I'm not very organized).

EDIT: As stated, very stupid question. Already found the answer on your website. Thanks for a great piece of software btw! (oh, and this means just ignore the rest of the post)

kovidgoyal
08-16-2007, 08:18 PM
no the gui doesn't have an interface to the converters. Though that should change in the next few weeks ;-)

joblack
08-16-2007, 08:49 PM
The driver doesnīt work for Windows 64 Bit. Should be no problem to compile it for 64 Bit Windows (it is open source, isnīt it). Will check that out ...

kovidgoyal
08-16-2007, 09:32 PM
Yeah i dont have a 64-bit machine or it would be no problem.

Nate the great
08-16-2007, 10:03 PM
OK, probably a really stupid question, but just want to make sure.

It's not possible to convert from within the GUI (libprs500.exe)?

So I have to use the command prompt (with the various separate converters individually) to convert files to lrf?

- Again, sorry for the (probably dumb) question. I just ordered my PRS500 from the US (can't get it in shops here in europe) and need to convert hundreds & hundreds of ebooks in various formats all mixed together (I'm not very organized).

EDIT: As stated, very stupid question. Already found the answer on your website. Thanks for a great piece of software btw! (oh, and this means just ignore the rest of the post)

You don't have to do it in command line. I have found in WinXP that drag and drop works, with the output placed in:

C:\Documents and Settings\your_user_name_here

ZeBuddha
08-16-2007, 10:19 PM
At the risk of asking a stupid question again, is there any way to batch-convert files? I've tried using wildcards (eg. lit2lrf X:\SomeDir\*.lit or lit2lrf *.lit) but it doesn't work.

-----------------

Actually, I'm not even able to convert a single file in the same directory as libprs500 (renamed the .lit in the example below to remove spaces, etc.):

C:\Program Files\libprs500>lit2lrf Blah.lit
+---[ ConvertLIT (Version 1.8) ]---------------[ Copyright (c) 2002,2003 ]---
ConvertLIT comes with ABSOLUTELY NO WARRANTY; for details
see the COPYING file or visit "http://www.gnu.org/license/gpl.html".
This is free software, and you are welcome to redistribute it under
certain conditions. See the GPL license for details.
LIT INFORMATION.........
DRM = 1
Timestamp = 2d04461c
Creator = 00000026
Language = 00000809
Writing out "Something_or_other" as "Something or other.htm" ...

Traceback (most recent call last):
File "convert_from.py", line 83, in <module>
File "convert_from.py", line 54, in main
File "convert_from.py", line 42, in generate_html
libprs500.ebooks.ConversionError:
WARNING: Read went past the end of file by 121057 bytes.
If the conversion process doesn't work, try to redownload the file.
Error reading file "C:\Program Files\libprs500\Blah.lit" --
LZXdecompress failed, status = 3.


EDIT: Tested w/ PDF file, following result after trying to convert:

C:\Program Files\libprs500>pdf2lrf blah2.pdf
Processing libprs500_0.3.95_zgqjkc.html
Parsing HTML...
Converting to BBeB...
Traceback (most recent call last):
File "convert_from.py", line 82, in <module>
File "convert_from.py", line 78, in main
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 1365, in process_file
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 414, in __init__
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 511, in parse_file
libprs500.ebooks.ConversionError: libprs500_0.3.95_zgqjkc.html does not seem to
have any content

kovidgoyal
08-16-2007, 10:25 PM
You have to write a script to do batch conversions. As for that failing lit file, it's convertlit that's failing. You should contact that programs author. Most probably that lit file is either DRM'ed or corrupt.

ZeBuddha
08-16-2007, 10:33 PM
That's strange. I have a separate instance of convertlit 1.8, and it can convert the .lit file from the test above with no problems whatsoever to HTML.

kovidgoyal
08-16-2007, 10:39 PM
lit2lrf is on your PATH you dont need to run it from the libprs500 directory. Try it from elsewhere.

Excalibur
08-17-2007, 02:59 AM
At the risk of asking a stupid question again, is there any way to batch-convert files? I've tried using wildcards (eg. lit2lrf X:\SomeDir\*.lit or lit2lrf *.lit) but it doesn't work.

Put this line in a batch file named, say batch.bat:
for %%f in (*.lit) do lit2lrf --blank-after-para "%%f"

Then, run it in a directory where you want the contents converted. It is not recursive and will only work in one directory. I didn't need it to go to any directories below the main one, but if you want to figure out how to do that, go right ahead :)

Also, if you're finding that the stuff in your libprs500 directory isn't in your path when you open cmd, make sure you're not using Microsoft's "Command Line Here" power toy. I've noticed that for some reason, it doesn't use the path. Just go to start>run>cmd then hit enter. You'll have to navigate to the directory you want to convert lit files in, but if you make it a sub folder off your C:\ drive, there shouldn't be any problems.

Radnor
08-17-2007, 03:02 AM
I'm getting a strange error any time I upload a book to my prs500:

Unable to send book.lrf to device
Traceback (most recent call last):
File "main.py", line 348, in upload_books
File "libprs500\devices\prs500\driver.pyo", line 168, in run_session
File "libprs500\devices\prs500\driver.pyo", line 929, in add_book
File "libprs500\devices\prs500\books.pyo", line 282, in add_book
KeyError: 'tags'

The book shows up fine, but I'm afraid there might be some issue that pops up later. Can I safely ignore this message?

I've uninstalled the Connect drivers & rebooted before installing libprs500, and the reader is on the latest firmware from initially hooking it up to the Connect software.

kovidgoyal
08-17-2007, 03:13 AM
Yeah that's a side effect of some changes i made in the driver for the new beta gui. You can ignore it. It will be fixed in the next release.

Excalibur
08-17-2007, 09:46 AM
Just attempted to convert another LIT file to LRF and get this error:

X:\eBooks\>lit2lrf --blank-after-para book.Lit
Traceback (most recent call last):
File "convert_from.py", line 94, in <module>
File "convert_from.py", line 89, in main
File "convert_from.py", line 48, in process_file
AttributeError: 'str' object has no attribute 'verbose'

I'll add this to the bugtracker.

kovidgoyal
08-17-2007, 10:22 AM
typo use any2lrf in the meantime.

Excalibur
08-17-2007, 11:26 AM
any2lrf locks up on me. I put in the command

any2lrf book.lit

and it just sits there. I left it alone at one point and 20 minutes later still hadn't produced any output.

kovidgoyal
08-17-2007, 11:35 AM
Huh odd. Works for me. Run it with the --verbose switch.

Excalibur
08-17-2007, 11:49 AM
I ran it with the verbose switch and it still locks up.

If it helps any, I've got Windows XP SP2 and I'm using the latest version you had posted, 0.3.39 I think? Don't think anything else would cause issues...

JSWolf
08-17-2007, 12:40 PM
I ran it with the verbose switch and it still locks up.

If it helps any, I've got Windows XP SP2 and I'm using the latest version you had posted, 0.3.39 I think? Don't think anything else would cause issues...
Latest version is 0.3.97. Any2lrf seems to blow up.

Processing contents.html
Parsing HTML...
Converting to BBeB...
Processing WorldsofStarTrekDeepSpace.html
Parsing HTML...
Converting to BBeB...
Traceback (most recent call last):
File "convert_from.py", line 136, in <module>
File "convert_from.py", line 129, in main
File "convert_from.py", line 107, in process_file
File "libprs500\ebooks\lrf\lit\convert_from.pyo", line 76, in process_file
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 1421, in process_file
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 1329, in writeto
File "libprs500\ebooks\lrf\pylrs\pylrs.pyo", line 587, in renderLrf
File "libprs500\ebooks\lrf\pylrs\pylrs.pyo", line 224, in toLrf
File "libprs500\ebooks\lrf\pylrs\pylrs.pyo", line 220, in toLrfDelegates
File "libprs500\ebooks\lrf\pylrs\pylrs.pyo", line 2003, in toLrf
File "libprs500\ebooks\lrf\pylrs\pylrs.pyo", line 2024, in toLrf
AttributeError: 'NoneType' object has no attribute 'objId'

JSWolf
08-17-2007, 12:44 PM
lit2lrf is not working as well...

Traceback (most recent call last):
File "convert_from.py", line 94, in <module>
File "convert_from.py", line 89, in main
File "convert_from.py", line 48, in process_file
AttributeError: 'str' object has no attribute 'verbose'

It does work in 0.3.95. I don't have 0.3.96 to try.

kovidgoyal
08-17-2007, 12:59 PM
yeah i know it's a typo. Will be fixed in next release. Windows command-line processing leaves a lot to be desired.

JSWolf
08-17-2007, 01:04 PM
So unless I need hanging indents, I should be ok with 0.3.95 for now right?

kovidgoyal
08-17-2007, 01:53 PM
yeah.

ZeBuddha
08-17-2007, 11:12 PM
Put this line in a batch file named, say batch.bat:
for %%f in (*.lit) do lit2lrf --blank-after-para "%%f"

Then, run it in a directory where you want the contents converted. It is not recursive and will only work in one directory. I didn't need it to go to any directories below the main one, but if you want to figure out how to do that, go right ahead :)

Would for %%f in (*.*) do any2lrf --blank-after-para "%%f" work too? Or would it go into an infinite loop in an attempt to convert lrfs to lrfs?

Also, I haven't handled .bats since the days of MS-Dos, so I don't remember if I had to include any kind of separator (eg. semi-colon) between commands. Would a NL/CR do?

I'm basically looking to make a "convert all to LRF" batch script for my incredibly jumbled ebook folders to use with libprs500. So something along the lines of the script line above, one each for lit2lrf, pdf2lrf, rtf2lrf, html2lrf & txt2lrf.

Also, as .doc and .chm formats are not included in libprs500 I'm also looking into apps to convert those to HTML and from there to LRF (which should work as long as the conversion to HTML is before the html2lrf conversion in the script).

I remember seeing a chm2html converter mentioned somewhere but can't find it anymore, and I haven't run into any doc2html or docx2html converters.

irishjew
08-17-2007, 11:35 PM
Anyone else get an Error 3 when trying to run the new version of lit2lrf? E.g.,

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Akar>"C:\Program Files\libprs500\lit2lrf.exe" "C:\Docu
ments and Settings\Akar\Desktop\New Folder\Dc99.lit"

Traceback (most recent call last):
File "convert_from.py", line 98, in <module>
File "convert_from.py", line 93, in main
File "convert_from.py", line 56, in process_file
File "convert_from.py", line 45, in generate_html
File "shutil.pyo", line 161, in rmtree
File "shutil.pyo", line 159, in rmtree
WindowsError: [Error 3] The system cannot find the path specified: 'c:\\docume~1
\\akar\\locals~1\\temp\\libprs500_lwpbcn/*.*'

JSWolf
08-17-2007, 11:39 PM
Convertlit 0.3.98 is the version that blew up.

+---[ ConvertLIT (Version 1.8) ]---------------[ Copyright (c) 2002,2003 ]---
ConvertLIT comes with ABSOLUTELY NO WARRANTY; for details
see the COPYING file or visit "http://www.gnu.org/license/gpl.html".
This is free software, and you are welcome to redistribute it under
certain conditions. See the GPL license for details.


Traceback (most recent call last):
File "convert_from.py", line 98, in <module>
File "convert_from.py", line 93, in main
File "convert_from.py", line 56, in process_file
File "convert_from.py", line 45, in generate_html
File "shutil.pyo", line 161, in rmtree
File "shutil.pyo", line 159, in rmtree
WindowsError: [Error 3] The system cannot find the path specified: 'c:\\docume~1
\\jon\\locals~1\\temp\\libprs500_348hqk/*.*'

kovidgoyal
08-18-2007, 12:00 AM
this is on XP? Because it works for me on vista.

JSWolf
08-18-2007, 12:01 AM
this is on XP?
I'm running Windows XP Pro. It blew up pretty good I'd say.

kovidgoyal
08-18-2007, 12:06 AM
Sigh now i'm going to have to code workarounds for individual windows versions! And that lit file worked with earlier versions of lit2lrf?

JSWolf
08-18-2007, 12:11 AM
Sigh now i'm going to have to code workarounds for individual windows versions! And that lit file worked with earlier versions of lit2lrf?
Yes it did work fine. In fact, Its the book I am in the midst of readin on my reader now. It's fine on the reader. I used Times New Roman and wanted redo it so it used the internal font for faster page turns.

JSWolf
08-18-2007, 12:17 AM
Ok, I made a slight mistake. The LIT file I was working from was corrupted. So the error I posted was invalid. BUT, working from a proper working version, now I get ...
Traceback (most recent call last):
File "convert_from.py", line 98, in <module>
File "convert_from.py", line 93, in main
File "convert_from.py", line 80, in process_file
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 1466, in process_file
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 1374, in writeto
File "libprs500\ebooks\lrf\pylrs\pylrs.pyo", line 541, in renderLrf
File "libprs500\ebooks\lrf\pylrs\pylrs.pyo", line 224, in toLrf
File "libprs500\ebooks\lrf\pylrs\pylrs.pyo", line 220, in toLrfDelegates
File "libprs500\ebooks\lrf\pylrs\pylrs.pyo", line 1957, in toLrf
File "libprs500\ebooks\lrf\pylrs\pylrs.pyo", line 1978, in toLrf
AttributeError: 'NoneType' object has no attribute 'objId'

kovidgoyal
08-18-2007, 12:17 AM
works for me on XP as well. The error message above is caused by clit failing. A bug in 0.3.98 unfortunately prevents you from seeing the error message. Run it with --verbose that will atleast show you the commandline being passed to clit.

JSWolf
08-18-2007, 12:19 AM
works for me on XP as well. The error message above is caused by clit failing. A bug in 0.3.98 unfortunately prevents you from seeing the error message. Run it with --verbose that will atleast show you the command line being passed to clit.
if I convert to HTML using CLIT, I get the same error message.

kovidgoyal
08-18-2007, 12:25 AM
cool a bug in html2lrf (its guts have been extensively rewritten in the past couple of days). Please send me the lit file.

JSWolf
08-18-2007, 12:30 AM
cool a bug in html2lrf (its guts have been extensively rewritten in the past couple of days). Please send me the lit file.
I've just opened ticket #161 and attached the LIT file in question. And this LIT file once did convert without a problem except the indent being too narrow.

Excalibur
08-18-2007, 01:02 AM
Would for %%f in (*.*) do any2lrf --blank-after-para "%%f" work too? Or would it go into an infinite loop in an attempt to convert lrfs to lrfs?

Also, I haven't handled .bats since the days of MS-Dos, so I don't remember if I had to include any kind of separator (eg. semi-colon) between commands. Would a NL/CR do?

I'm basically looking to make a "convert all to LRF" batch script for my incredibly jumbled ebook folders to use with libprs500. So something along the lines of the script line above, one each for lit2lrf, pdf2lrf, rtf2lrf, html2lrf & txt2lrf.

Also, as .doc and .chm formats are not included in libprs500 I'm also looking into apps to convert those to HTML and from there to LRF (which should work as long as the conversion to HTML is before the html2lrf conversion in the script).

I remember seeing a chm2html converter mentioned somewhere but can't find it anymore, and I haven't run into any doc2html or docx2html converters.
I don't think that there would be a problem, did you try the command with (*.*)? I believe that what would happen would be the (*.*) command would take a snapshot of the directory and then run with it from there the first time it was run, sort of like taking a dir.

To be on the safe side, you could always just mimic the command with (*.doc) then another line with (*.rtf) then (*.txt) etc. But I think *.* should work OK.

Yeah, you can separate commands with a CRLF, (or a return) without a problem. The semicolon is in the PATH and other environment variables as far as I am aware.

You can convert your chm to html with hh.exe. hh.exe -decompile <out> <in> at least that's what I've seen online...

Gamgee72
08-24-2007, 09:44 AM
I've been surfing this site for a couple of weeks now and am appreciative of all the work Sony eBook Reader fans have come up with although I do not pretend to know anything about coding/programming.

I have installed libprs500 but have yet to get the lit2lrf module to work for me. The lit2lrf module seems to launch okay but it never completes the conversion. Below is a sample error that I got. Any idea what I'm doing wrong?

Traceback <most recent call last>:
File "convert_from.py", line 83, in <module>
File "convert_from.py", line 77, in main
File "libprs500\ebooks\lrf\htm\convert_from.pyo", line 1307, in process_file
File "libprs500\devices\prs500\driver.pyo", line 56, in <module>
File "libprs500\devices\libusb.pyo", line 32, in <module>
File "libprs500\__init__.pyo", line 53, in load_library
File "ctypes\__init__.pyo", line 423, in LoadLibrary
File "ctypes\__init__.pyo", line 340, in __init__
WindowsError: [Error 126] The specified <module> could not be found

kovidgoyal
08-24-2007, 12:05 PM
This has been fixed in the latest version. 0.3.104

Gamgee72
08-25-2007, 12:51 AM
Thanks! Works like a charm now.

adfleisher
09-05-2007, 01:23 AM
for some reason it isn't letting me download the Mac version. I get an error when I try and save the link target as a file on the hdd and get giberish ascii when I just click on the link...

Xenophon
09-05-2007, 12:37 PM
for some reason it isn't letting me download the Mac version. I get an error when I try and save the link target as a file on the hdd and get giberish ascii when I just click on the link...
Working fine for me now. Give it another try.

Xenophon

wyldkit
09-05-2007, 08:33 PM
for some reason it isn't letting me download the Mac version. I get an error when I try and save the link target as a file on the hdd and get giberish ascii when I just click on the link...

I had to right-click on the OS X dmg link and "save link as" to download the Mac version. Of course, if your mouse doesn't have a right button, or if you haven't set up one of the newer Mac mices to do right-click functions, that won't help. I'm sure there's a keyboard shortcut for that, but I don't know it.

EDIT: I think I was reading your post wrong. In any case, it's working for me now as well.

cottonball
10-10-2007, 03:42 PM
Hi - Tried converting a .lit file using libprs500 v0.4.8. While the original .lit file included indentation for the first line of each paragraph, the converted version (.lrf) did not. Is there something I'm doing wrong? I did search this and other threads, as well as the libprs500 website, but to no avail. BTW, the ebook in question is "Autumn" by David Moody - free download on http://www.theinfected.co.uk/FreeBook.htm (again, I used the .lit version). Thanks!

JSWolf
10-10-2007, 08:34 PM
Hi - Tried converting a .lit file using libprs500 v0.4.8. While the original .lit file included indentation for the first line of each paragraph, the converted version (.lrf) did not. Is there something I'm doing wrong? I did search this and other threads, as well as the libprs500 website, but to no avail. BTW, the ebook in question is "Autumn" by David Moody - free download on http://www.theinfected.co.uk/FreeBook.htm (again, I used the .lit version). Thanks!
It's no the fault of lit2lrf/html2lrf. It's the fault of a really poor LIT file. It uses      as the indent. It does not use a style for the indent. Plus there is no ToC. Best off to use the DOC with Book Designer.

JSWolf
10-10-2007, 10:13 PM
Hi - Tried converting a .lit file using libprs500 v0.4.8. While the original .lit file included indentation for the first line of each paragraph, the converted version (.lrf) did not. Is there something I'm doing wrong? I did search this and other threads, as well as the libprs500 website, but to no avail. BTW, the ebook in question is "Autumn" by David Moody - free download on http://www.theinfected.co.uk/FreeBook.htm (again, I used the .lit version). Thanks!
I used the DOC version to clean up the god awful quotes and then formatted it with Book Designer because the lit is total crap.

http://www.mobileread.com/forums/showthread.php?t=14721

cottonball
10-10-2007, 11:00 PM
It's no the fault of lit2lrf/html2lrf. It's the fault of a really poor LIT file. It uses as the indent. It does not use a style for the indent. Plus there is no ToC. Best off to use the DOC with Book Designer.

Thanks for the tip! While I've had a Sony Reader for some time now, this is my first venture into ebook conversion. Your help is most appreciated (as is the contributions of all in this forum). And while in the end I used BD, kudos to kovidgoyal for libprs500 - which I'm sure will come in handy too.

kovidgoyal
10-11-2007, 02:23 AM
Since missing paragrpah indents are a common problem with lit files there will be a workaround in the next version of lit2lrf.

JSWolf
10-11-2007, 10:41 AM
Since missing paragrpah indents are a common problem with lit files there will be a workaround in the next version of lit2lrf.
But I don't see any way around the missing ToC and the use of apostrophes as quotes instead of quotes as quotes.

kovidgoyal
10-11-2007, 01:25 PM
If the lit file has an opf with a spine element, the TOC will be generated by the --use-spine option (once I implement it). As for apostrophes, is that really such a big deal?

kovidgoyal
10-11-2007, 02:22 PM
Actually I tried converting that lit file and the indents are fine. See attached LRF.

JSWolf
10-11-2007, 02:35 PM
I have 0.4.8. I'm trying again. maybe it didn't work with 0.4.7?

JSWolf
10-11-2007, 02:42 PM
What options did you use? For me it did not work as seen here by the attachment.

All I did was "lit2lrf Autumn.lit"

kovidgoyal
10-11-2007, 03:05 PM
Strange I didn't use any options either. Maybe it's a windows specific thing. Or maybe there's some change since 0.4.8 that fixed it. I'll try it in windows and see.

JSWolf
10-11-2007, 03:08 PM
Strange I didn't use any options either. Maybe it's a windows specific thing. Or maybe there's some change since 0.4.8 that fixed it. I'll try it in windows and see.
I'd be interested how you managed it when we could not.

kovidgoyal
10-11-2007, 03:23 PM
It worked for me in windows as well. Can you check it after I release 0.4.9 and let me know. Thanks.

JSWolf
10-11-2007, 03:32 PM
It worked for me in windows as well. Can you check it after I release 0.4.9 and let me know. Thanks.
Sure can. Thanks! I hope it works here.

kovidgoyal
10-13-2007, 02:37 PM
version 0.4.9 is on its way to the servers. It should automatically use the spine data from lit files.

cottonball
10-13-2007, 03:15 PM
Sure can. Thanks! I hope it works here.

I'll try as well...

JSWolf
10-13-2007, 05:04 PM
0.4.9 didn't work BIG TIME!

[e:\e-books\working]lit2lrf Autumn.lit
+---[ ConvertLIT (Version 1.8) ]---------------[ Copyright (c) 2002,2003 ---
ConvertLIT comes with ABSOLUTELY NO WARRANTY; for details see the COPYING file or visit "http://www.gnu.org/license/gpl.html". This is free software, and you are welcome to redistribute it under certain conditions. See the GPL license for details.
LIT INFORMATION.........
DRM = 1
Timestamp = 77c448d0
Creator = 00140000
Language = 00000809
Writing out "Autumn" as "Autumn.htm" ... Successfully written to "c:\docume~1\jon\locals~1\temp\libprs500_gvcba8\Aut umn.htm".

Writing out "RW_~Cover01" as "~Cover01.jpg" ... Successfully written to "c:\docume~1\jon\locals~1\temp\libprs500_gvcba8\~Co ver01.jpg".

Writing out "RW_~Cover02" as "~Cover02.jpg" ... Successfully written to "c:\docume~1\jon\locals~1\temp\libprs500_gvcba8\~Co ver02.jpg".

Writing out "RW_~Cover03" as "~Cover03.jpg" ... Successfully written to "c:\docume~1\jon\locals~1\temp\libprs500_gvcba8\~Co ver03.jpg".

Writing out "RW_~Cover04" as "~Cover04.jpg" ... Successfully written to c:\docume~1\jon\locals~1\temp\libprs500_gvcba8\~Co ver04.jpg".

Writing out "RW_~Cover05" as "~Cover05.jpg" ... Successfully written to "c:\docume~1\jon\locals~1\temp\libprs500_gvcba8\~Co ver05.jpg".

Exploded "E:\E-Books\Working\Autumn.lit" into "c:\docume~1\jon\locals~1\temp\libprs500_gvcba8\".

Traceback (most recent call last):
File "convert_from.py", line 101, in <module>
File "convert_from.py", line 96, in main
File "convert_from.py", line 85, in process_file
File "shutil.pyo", line 174, in rmtree
File "shutil.pyo", line 172, in rmtree
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: c:\\docume~1\\jon\\locals~1\\temp\\libprs500_gvcba 8\\Autumn.opf'

kovidgoyal
10-13-2007, 05:28 PM
oops i forgot about lit files that dont have a TOC. Will be fixed by the end of the day.

kovidgoyal
10-13-2007, 07:45 PM
try 0.4.10

JSWolf
10-13-2007, 07:49 PM
Thanks! I'll give 0.4.91 (or whatever the version is) a try tonight then.

JSWolf
10-13-2007, 09:26 PM
It worked with Autumn.lit as far as the indents go. But, the cover looks awful. It's left justified instead of nicely centered.

kovidgoyal
10-14-2007, 01:41 AM
OK will fix that in the next release.

cottonball
10-15-2007, 05:20 PM
OK will fix that in the next release.

I may have jumped the gun a bit, but I noticed you'd posted 0.4.11 and gave it a whirl. While I've only briefly browsed the Autumn.lrf I created with it, so far it looks great - in fact much better than the version I worked so hard to create with BD :) The image wasn't perfectly centered, but it was only off by a bit (in fact, it looks like it was enlarged to just about fit the page). Nice job!!!

kovidgoyal
10-15-2007, 05:27 PM
Glad to hear it. Yes the cover image is enlarged to fit the page.

JSWolf
10-15-2007, 06:05 PM
Glad to hear it. Yes the cover image is enlarged to fit the page.
Can the cover image be enlarged to fit the page/centered within the aspect ratio so it's not looking like a 4:3 picture made to fit 16:9?

kovidgoyal
10-16-2007, 01:47 AM
Sure in the next version.

bkilian
10-16-2007, 06:38 PM
Heya Kovid,

I just converted some of my baen .lit files, and so far, all of them have generated the TOC without including it in the actual text (thanks!) but, unfortunately, the TOC doesn't work. No matter which TOC entry I select, they all just jump to the cover page.

The args I used were:
--disable-autorotation --header --left-margin=30 --right-margin=30 --baen --force-page-break-before-tag=h1 --use-spine

kovidgoyal
10-16-2007, 06:43 PM
Hmm post a link to one of these lit files if they're free or send me one otherwise.

bkilian
10-16-2007, 07:26 PM
Hmm post a link to one of these lit files if they're free or send me one otherwise.
http://www.webscription.net/p-297-oath-of-swords.aspx should do. http://www.webscription.net/SendFile.aspx?SKU=0671876422&ProductID=297&format=M is the link to the file itself, but it might ot work if they have referrer filters in place. The first link will work.

JSWolf
10-17-2007, 12:04 AM
Did you try without the --use-spine?

JSWolf
10-17-2007, 12:12 AM
Same result here with 0.4.11. And I used no options. The problem is that the file 0671876422_top.htm never got parsed. It's the ToC file. I used CLIT to convert to HTML and it won't convert to BBeB. I started with 0671876422_top.htm and it's parsed 0671876422__p_.htm four times before I stopped it.

kovidgoyal
10-17-2007, 12:51 PM
Fixed in 0.4.12 which will be available later today

bkilian
10-17-2007, 02:19 PM
Same result here with 0.4.11. And I used no options. The problem is that the file 0671876422_top.htm never got parsed. It's the ToC file. I used CLIT to convert to HTML and it won't convert to BBeB. I started with 0671876422_top.htm and it's parsed 0671876422__p_.htm four times before I stopped it.You shouldn't have to parse the TOC file, as far as I know. The TOC entries in the OPF should give you all the information you need (when the "tour" in the OPF exists, that is)
notepad
<tours>
<tour id="chaptertour" title="Chapter Tour">
<site title="Chapter One" href="0671876422__p_.htm#Chap_1" />
<site title="Chapter Two" href="0671876422__p_.htm#Chap_2" />
<site title="Chapter Three" href="0671876422__p_.htm#Chap_3" />
<site title="Chapter Four" href="0671876422__p_.htm#Chap_4" />

kovidgoyal
10-17-2007, 02:25 PM
The problem is that the structure of the tour element is not well defined. i.e. not all lit files use them for a TOC. It's much safer to parse the toc file.

bkilian
10-17-2007, 02:35 PM
The problem is that the structure of the tour element is not well defined. i.e. not all lit files use them for a TOC. It's much safer to parse the toc file.Makes sense, whatever works :)

Gamgee72
10-20-2007, 03:32 AM
I've used this feature before and did not have any problems. I just upgraded to v0.4.12 and when I tried to convert a pdf, I got the following error message:

Traceback <most recent call last>:
File "convert_from.py", line 91, in <module>
File "convert_from.py", line 87, in main
File "convert_from.py", line 67, in process_file
File "convert_from.py", line 50, in general_html
librprs500.ebooks.Conversion.Error: 'pdftohtml' is not recognized as a internal or external command, operable program or batch file.

Any reason/explanation for this error?

Thanks.

kovidgoyal
10-20-2007, 01:29 PM
Try re-installing

JSWolf
10-20-2007, 02:35 PM
Would it help to first uninstall?

kovidgoyal
10-20-2007, 02:41 PM
No it wont

Gamgee72
10-20-2007, 04:13 PM
Hi,

Tried installing. I see the application doing some work and it creates a BBeB file and indicates "Output written to C:\..." but I actually don't see the .lrf file that it created anywhere in the folder. Am I missing something?

Thanks.

kovidgoyal
10-20-2007, 04:34 PM
Use the GUI, that way you dont have to worry about where the file is saved.

JSWolf
10-21-2007, 12:10 AM
Seems if the header is long enough, it gets pushed too far to the right so that the last letter is cut off. I hope this is an easy fix.

kovidgoyal
10-21-2007, 01:01 AM
Actually its not its a bug in SONY's LRF renderer. Try it with my LRF viewer and see.

JSWolf
10-21-2007, 01:05 AM
Actually its not its a bug in SONY's LRF renderer. Try it with my LRF viewer and see.
Well, can you push the text slightly over then to bypass the bug? LIke add in an extar space or two at the end or whatever it takes.

kovidgoyal
10-21-2007, 01:15 AM
There are already two spaces at the end. I could write a routine to add a variable number of spaces depending on the header length, open a ticket and i'll do it sometime.

AnemicOak
11-04-2007, 02:21 PM
Using 0.4.17 and getting this error on a .lit I just picked up...

AttributeError: Values instance has no attribute 'spine'
Failed to perform job: Convert book:DejaDead[1]
Detailed traceback:
Traceback (most recent call last):
File "libprs500\gui2\jobs.pyo", line 97, in run
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 140, in main
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 117, in process_file
File "libprs500\ebooks\lrf\lit\convert_from.pyo", line 93, in process_file
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 1678, in process_file
AttributeError: Values instance has no attribute 'spine'
Log:
[DEBUG] convert_from.pyo:41: clit "c:\users\brian\appdata\local\temp\libprs500_0.4.17 _glehl4.lit" "c:\users\brian\appdata\local\temp\libprs500_jyckwc \\"
[INFO] convert_from.pyo:43: +---[ ConvertLIT (Version 1.8) ]---------------[ Copyright (c) 2002,2003 ]---
ConvertLIT comes with ABSOLUTELY NO WARRANTY; for details
see the COPYING file or visit "http://www.gnu.org/license/gpl.html".
This is free software, and you are welcome to redistribute it under
certain conditions. See the GPL license for details.
LIT INFORMATION.........
DRM = 5
Timestamp = b49b68f7
Creator = 00000019
Language = 00000409
Writing out "2000221bfrontv06" as "2000221bfrontv06.html" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \2000221bfrontv06.html".

Writing out "2000221bcopyrightv06" as "2000221bcopyrightv06.html" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \2000221bcopyrightv06.html".

Writing out "2000221btocv06" as "2000221btocv06.html" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \2000221btocv06.html".

Writing out "2000221bv06" as "2000221bv06.html" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \2000221bv06.html".

Writing out "2000221bv07" as "2000221bv06.css" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \2000221bv06.css".

Writing out "2000221bcoverv06e" as "2000221bcoverv06e.jpg" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \2000221bcoverv06e.jpg".

Writing out "2000221bcoverv06a" as "2000221bcoverv06a.jpg" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \2000221bcoverv06a.jpg".

Writing out "2000221bcoverv06c" as "2000221bcoverv06c.jpg" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \2000221bcoverv06c.jpg".

Writing out "2000221bcoverv06b" as "2000221bcoverv06b.jpg" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \2000221bcoverv06b.jpg".

Writing out "2000221bcoverv06d" as "2000221bcoverv06d.jpg" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \2000221bcoverv06d.jpg".

Writing out "p2000221bg3001" as "p2000221bg3001.jpg" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \p2000221bg3001.jpg".

Writing out "p2000221bg11001" as "p2000221bg11001.jpg" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \p2000221bg11001.jpg".

Writing out "p2000221bg4001" as "p2000221bg4001.jpg" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \p2000221bg4001.jpg".

Writing out "p2000221bg127001" as "p2000221bg127001.jpg" ...
Successfully written to "c:\users\brian\appdata\local\temp\libprs500_jyckwc \p2000221bg127001.jpg".

Exploded "c:\users\brian\appdata\local\temp\libprs500_0.4.17 _glehl4.lit" into "c:\users\brian\appdata\local\temp\libprs500_jyckwc \".

[ERROR] convert_from.pyo:1746: Failed to process opf file
Traceback (most recent call last):
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 1704, in try_opf
File "libprs500\ebooks\metadata\opf.pyo", line 120, in fget
File "libprs500\ebooks\lrf\__init__.pyo", line 307, in entity_to_unicode
ValueError: invalid literal for int() with base 10: '201;JĀ'



Anyone have any ideas?

kovidgoyal
11-04-2007, 03:36 PM
Send me the lit

AnemicOak
11-04-2007, 03:55 PM
File sent

kovidgoyal
11-04-2007, 04:10 PM
Will be fixed in next release.

AnemicOak
11-04-2007, 07:56 PM
Thanks :thumbsup:

BlackVoid
11-07-2007, 05:30 PM
Nevermind...

kovidgoyal
11-07-2007, 05:37 PM
That because it supports light weight markup. i.e. it converts TXT to html first and then to LRF.

steviej
11-18-2007, 03:53 PM
When adding LIT books to libprs500, I am getting the same error, "can't set attribute". The traceback is

can't set attribute
Detailed traceback:
Traceback (most recent call last):
File "main.py", line 269, in add_books
File "main.py", line 288, in _add_books
AttributeError: can't set attribute

This only happens with lit files. Any ideas? thanks

StevieJ

kovidgoyal
11-18-2007, 04:05 PM
Fixed in 0.4.23

steviej
11-18-2007, 05:51 PM
Wow! That was fast. Thank you very much
Steviej

Tom Swift
11-21-2007, 08:08 AM
I had what I thought was a bug but I figured it out. I installed this program once I read that it supports rss news feeds from newspapers. Cool. After installing the program, with a bit of problem with drivers, I got it set up and tried to download the NYT. It just sat there and waited, with progress stating unavailable. I could not figure out how to cancel this so I simply turned the program off. I tried it again with the Newsweek feed. Exact same error.

I realize now, after looking through the code, is that I am in China. The Chinese government, in their benevolent wisdom, has blocked access to newsfeeds, which is probably why it just hung up. Since it could not get access to the sites, it just kept on trying and trying. Frustrating, but not the software fault.

Or I could be wrong about all of this but I don't think so. Is there any way to stop this gathering of rss feeds without having to turn the program off? Or will it finally time out once it can not access the site? I can receive some rss feeds as long as they do not have certain words in their url, like rss and such. I might try to figure out how to add an rss feed myself, one that does not use a forbidden url to see if it will work.

kovidgoyal
11-21-2007, 11:30 AM
It should stop once it times out on all RSS feeds. You'd be better off using the command line interface for testing e.g.


web2lrf --verbose nytimes

Tom Swift
11-21-2007, 04:47 PM
Hmmm, I left it running when I went to bed and woke up to find it done! Maybe I just had a very slow connection last night. The BBC stopped immediately, but the other two worked. However, when I tried to upload the newspapers into my device, this is the error message I got.

PathError: Could not create file /Data/media/books/libprs500_29.lrf. Response code: 0xffffffd7L
Failed to perform job: Upload books to device: The New York Times [Wed, 21 Nov, 2007], Newsweek [21 Nov 2007]
Further device related error messages will not be shown while this message is visible.
Detailed traceback:
Traceback (most recent call last):
File "libprs500\gui2\jobs.pyo", line 79, in run
File "libprs500\gui2\device.pyo", line 111, in upload_books
File "libprs500\devices\prs500\driver.pyo", line 168, in run_session
File "libprs500\devices\prs500\driver.pyo", line 878, in upload_books
File "libprs500\devices\prs500\driver.pyo", line 168, in run_session
File "libprs500\devices\prs500\driver.pyo", line 697, in put_file
File "libprs500\devices\prs500\driver.pyo", line 168, in run_session
File "libprs500\devices\prs500\driver.pyo", line 663, in touch
PathError: Could not create file /Data/media/books/libprs500_29.lrf. Response code: 0xffffffd7L

Any ideas?

kovidgoyal
11-21-2007, 04:49 PM
Looks like a temporary error, try re-connecting the reader and doing it again.

Tom Swift
11-21-2007, 04:54 PM
Did some more playing around and I found I can upload the newspapers to the storage card, as well as books, but when I try to upload directly to the device, I get the above error again. I tried to upload a single newspaper and a single book, and received a similar error.

kovidgoyal
11-21-2007, 04:55 PM
Are you out of space?

Tom Swift
11-21-2007, 04:55 PM
I tried that. I closed the program and turned off the reader and then turned on the reader and plugged it in and then ran the program. Same error.

Tom Swift
11-21-2007, 04:56 PM
No, main memory is empty.

Tom Swift
11-21-2007, 04:58 PM
From logfile, trying to upload a single newspaper to the main device.

Error in job: Upload books to device: Newsweek [21 Nov 2007]
Could not create file /Data/media/books/libprs500_28.lrf. Response code: 0xffffffd7L
Traceback (most recent call last):
File "libprs500\gui2\jobs.pyo", line 79, in run
File "libprs500\gui2\device.pyo", line 111, in upload_books
File "libprs500\devices\prs500\driver.pyo", line 168, in run_session
File "libprs500\devices\prs500\driver.pyo", line 878, in upload_books
File "libprs500\devices\prs500\driver.pyo", line 168, in run_session
File "libprs500\devices\prs500\driver.pyo", line 697, in put_file
File "libprs500\devices\prs500\driver.pyo", line 168, in run_session
File "libprs500\devices\prs500\driver.pyo", line 663, in touch
PathError: Could not create file /Data/media/books/libprs500_28.lrf. Response code: 0xffffffd7L

kovidgoyal
11-21-2007, 04:59 PM
What does

prs500 ls -R /Data/media


give you?

Tom Swift
11-21-2007, 05:05 PM
/Data/media:
images/

/Data/media/images:
My Charcoal.jpg

The jpg is a picture I have stored on the reader.

kovidgoyal
11-21-2007, 05:08 PM
Looks like the book folder has been deleted.

prs500 mkdir /Data/media/books

Tom Swift
11-21-2007, 05:14 PM
That did the trick. You are a gentleman and a scholar. Thanks for the help.

Fantastic program, I might add. Exactly what I have been looking for.

jpasarela
11-24-2007, 08:53 PM
I'm getting an error trying to convert a Lit file.

AttributeError: 'NoneType' object has no attribute 'lower'
Failed to perform job: Convert book:C:/Documents and Settings/Joe/My Documents/My Library/SUBTLEKNIFE.lit
Detailed traceback:
Traceback (most recent call last):
File "libprs500\gui2\jobs.pyo", line 97, in run
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 140, in main
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 117, in process_file
File "libprs500\ebooks\lrf\lit\convert_from.pyo", line 63, in process_file
File "libprs500\ebooks\metadata\opf.pyo", line 118, in __init__
File "libprs500\ebooks\metadata\opf.pyo", line 188, in get_isbn
AttributeError: 'NoneType' object has no attribute 'lower'
Log:
[DEBUG] convert_from.pyo:41: clit "c:\docume~1\joe\locals~1\temp\libprs500_0.4.24_zn2 v5-.lit" "c:\docume~1\joe\locals~1\temp\libprs500_jw0q0s\\"
[INFO] convert_from.pyo:43: +---[ ConvertLIT (Version 1.8) ]---------------[ Copyright (c) 2002,2003 ]---
ConvertLIT comes with ABSOLUTELY NO WARRANTY; for details
see the COPYING file or visit "http://www.gnu.org/license/gpl.html".
This is free software, and you are welcome to redistribute it under
certain conditions. See the GPL license for details.
LIT INFORMATION.........
DRM = 1
Timestamp = 06912b6d
Creator = bff6a501
Language = 00000409
Writing out "50849_Subtle_Knife" as "50849_Subtle Knife.htm" ...
Successfully written to "c:\docume~1\joe\locals~1\temp\libprs500_jw0q0s\508 49_Subtle Knife.htm".

Writing out "50849_subtle_knife1" as "50849_subtle knife.css" ...
Successfully written to "c:\docume~1\joe\locals~1\temp\libprs500_jw0q0s\508 49_subtle knife.css".

Writing out "50849landscape_thumb" as "50849landscape_thumb.jpg" ...
Successfully written to "c:\docume~1\joe\locals~1\temp\libprs500_jw0q0s\508 49landscape_thumb.jpg".

Writing out "50849full_size" as "50849full_size.jpg" ...
Successfully written to "c:\docume~1\joe\locals~1\temp\libprs500_jw0q0s\508 49full_size.jpg".

Writing out "50849spine" as "50849spine.jpg" ...
Successfully written to "c:\docume~1\joe\locals~1\temp\libprs500_jw0q0s\508 49spine.jpg".

Writing out "50849full_size_thumb" as "50849full_size_thumb.jpg" ...
Successfully written to "c:\docume~1\joe\locals~1\temp\libprs500_jw0q0s\508 49full_size_thumb.jpg".

Writing out "50849landscape" as "50849landscape.jpg" ...
Successfully written to "c:\docume~1\joe\locals~1\temp\libprs500_jw0q0s\508 49landscape.jpg".

Writing out "publogo" as "publogo.jpg" ...
Successfully written to "c:\docume~1\joe\locals~1\temp\libprs500_jw0q0s\pub logo.jpg".

Writing out "dingbats" as "dingbats.jpg" ...
Successfully written to "c:\docume~1\joe\locals~1\temp\libprs500_jw0q0s\din gbats.jpg".

Exploded "c:\docume~1\joe\locals~1\temp\libprs500_0.4.24_zn2 v5-.lit" into "c:\docume~1\joe\locals~1\temp\libprs500_jw0q0s\".


The 2 other Lit files I bought at the same time converted fine. Anything for me to try?

kovidgoyal
11-25-2007, 01:01 PM
Thats a bug. Please open a bug report.

jpasarela
11-25-2007, 01:06 PM
Thats a bug. Please open a bug report.

Actually I see someone has already put a ticket in for the exact same problem, so I'll put off putting in another one.

JSWolf
11-27-2007, 04:41 PM
I just tried to convert a LIT file and got the following errors...

Traceback (most recent call last):
File "convert_from.py", line 143, in <module>
File "convert_from.py", line 140, in main
File "convert_from.py", line 117, in process_file
File "libprs500\ebooks\lrf\lit\convert_from.pyo", line 63, in process_file
File "libprs500\ebooks\metadata\opf.pyo", line 118, in __init__
File "libprs500\ebooks\metadata\opf.pyo", line 188, in get_isbn
AttributeError: 'NoneType' object has no attribute 'lower'

I get this error with 0.4.23 and 0.4.24 but not 0.4.22.

kovidgoyal
11-27-2007, 05:04 PM
Yeah that's a regression, will be fixed in the next release.

stustaff
11-27-2007, 06:10 PM
Kovid any idea of when the bug mentioned here will be fixed? - http://www.mobileread.com/forums/showthread.php?t=16472

Its stopping me using the program for now.

Thanks

kovidgoyal
11-27-2007, 07:59 PM
When I get around to it :-) Why is that bug such a critical one for you?

JSWolf
11-27-2007, 08:01 PM
What it means is if he purchases a series of books from Sony Connect and then want to have them in order so he knows which book is which in order, he can if he can organize the collection. Otherwise, they are just in whatever order.

kovidgoyal
11-27-2007, 08:11 PM
He can organize the collection now, it just doesn't show up as organized on the reader. I don't think that's such a critical bug.

JSWolf
11-27-2007, 08:18 PM
It's in the reader that he wants it organized.

stustaff
11-28-2007, 04:53 AM
When I get around to it :-) Why is that bug such a critical one for you?

As has been mentioned but to clarify I go on holiday with my Reader and take a new series to get into that I have tagged in order on LibPRS I open the collection and have 12 books in Random order and no way of knowing which to read first :blink:
To me Your tagging system is fantastic but if it doesnt put them in order on the reader it becomes a pointless addition.

I would have to change all my titles to be
"Funstories 1 - The title"
"Funstories 2 - The title"
etc

then just find them in book title on the reader.

I guess its such a critical one because I love your software! I am on a MAC! and love my reader! and yes I have to have things in order...its a disease :D

Xenophon
11-28-2007, 11:41 AM
When I get around to it :-) Why is that bug such a critical one for you?
Critical would be a slight overstatement for me, but it would be super-cool if series-number provided ordering. And even better if you produced collections from the series info without the need to add additional tags. It's not a huge deal for me, as I generally remember the order of the series I'm interested in -- I even get it right much of the time.:grin2:. But my wife complains that she not only forgets which book is next, but also which book goes with which series. And it sure seems like a pity to have to add a tag that matches the series info I've already entered.

On the other hand, you've provided a ton of cool features and useful stuff, so I won't start in on the "are we there yet?" thing. I'll just tell you to "get right on it :whip:" instead. :)

Xenophon

kovidgoyal
11-28-2007, 11:55 AM
Hmm well in the face of so much passion, what can I say...I'll get it done ;-)

stustaff
11-28-2007, 02:49 PM
You are a wonderful person, thankyou.

I think to get such a product with the support you offer for just Ģ10 english pounds is a bargain! and that is why I will be donating that sum to support further development :) (or if you want to buy yourself something nice thats fine too)

Thanks again.

Mitchll
11-28-2007, 06:42 PM
Kovid,
To say that your work is well appreciated would be an understatement!!! Great is the word that come to mind.

HAVE A HAPPY HOLIDAY SEASON.

Mitch

Juanlopes
11-29-2007, 04:19 PM
Hello everybody,

Ive got a new 505, in my firsts steps trying to convert some documents with the exceptional software from Kovidgoyal LIBPRS-500, i`ve encountered a problem converting a RTF to LRF some spanish accents characters,and others has been lost. No problems seems to be with Pdfs.

Any body knows what im doing wrong ?

Thanks in advance.

Juan.

Sorry for my bad English.

P.D. Kovid`s Soft is better than Sony`s Soft.

kovidgoyal
11-29-2007, 04:21 PM
You will have to embed fonts to see non English characters.

nsg
11-30-2007, 06:27 PM
When I convert html to lrf with html2lrf it makes some of the paragraphs typeset in bold. It is really strange because there is nothing in these paragraphs that distingushes them from others. All start with <p> and have no markup inside.

Is there a workaround?

kovidgoyal
11-30-2007, 06:28 PM
Can you attach either the original file or a test case.

nsg
11-30-2007, 06:55 PM
Sent to hotmail account in public profile.

text is mostly utf-8 encoded.
I have noticed that bold paragraph happen right before <h2> tag.
I also have not tried it with reader, just with lrfviewer.

nsg
11-30-2007, 07:29 PM
Just ried it with reader -- same thing. So it is not lrfviewer issue.

nsg
11-30-2007, 07:43 PM
Ok, the problem with bold paragraphs was because paragraph was not closed with </p>

Linda
12-04-2007, 05:55 PM
I am a real novice. I have the 505. I bought a book in MS lit form and downloaded the lrf2lit software. I tried to convert and this is the error I received. Can anyone help me?


C reports: No such file or directory LIBC reports: No such file or directory LIBC reports: No such file or directory WARNING: Unable to open file "keys.txt".WARNING: Unable to open file "clitkeys.txt".WARNING: Unable to open file "e:\docume~1\linda\locals~1\temp\keys.txt".No "keys.txt" files found. Can't decrypt.
Failed to perform job: Convert book:E://KillerFocus978 1426809446[1].lit
Detailed traceback:
Traceback (most recent call last):
File "libprs500\gui2\jobs.pyo", line 97, in run
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 140, in main
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 117, in process_file
File "libprs500\ebooks\lrf\lit\convert_from.pyo", line 58, in process_file
File "libprs500\ebooks\lrf\lit\convert_from.pyo", line 49, in generate_html
ConversionError: LIBC reports: No such file or directory
LIBC reports: No such file or directory
LIBC reports: No such file or directory
WARNING: Unable to open file "keys.txt".WARNING: Unable to open file "clitkeys.txt".WARNING: Unable to open file "e:\docume~1\linda\locals~1\temp\keys.txt".No "keys.txt" files found. Can't decrypt.
Log:
[DEBUG] convert_from.pyo:41: clit "e:\docume~1\linda\locals~1\temp\libprs500_0.4.25_j oqjct.lit" "e:\docume~1\linda\locals~1\temp\libprs500_cfd0d6\\"
[INFO] convert_from.pyo:43: +---[ ConvertLIT (Version 1.8) ]---------------[ Copyright (c) 2002,2003 ]---
ConvertLIT comes with ABSOLUTELY NO WARRANTY; for details
see the COPYING file or visit "http://www.gnu.org/license/gpl.html".
This is free software, and you are welcome to redistribute it under
certain conditions. See the GPL license for details.




LIT INFORMATION.........
DRM = 5
Timestamp = 40ab409e
Creator = 00140000
Language = 00000409

DECRYPTION FAILED - No keys available for this title.

kovidgoyal
12-04-2007, 06:01 PM
That's a DRMed LIT file. You have to use the convertlit software to first remove the DRM.

mlbspike
12-04-2007, 07:34 PM
Installing libprs500 yesterday, it requested an uninstall of Windows driver for the 500. After install, I started libprs500, but it didn't see the reader. I let windows prompt that it saw new hardware, then let it auto search and install, and libprs500 then saw the reader, and everything worked smoothly. Later, I opened up the Connect software, to go to the online store, and was prompted to get latest version (when I let windows do it's thing, automatically, apparently I wound up behind the times, but functional). I assume I can let it upgrade to latest, without disturbing libprs500 functionality? Can you alternately go back and forth between Sony's library software, and libprs500, and have both see the reader? Currently, libprs500 works, and the Sony software works, except that it doesn't see the reader.
Don't know of a reason, offhand, to want both working ... just curious.
Different question. I didn't see offhand where the books I brought into libprs500 were stored, and didn't see any way to specify where I wanted them stored. After converting, and moving to the reader, I saved them to my G: partition, then deleted them from libprs500, in hopes this would clean up any excess files it might be saving somewhere on the C drive. I like to keep my C partition as clean as possible - OS, and essential programs, and relegate games, downloads, and assorted data files to other partitions. Makes cleanup, defrags, and backups of my critical stuff easy and quick, and keeps my bootups extremely quick ... so I'm willing to do it much more frequently. Is there some way to config the target directory? Am I missing the blindingly obvious location it is saving converted files to, after I hit the convert button?
If my workaround is the best I can do, that's fine, but wanted to check. Thanks for the splendid tool. Hard to feel much in the way of early adopter angst :knife: when you go and make things so darn easy, blast it. :D

kovidgoyal
12-04-2007, 07:47 PM
You cant use both simultaneously, windows limitation. Books, both the original and the converted copy are stored in a database library1.db that should be under documents and settings. Making the db location configurable is on my TODO list.

urseus
12-05-2007, 01:47 AM
Ok silly question.

Ive downloaded this and think it looks great an easy.

When you convert PDFs (any maybe other files ) with say pictures with the text, do the pictures get converted over as well, or just text?

Oh and does it convert Secure PDFs at all?

kovidgoyal
12-05-2007, 01:51 AM
No it doesn't convert secure PDFs and whether images are converted is highly PDF dependent, works beautifully for some files and not at all for others.

It supports images in HTML, LIT and RTF (except WMV images)

Linda
12-05-2007, 02:39 PM
That's a DRMed LIT file. You have to use the convertlit software to first remove the DRM.


Thank you. I actually converted a .lit book. But the book title came up on the 505 as C: documents and settings/ etc. What did I do wrong - why didn't the title of the book appear first.

kovidgoyal
12-05-2007, 02:45 PM
I'm not sure, perhaps the lit file did not have metadata in it, in which case the filename is used as the default title.

AnemicOak
12-05-2007, 03:11 PM
I'm not sure, perhaps the lit file did not have metadata in it, in which case the filename is used as the default title.

All my LIT files have imported into libprs500 for the last couple versions. It's no biggie though, it's easy enough to change.

kovidgoyal
12-05-2007, 03:12 PM
All my LIT files have imported into libprs500 for the last couple versions. It's no biggie though, it's easy enough to change.

You mean the metadata from them is not being read correctly?

AnemicOak
12-05-2007, 03:29 PM
You mean the metadata from them is not being read correctly?

Shrugs

I guess. Where I used to get a title of some sort in the title field I now get a full path to the file as the name. Maybe it has something to do with what ConvertLit does to the file. I'm not complaining about it or anything, like I said easy enough to fix the title, I just mentioned it since it sounds like what Linda is mentioning.

kovidgoyal
12-05-2007, 03:31 PM
Ah a regression, will be fixed in next release.

Linda
12-05-2007, 04:57 PM
Shrugs

I guess. Where I used to get a title of some sort in the title field I now get a full path to the file as the name. Maybe it has something to do with what ConvertLit does to the file. I'm not complaining about it or anything, like I said easy enough to fix the title, I just mentioned it since it sounds like what Linda is mentioning.


Easy for you to say. :) How do you change a title after the path is the title on the 505? I am not complaining about the software it is wonderful. I just follow the directions and "like a miracle" I get the book on my 505.

kovidgoyal
12-05-2007, 05:02 PM
Click on the reader icon, then double click on the title you want to change, change the title, and you're done. But in anycase, this is a bug that should be fixed in the next version of libprs500

urseus
12-05-2007, 05:51 PM
This works great with the defaults. The font is nice and i love that it fits more text onto the page, all the way to the edges of the screen.

I cant get the chapters to work quite right, but i know its not the program but the pdfs im getting it from.
Thanks so much for this. Opens up alot more options for me in Australia.


Just quickly, is there an easy way to grab an RSS feed from a site that isnt listed in your program?

gwynevans
12-06-2007, 05:39 AM
Just quickly, is there an easy way to grab an RSS feed from a site that isnt listed in your program?

That depends upon your definition of "easy"...
See this wiki page (https://libprs500.kovidgoyal.net/wiki/UserProfiles) on Kovid's site for details.

stustaff
12-06-2007, 05:34 PM
I struggled with this for a while but now just use fedbooks.com! paste the RSS URL in and it generates a PDF ready for use on the 505, its very neat.

JTravers
12-06-2007, 07:32 PM
I struggled with this for a while but now just use fedbooks.com! paste the RSS URL in and it generates a PDF ready for use on the 505, its very neat.

The only problem with Feedbooks.com is that the RSS functionality is only useful for sites that include the full content in their RSS feeds. Partial/summary content feeds work much better with libprs500's web2lrf tool.

NigelS
12-12-2007, 12:23 PM
C:\Program Files\libprs500\library.zip\libprs500\ebooks\lrf\m eta.py:498: DeprecationWarning: struct integer overflow masking is deprecated

What does this error mean?

I get it when I exit libprs500 and my PRS505 is connected to the PC.

Thanks
NigelS

kovidgoyal
12-12-2007, 01:11 PM
It's a warning you can ignore it.

NigelS
12-12-2007, 03:10 PM
A warning of what?

Anyway, if it doesn't mean anything and can be ignored, could we not have an option to turn off warnings? It's a bit annoying to have to click an OK box and clear the dialog everytime it appears.

Great application by the way - I will be donating in due course. I haven't bothered to even install the Sony Connect application as I can't see any reason to use it in preference to libprs500.

NigelS

JSWolf
12-12-2007, 03:12 PM
You will need Ebook Library if you want to purchase books from the Sony Connect store.

By the way, since I have a 505, can I use both Ebook Library and Libprs500 on the same machine?

NigelS
12-12-2007, 03:17 PM
I doubt I will be buying anything from the Sony Connect store. I think I will be going the MS Reader *.LIT conversion route. I have already bought 5 books in *.LIT format and they look great when converted to the 505.

Cheers
NigelS

kovidgoyal
12-12-2007, 03:18 PM
@NigelS: That's odd, the warning shouldn't result in a dialog box. It should normally just be ignored. Probably a windows quirk. Open a ticket and I'll fix it for the next release.

@JWolf: In theory yes, but I haven't tested it and some people have reported problems when using both to transfer books.

NigelS
12-13-2007, 03:25 PM
kovidgoyal

I have opened a ticket as you requested. The dialog box has an "OK" button and across in the top right corner. Use of one or the other of these is currently required to clear it off the desktop.

NigelS

WookieReader
12-13-2007, 11:12 PM
Just super software and great progress.

Minor error msg on both attempts at converting scanned pdf doc on both the Mac X version and Windows XP shell.

ConversionError: libprs500_0.4.30_3elhp0.html does not seem to have any content
Failed to perform job: Convert book:BD Contract
Detailed traceback:
Traceback (most recent call last):
File "libprs500\gui2\jobs.pyo", line 97, in run
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 140, in main
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 117, in process_file
File "libprs500\ebooks\lrf\pdf\convert_from.pyo", line 75, in process_file
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 1682, in process_file
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 243, in __init__
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 343, in add_file
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 462, in parse_file
ConversionError: libprs500_0.4.30_3elhp0.html does not seem to have any content
Log:
[INFO] convert_from.pyo:45: Page-1
Page-2
Page-3
Page-4

[INFO] convert_from.pyo:332: Processing libprs500_0.4.30_3elhp0.html
[INFO] convert_from.pyo:285: Parsing HTML...
[INFO] convert_from.pyo:336: Converting to BBeB...


I read nearly all the thread and reinstalled both.....

Any suggestions.....I'm sure I've overlooked something

Thanks in advance!

kovidgoyal
12-14-2007, 12:30 AM
Send me the PDF file.

WookieReader
12-14-2007, 10:43 PM
The PDF I tried had quite a bit of letterhead and borders going down the side with additional names and graphics and I guessed correctly that the program did not like that as you have mentioned.

So, I scanned plain text and tried the Windows Mac 10.5.1 version of Libre500 and it worked like a charm on both. Uploaded to Sony and original plus 3 levels of zoom was wonderful.

Will be contributing to the cause shortly......

Thanks,

Chris

kovidgoyal
12-14-2007, 10:51 PM
Cool I wish all my users were like you ;)

AnemicOak
12-15-2007, 09:16 PM
Getting an error on a LIT file. Anything I can do?

LrsError: TOC destination must be a Canvas, TextBlock, ImageBlock or RuledLine not a

Failed to perform job: Convert book:Requiem for the Devil

Detailed traceback:

Traceback (most recent call last):
File "libprs500\gui2\jobs.pyo", line 97, in run
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 140, in main
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 117, in process_file
File "libprs500\ebooks\lrf\lit\convert_from.pyo", line 95, in process_file
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 1684, in process_file
File "libprs500\ebooks\lrf\html\convert_from.pyo", line 604, in create_toc
File "libprs500\ebooks\lrf\pylrs\pylrs.pyo", line 733, in addTocEntry

LrsError: TOC destination must be a Canvas, TextBlock, ImageBlock or RuledLine not a

Log:
[DEBUG] convert_from.pyo:41: clit "c:\users\brian\appdata\local\temp\libprs500_0.4.30 _zzpktr.lit" "c:\users\brian\appdata\local\temp\libprs500_fzumkw \\"
[INFO] convert_from.pyo:45:
[INFO] convert_from.pyo:332: Processing 00-cover.1252.html
[INFO] convert_from.pyo:285: Parsing HTML...
[INFO] convert_from.pyo:336: Converting to BBeB...
[INFO] convert_from.pyo:332: Processing 01-copyright.1252.html
[INFO] convert_from.pyo:285: Parsing HTML...
[INFO] convert_from.pyo:336: Converting to BBeB...
[INFO] convert_from.pyo:332: Processing 03-dedication.1252.html
[INFO] convert_from.pyo:285: Parsing HTML...
[INFO] convert_from.pyo:336: Converting to BBeB...
[INFO] convert_from.pyo:332: Processing 04-acknowledgments.1252.html
[INFO] convert_from.pyo:285: Parsing HTML...
[INFO] convert_from.pyo:336: Converting to BBeB...
[INFO] convert_from.pyo:332: Processing index.1252.html
[INFO] convert_from.pyo:285: Parsing HTML...
[INFO] convert_from.pyo:336: Converting to BBeB...
[INFO] convert_from.pyo:332: Processing index.1252.html
[INFO] convert_from.pyo:285: Parsing HTML...
[INFO] convert_from.pyo:336: Converting to BBeB...
[INFO] convert_from.pyo:332: Processing index.1252.html
[INFO] convert_from.pyo:285: Parsing HTML...
[INFO] convert_from.pyo:336: Converting to BBeB...
[INFO] convert_from.pyo:332: Processing 00-appendix.1252.html
[INFO] convert_from.pyo:285: Parsing HTML...
[INFO] convert_from.pyo:336: Converting to BBeB...
[INFO] convert_from.pyo:332: Processing 01-about.1252.html
[INFO] convert_from.pyo:285: Parsing HTML...
[INFO] convert_from.pyo:336: Converting to BBeB...
[INFO] convert_from.pyo:267: Rationalizing font sizes...

kovidgoyal
12-15-2007, 09:20 PM
Send the LIT file to me :)

AnemicOak
12-16-2007, 05:44 PM
Send the LIT file to me :)

Ok, sent.

stustaff
12-27-2007, 09:46 AM
Error when adding books. seems to happen when I try to add more than one at once? any suggestions.

'NoneType' object has no attribute 'metadata'
Detailed traceback:
Traceback (most recent call last):
File "/Applications/libprs500.app/Contents/Resources/main.py", line 283, in add_books
File "/Applications/libprs500.app/Contents/Resources/main.py", line 296, in _add_books
File "libprs500/ebooks/metadata/opf.pyo", line 102, in __get__
File "libprs500/ebooks/metadata/opf.pyo", line 198, in get_title
AttributeError: 'NoneType' object has no attribute 'metadata'

Thanks

kovidgoyal
12-27-2007, 08:08 PM
What formats were the books? Adding two LIT files simultaneously worked for me.

stustaff
12-29-2007, 03:40 PM
Yeh sometimes it works for me too and actually have now done a few in a row with no problems! Im going to see if I can replicate it and get some more info.

erikk
01-11-2008, 04:08 AM
Getting an error trying to convert a few .lit files:

ConversionError: Error reading file "c:\users\erikkr~1\appdata\local\temp\libprs500_0.4 .33_cokc36.lit" -- This file does not appear to be a .LIT file.
Failed to perform job: Convert book:Life,the Universe and Everything
Detailed traceback:
Traceback (most recent call last):
File "libprs500\gui2\jobs.pyo", line 97, in run
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 143, in main
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 120, in process_file
File "libprs500\ebooks\lrf\lit\convert_from.pyo", line 62, in process_file
File "libprs500\ebooks\lrf\lit\convert_from.pyo", line 53, in generate_html
ConversionError: Error reading file "c:\users\erikkr~1\appdata\local\temp\libprs500_0.4 .33_cokc36.lit" --
This file does not appear to be a .LIT file.
Log:
[DEBUG] convert_from.pyo:42: clit "c:\users\erikkr~1\appdata\local\temp\libprs500_0.4 .33_cokc36.lit" "c:\users\erikkr~1\appdata\local\temp\libprs500_gry sbz\\"
[INFO] convert_from.pyo:46:


Any ideas?

kovidgoyal
01-11-2008, 04:47 AM
looks like convertlit cant handle that lit file.

erikk
01-11-2008, 12:15 PM
looks like convertlit cant handle that lit file.

I'm not sure I understand this. Does that mean I'm just SOL on this file? That I should look for convertlit help? ?

kovidgoyal
01-11-2008, 12:28 PM
Yeah. Sorry :-)

erikk
01-11-2008, 01:13 PM
Salright, not your fault. Man I hope this is just a fluke; if I can't convert a lot of .LIT files I'm going to be in a bind.

JSWolf
01-11-2008, 01:19 PM
It is a fluke. Normally it works fine.

reeder
01-26-2008, 07:59 PM
I'm new to everything here, mobileread, sony readers, and heck e-book readers in general. I have done my homework before buying, downloading and posting but this is fairly urgent so I appreciate any and all help.
I downloaded the current version of libprs500 to convert (non-DRM) .LIT files into .LRF for my Sony Reader PRS505. But the LIT2LRF.exe does not work at all. An MS-DOS type screen flashes then disappears. I have tried uninstalling and reinstalling Libprs500 but same thing happens, and it's driving me crazy trying to get it to work. Is there a way to fix? Or is there another way to convert .LIT to .LRF (or even .RTF or .TXT) ???

I'm running Windows XP Home btw. Thanks in advance.

kovidgoyal
01-26-2008, 08:06 PM
Start the libprs500 GUI (there will be an icon on your desktop or in your start menu). Add the lit file to the library, click convert

reeder
01-26-2008, 08:20 PM
Thank you for your quick response, Mr. Kovidgoyal. I know you are busy with all the great softwares you develop for us on the site.
I tried doing what you said before and it just brings up categories of Metadata, Look&Feel, etc. If I save to disk it just pops out LIT files, no conversion.
I tried typing lit2lrf in ms-dos command prompt but it says no lit file specified. I know others find this very simple to use, but I'm having much difficulty (and frustration) getting this to work. Thanks in advance.

kovidgoyal
01-26-2008, 08:25 PM
After clicking the convert button click the OK button at the bottom right corner

reeder
01-26-2008, 08:37 PM
the OK button disappears after a split second and I cannot click on it before it vanishes :blink:

Edit: It turns out that each one of the over 20 .LIT files I was trying to convert were not being recognized by the program. These were all by one author I got from a friend's collection, so I think its a problem on whoever created the LIT files.
I tried another LIT file from a different source and it worked flawlessly as it should.

Great program and Thank You For you Patient Replies, Mr. Kovidgoyal! Awesome program, my friend!

kovidgoyal
01-26-2008, 08:43 PM
you're probably running it on too small a screen so it goes off the edge of the screen. Just press enter

JSWolf
01-27-2008, 09:08 PM
If I was to put in a ticket for adding an option to adjust the line spacing, how long do you think it would take to implement?

And thank you very much for fixing the last line. It works very nicely on my 505.

kovidgoyal
01-27-2008, 09:14 PM
There's already a ticket for that and I have no idea :) Depends on whether I have a spare moment and if that ticket catches my eye.

JSWolf
01-27-2008, 09:17 PM
Would putting in a second ticket help catch your eye?

kovidgoyal
01-27-2008, 09:24 PM
Nope it would just annoy me.

shousa
01-27-2008, 09:53 PM
I successfully changed a .lit with DRM to .lit without DRM and tested the file on a PC without microsoft reader activation and it worked.

Conversion using either libprs500 GUI or commandline only gave me the first 3 pages (Cover, publishing details and index) (so 3MB .lit file became a 99K .lrf)

Loading the .lit into bookdesigner produced only the first 3 pages.

Converting to .html made a mess of it with chinese characters (english OS).

BUT I could convert to .rtf using http://www.processtext.com/abclit.html then copy and paste the first 3 pages from bookdesigner into it.

The resulting .rtf was able to be converted to .lrf thru libprs500.

Two key points I want to make:
1) When all else fails abclit will do the job
2) I did however lose all the links (eg chapters and notes) and have generally lost links with all libprs500 .lit to .lrf conversions - is this normal?

Hope this finding contributes to those with .lit files that will not convert easily to .lrf - I did not see mention of abclit before, should someone make a sticky??

kovidgoyal
01-27-2008, 10:00 PM
Losing links is not normal.

shousa
01-27-2008, 11:22 PM
My mistake - the paperbacks have the contents links working but at the back of the .lrf files not the front.

Have you experienced any proven nondrm.lit files (like mine) where only the first few pages are output using libprs500 (both GUI and commandline)?

kovidgoyal
01-27-2008, 11:35 PM
nope .

secretsubscribe
01-28-2008, 04:38 PM
Hello
Here's the first version of a Profile for The Nation magazine at TheNation.com.
I've attached a copy of the profile to the user profiled section of the libprs500site:
There's no RSS feed, so I needed to parse out URLs from the home page of a given issue.
The variable 'nation_issue_date' needs to be updated to get the current issue.
I created another variable 'nation_issue_date_long' that's used as the article publish date and is part of the output file name (if downloading several issues at once through the command line as I was doing.)


https://libprs500.kovidgoyal.net/attachment/wiki/UserProfiles/thenation.py

greylin
01-28-2008, 06:46 PM
I've been using libprs500 successfully for a while to convert to LRF, but have a new LIT file that won't convert. Not sure if it's the file or the fact that I recently had to reinstall MS Reader, after which I ran ReaderKeyRecoveryTool.exe again. I'm getting this error message:

LIT INFORMATION.........

DRM = 5

Timestamp = 44ef3f3b

Creator = 7ffde000

Language = 00000409

DECRYPTION FAILED - No keys available for this title.

LIBC reports: No such file or directory

LIBC reports: No such file or directory

LIBC reports: No such file or directory

WARNING: Unable to open file "keys.txt".WARNING: Unable to open file "clitkeys.txt".WARNING: Unable to open file "c:\docume~1\jan\locals~1\temp\keys.txt".No "keys.txt" files found. Can't decrypt.
Traceback (most recent call last):
File "libprs500\gui2\jobs.pyo", line 97, in run
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 140, in main
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 117, in process_file
File "libprs500\ebooks\lrf\lit\convert_from.pyo", line 58, in process_file
File "libprs500\ebooks\lrf\lit\convert_from.pyo", line 49, in generate_html
ConversionError: LIBC reports: No such file or directory

LIBC reports: No such file or directory

LIBC reports: No such file or directory

WARNING: Unable to open file "keys.txt".WARNING: Unable to open file "clitkeys.txt".WARNING: Unable to open file "c:\docume~1\jan\locals~1\temp\keys.txt".No "keys.txt" files found. Can't decrypt.

EDIT

Well I seem to have got round the problem by manually saving keys.txt to my temp folder, since that's where the program was looking for it. I've never had to do this before but at least it worked. How come this has happened?

kovidgoyal
01-28-2008, 07:54 PM
When you re-install convertlit, you have to replace the keys.txt. If you put it in the directory libprs500 is installed in as well as the directory convertlit is installed in, you should be fine.