mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Get books: Add ebooksgratuitis.com
This commit is contained in:
commit
64d3c6a307
@ -1351,15 +1351,15 @@ class StoreEbookscomStore(StoreBase):
|
||||
formats = ['EPUB', 'LIT', 'MOBI', 'PDF']
|
||||
affiliate = True
|
||||
|
||||
# class StoreEbooksGratuitsStore(StoreBase):
|
||||
# name = 'EbooksGratuits.com'
|
||||
# description = u''
|
||||
# actual_plugin = 'calibre.gui2.store.stores.ebooksgratuits_plugin:EbooksGratuitsStore'
|
||||
#
|
||||
# headquarters = 'FR'
|
||||
# formats = ['EPUB', 'MOBI', 'PDF', 'PDB']
|
||||
# drm_free_only = True
|
||||
#
|
||||
class StoreEbooksGratuitsStore(StoreBase):
|
||||
name = 'EbooksGratuits.com'
|
||||
description = u'Ebooks Libres et Gratuits'
|
||||
actual_plugin = 'calibre.gui2.store.stores.ebooksgratuits_plugin:EbooksGratuitsStore'
|
||||
|
||||
headquarters = 'FR'
|
||||
formats = ['EPUB', 'MOBI', 'PDF', 'PDB']
|
||||
drm_free_only = True
|
||||
|
||||
# class StoreEBookShoppeUKStore(StoreBase):
|
||||
# name = 'ebookShoppe UK'
|
||||
# author = u'Charles Haley'
|
||||
@ -1654,7 +1654,7 @@ plugins += [
|
||||
StoreEbookNLStore,
|
||||
StoreEbookpointStore,
|
||||
StoreEbookscomStore,
|
||||
# StoreEbooksGratuitsStore,
|
||||
StoreEbooksGratuitsStore,
|
||||
StoreEHarlequinStore,
|
||||
StoreEKnigiStore,
|
||||
StoreEscapeMagazineStore,
|
||||
|
29
src/calibre/gui2/store/stores/ebooksgratuits_plugin.py
Normal file
29
src/calibre/gui2/store/stores/ebooksgratuits_plugin.py
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||
|
||||
__license__ = 'GPL 3'
|
||||
__copyright__ = '2012, Florent FAYOLLE <florent.fayolle69@gmail.com>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from calibre.gui2.store.basic_config import BasicStoreConfig
|
||||
from calibre.gui2.store.opensearch_store import OpenSearchOPDSStore
|
||||
from calibre.gui2.store.search_result import SearchResult
|
||||
from calibre.utils.filenames import ascii_text
|
||||
|
||||
class EbooksGratuitsStore(BasicStoreConfig, OpenSearchOPDSStore):
|
||||
|
||||
open_search_url = 'http://www.ebooksgratuits.com/opds/opensearch.xml'
|
||||
web_url = 'http://www.ebooksgratuits.com/'
|
||||
|
||||
def strip_accents(self, s):
|
||||
return ascii_text(s)
|
||||
|
||||
def search(self, query, max_results=10, timeout=60):
|
||||
query = self.strip_accents(unicode(query))
|
||||
for s in OpenSearchOPDSStore.search(self, query, max_results, timeout):
|
||||
if s.downloads:
|
||||
s.drm = SearchResult.DRM_UNLOCKED
|
||||
s.price = '$0.00'
|
||||
yield s
|
||||
|
Loading…
x
Reference in New Issue
Block a user