LazyLibrarian: Automate your ebook/author collection

Got a program that plays well with SABnzbd? Share it here!
User avatar
Mar2zz
Jr. Member
Jr. Member
Posts: 85
Joined: February 4th, 2011, 8:30 am
Contact:

Re: LazyLibrarian: Automate your ebook/author collection

Post by Mar2zz »

The addbook option doesn't work, right now only authors can be added, that way all books from an author will be imported in the database. Then you can select a book on the authorpage and set it as wanted.

See also this issue:
https://github.com/Mar2zz/LazyLibrarian/issues/8
innerspace
Newbie
Newbie
Posts: 5
Joined: October 11th, 2011, 6:56 pm

Re: LazyLibrarian: Automate your ebook/author collection

Post by innerspace »

I have successfully added a book by searching for the title, checking the box next to the desired result and clicking the 'Add' button.
I've also successfully added an author by searching for their name, clicking the box next to a match and clicking 'Add'.

I will state that the single book I added has not been found whereas the author added immediately began retrieving nzbs and sending them to sabnzbd.

All in all I'm very excited to see how far you can take LL, thanks a bunch for taking the initiative, I had considered learning python in exactly the same way over the last few months and find the fact that I stumbled across your work rather entertaining :)

A few items for my "wish list":
1) ability to scan, query and display contents of previously existing library
2) ability to manage metadata for items
3) ability to add limited user access (to share library with family members)
4) ability to add items to multiple "collections" and give users access to collections based on individual profile
5) ability to specify "format priority" (dictates desired format priority order ie: epub then mobi then pdf)
6) ability to crowd source ratings and reviews via users
7) https access

Finally, I currently use calibre server to host an extremely large library and share it with my family, however, it is bulky, buggy and (while impressive) somewhat incomplete as a server (it's secondary purpose). It would be extremely helpful to be able to use the directory structure Calibre creates in LL, I'm not sure if you could include an option to import the calibre DB or not, might be something to consider.

Thanks again for your efforts :)
User avatar
Mar2zz
Jr. Member
Jr. Member
Posts: 85
Joined: February 4th, 2011, 8:30 am
Contact:

Re: LazyLibrarian: Automate your ebook/author collection

Post by Mar2zz »

My first prio is to create a reliable and stable webserver which searches for books on multiple providers (torrents also), processes nzb's/torrents, postprocesses (with naming schemes) books based on fileformat (if multiple books in download, keep only preferred format) and this all without bugs and stuff.

after that import of existing library's is a prio (I too have a rather large collection, build over the last 2 years). I also want to do something with 'paper'-books. I sometimes have the book in paper, I want to tell LL that I own that one too.

Added NZBMatrix support. Searchorder is the same as on config page. First it tries newznab (if set), if no results it continues on NZBMatrix. It seems to work but I can't be sure because I have payed account. (it downloads empty nzb's for me).
nutski
Release Testers
Release Testers
Posts: 45
Joined: July 6th, 2009, 4:53 am

Re: LazyLibrarian: Automate your ebook/author collection

Post by nutski »

NZBMatrix seems to be working fine, i just added some authors randomly and it has sent 40 or more books perfectly so far to SAB, great work so far!!
User avatar
Mar2zz
Jr. Member
Jr. Member
Posts: 85
Joined: February 4th, 2011, 8:30 am
Contact:

Re: LazyLibrarian: Automate your ebook/author collection

Post by Mar2zz »

Wow, it's a rare thing my code works at first try :p
thx for testing.
nutski
Release Testers
Release Testers
Posts: 45
Joined: July 6th, 2009, 4:53 am

Re: LazyLibrarian: Automate your ebook/author collection

Post by nutski »

Mar2zz wrote:Wow, it's a rare thing my code works at first try :p
thx for testing.
Seems good so far!
Will keep updating everytime there are changes and testing as this app will make life a lot easier!
NZBMatrix part definately works as i've now hit my hourly limit on API downloads :)
nutski
Release Testers
Release Testers
Posts: 45
Joined: July 6th, 2009, 4:53 am

Re: LazyLibrarian: Automate your ebook/author collection

Post by nutski »

Found an issue in post processing:

2012-02-17 11:19:41 INFO Postprocessing for The Belgariad: Queen of sorcery has failed.
2012-02-17 11:19:41 ERROR Could not create destinationfolder. Check permissions of: N:\Books
2012-02-17 11:19:41 INFO N:\Books\David Eddings\The Belgariad: Queen of sorcery does not exist, so it's safe to create it
2012-02-17 11:19:41 INFO Found folder N:\Downloads\books\Eddings, David The Belgariad 02 Queen of Sorcery (v4 0) [rtf].

I'm presuming its trying to make a directory with : in which is causing the failure?

I'll post this up as an issue on GIT
User avatar
Mar2zz
Jr. Member
Jr. Member
Posts: 85
Joined: February 4th, 2011, 8:30 am
Contact:

Re: LazyLibrarian: Automate your ebook/author collection

Post by Mar2zz »

Solved that one :p

I am getting a headache by this one:
I have added (not in git yet) the option to set ebookfiletypes in preferred order in the config. (like epub, mobi, lit, pdf etc).

So, there is a list with an order. Now I use glob.glob to read the downloadpath in that order (*.extension grabbed from list) to see if preferred files are found. It always returns nothing, but if I write it in a small python script with one folder to process it works fine.

So this works fine:

Code: Select all

import os, glob

mypath = '/home/mars/Ebooks/Joe Abercrombie/The Blade Itself/'
extlist = ('epub', 'mobi', 'lit')

for extension in extlist:
    for bookfile in glob.glob(os.path.join(mypath, '*.'+extension)):
        print extension,': ', bookfile
Which returns:

Code: Select all

mars@notebook:~/Gitprojects$ python test.py
epub :  /home/mars/Ebooks/Joe Abercrombie/The Blade Itself/Joe Abercrombie - [The First Law 01] - The Blade Itself (v5.1) (epub).epub
epub :  /home/mars/Ebooks/Joe Abercrombie/The Blade Itself/Joe Abercrombie - [The First Law 01] - The Blade Itself (v5.0) (epub).epub
mobi :  /home/mars/Ebooks/Joe Abercrombie/The Blade Itself/Joe Abercrombie - [The First Law 01] - The Blade Itself (v5.1) (mobi).mobi
But if I do it from lazylibrarian, which is very similar (with variables of course), it returns nothing... Some pythoncoders here that see what's wrong?

Code: Select all

    if os.path.exists(dest_path):
        if lazylibrarian.DEST_ORDEREXT and lazylibrarian.DEST_ORDEREXT:
            logger.info('Check if preferred filetype is found;')
            extensions = string.split(string.replace(lazylibrarian.DEST_ORDEREXT, ' ', ''), ',')
            print extensions
            for extension in extensions:
                print extension
                print glob.glob(os.path.join(pp_path, '*.'+extension))
It returns this:

Code: Select all

17-feb-2012 22:44:30 - INFO :: POSTPROCESS : Found folder /home/mars/Downloads/Robin Hobb - [The Tawny Man 02] - Golden Fool.
17-feb-2012 22:44:30 - INFO :: POSTPROCESS : Check if preferred filetype is found;
[u'epub', u'mobi', u'lit', u'pdf']
epub
[]
mobi
[]
lit
[]
pdf
[]
Making me crazy. pp_path and dest_path are correct variables, there is an epubfile and mobi file in that folder... what o what...
DedTV
Newbie
Newbie
Posts: 2
Joined: January 26th, 2012, 1:15 pm

Re: LazyLibrarian: Automate your ebook/author collection

Post by DedTV »

Mar2zz wrote:nzbs.org doesn't list ebooks, so that one isn't gonna be supported unfortunately.
The Beta version of nzbs.org does. http://beta.nzbs.org/browse?t=4050

The beta version is Newznab based, so coverage is likely already provided in LL. nzbs.org users should only need to configure beta.nzbs.org as their newznab provider in LL. Haven't gotten that far with LL yet to try it to make sure it works myself though.
Seabull
Newbie
Newbie
Posts: 2
Joined: September 27th, 2011, 1:55 pm

Re: LazyLibrarian: Automate your ebook/author collection

Post by Seabull »

Books titled with 'and' by LL, but listed with '&' on NZBMatrix fail to snatch.
Additionally, the search syntax breaks very easily.
LL submits

Code: Select all

<FirstName> <LastName> <Title>
but an example NZBMatrix entry happens to be

Code: Select all

<LastName>, <FirstName> <Title>
this returns 0 results.

Further inspection reveals that NZBMatrix is very sensitive about its search results. If a release is listed as

Code: Select all

<LastName> <FirstName> <Title>
and you search

Code: Select all

<FirstName> <LastName> <Title>
the results will be 0.
A suggestion for this is to possibly blast the search with all the possible arrangments (9 in this case).

You should also add a preference for epub, mobi and pdf.

Additionaly, Is there any chance we can see a Chrome extension that works like CouchPotato's on IMDb?
ie: Browsing a movies IMDb page pops up with an "Add to Couchpotato" link in the bottom right of the page.
Replace IMDb with Amazon, CP with LL and Voila!
User avatar
Mar2zz
Jr. Member
Jr. Member
Posts: 85
Joined: February 4th, 2011, 8:30 am
Contact:

Re: LazyLibrarian: Automate your ebook/author collection

Post by Mar2zz »

DedTV wrote:
Mar2zz wrote:nzbs.org doesn't list ebooks, so that one isn't gonna be supported unfortunately.
The Beta version of nzbs.org does. http://beta.nzbs.org/browse?t=4050

The beta version is Newznab based, so coverage is likely already provided in LL. nzbs.org users should only need to configure beta.nzbs.org as their newznab provider in LL. Haven't gotten that far with LL yet to try it to make sure it works myself though.
thx. Will make an nzbs.org one, that uses the beta auto. That saves the newznab spot for a custom newznab server.
Seabull wrote:Books titled with 'and' by LL, but listed with '&' on NZBMatrix fail to snatch.
Additionally, the search syntax breaks very easily.
LL submits

Code: Select all

<FirstName> <LastName> <Title>
but an example NZBMatrix entry happens to be

Code: Select all

<LastName>, <FirstName> <Title>
this returns 0 results.

Further inspection reveals that NZBMatrix is very sensitive about its search results. If a release is listend as

Code: Select all

<LastName> <FirstName> <Title>
and you search

Code: Select all

<FirstName> <LastName> <Title>
the results will be 0.
A suggestion for this is to possibly blast the search with all the possible arrangments (9 in this case).

You should also add a preference for epub, mobi and pdf.

Additionaly, Is there any chance we can see a Chrome extension that works like CouchPotato's on IMDb?
ie: Browsing a movies IMDb page pops up with an "Add to Couchpotato" link in the bottom right of the page.
Replace IMDb with Amazon, CP with LL and Voila!
Thx for pointing that one. I don't understand why nzbmatrix is so sensitive about searches, I use + signs between words, which is in normal searchmachines working as find anything as long as it contains all these. Things like ampersands (which I believe the & is called) can be replaced of course before searching.

The couchpotato thingy is nice to work on, but it's java, and my java sucks to be honest. In fact I wrote some things for that couchpotato script (the moviemeter.nl and whiwa part), but that was a copy/paste thingy. But, I will see if my copy/paste-fu is good enough to turn that script around in favour of books :p )
User avatar
Mar2zz
Jr. Member
Jr. Member
Posts: 85
Joined: February 4th, 2011, 8:30 am
Contact:

Re: LazyLibrarian: Automate your ebook/author collection

Post by Mar2zz »

@seabull: Can you post some examples? The search of nzbmatrix returns correct results on stephen king claiborne, but also on king claiborne stephen and claiborne stephen. so the search isn't that sensitive as you say it is?

And do you have an example author title with & in it that is also on nzbmatrix? I can test some with it if I know one.
User avatar
Mar2zz
Jr. Member
Jr. Member
Posts: 85
Joined: February 4th, 2011, 8:30 am
Contact:

Re: LazyLibrarian: Automate your ebook/author collection

Post by Mar2zz »

DedTV wrote:
Mar2zz wrote:nzbs.org doesn't list ebooks, so that one isn't gonna be supported unfortunately.
The Beta version of nzbs.org does. http://beta.nzbs.org/browse?t=4050

The beta version is Newznab based, so coverage is likely already provided in LL. nzbs.org users should only need to configure beta.nzbs.org as their newznab provider in LL. Haven't gotten that far with LL yet to try it to make sure it works myself though.
The result is very dissapointing. It isn't harvesting from big binaries for ebooks-groups (a.b.ebooks for example. If I browse in that cat for all time I get around 300 results max (most of 'm german).
DedTV
Newbie
Newbie
Posts: 2
Joined: January 26th, 2012, 1:15 pm

Re: LazyLibrarian: Automate your ebook/author collection

Post by DedTV »

Mar2zz wrote:The result is very dissapointing. It isn't harvesting from big binaries for ebooks-groups (a.b.ebooks for example. If I browse in that cat for all time I get around 300 results max (most of 'm german).
Yeah, it's ebook support is not great ATM. They're only using the sources they have for the live site right now (it is still a beta) and as that doesn't cover ebooks at all, they've had no reason to crawl the ebook groups and their priority has been video and music groups thus far.
Currently I only use it for books because it does pull the results (for me it returns 1000, about 345 days worth) from the large meta groups (like a.b.0day.stuffz). It makes it a handy secondary source to get results from those groups without having to eat all the bandwidth crawling those groups with my local newsnab setup (which only crawls ebook groups and some specialty groups like a.b.cooking for use with SB) would require.

They've also been very good about making the site work well with automated scripts like SB, CP and Headphones. Now that there's one focused on books, it should help convince them to expand their coverage of the ebook groups in the future.
solotak
Newbie
Newbie
Posts: 2
Joined: March 13th, 2012, 4:16 am

Re: LazyLibrarian: Automate your ebook/author collection

Post by solotak »

Great stuff gonna try this out when i get the chance. Does it have support for magazines?
Post Reply