mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
commit
667d2c6a19
@ -822,7 +822,6 @@ application/x-lzh lzh
|
|||||||
application/x-lzx lzx
|
application/x-lzx lzx
|
||||||
application/x-maker book fb fbdoc fm frame frm maker
|
application/x-maker book fb fbdoc fm frame frm maker
|
||||||
application/x-mif mif
|
application/x-mif mif
|
||||||
application/x-mobipocket-ebook mobi prc
|
|
||||||
application/x-ms-application application
|
application/x-ms-application application
|
||||||
application/x-ms-wmd wmd
|
application/x-ms-wmd wmd
|
||||||
application/x-ms-wmz wmz
|
application/x-ms-wmz wmz
|
||||||
@ -1371,11 +1370,11 @@ application/x-sony-bbeb lrf lrx
|
|||||||
application/adobe-page-template+xml xpgt
|
application/adobe-page-template+xml xpgt
|
||||||
application/x-font-opentype otf
|
application/x-font-opentype otf
|
||||||
application/x-font-truetype ttf
|
application/x-font-truetype ttf
|
||||||
application/x-mobipocket-ebook mobi prc azw
|
application/x-mobipocket-ebook mobi prc
|
||||||
|
application/vnd.amazon.ebook azw3 azw azw2 azw4
|
||||||
application/x-cbz cbz
|
application/x-cbz cbz
|
||||||
application/x-cbr cbr
|
application/x-cbr cbr
|
||||||
application/x-cb7 cb7
|
application/x-cb7 cb7
|
||||||
application/x-koboreader-ebook kobo
|
application/x-koboreader-ebook kobo
|
||||||
image/wmf wmf
|
image/wmf wmf
|
||||||
application/ereader pdb
|
application/ereader pdb
|
||||||
|
|
||||||
|
@ -54,6 +54,16 @@ def guess_all_extensions(*args, **kwargs):
|
|||||||
_init_mimetypes()
|
_init_mimetypes()
|
||||||
return mimetypes.guess_all_extensions(*args, **kwargs)
|
return mimetypes.guess_all_extensions(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def guess_extension(*args, **kwargs):
|
||||||
|
import mimetypes
|
||||||
|
if not _mt_inited:
|
||||||
|
_init_mimetypes()
|
||||||
|
ext = mimetypes.guess_extension(*args, **kwargs)
|
||||||
|
if not ext and args and args[0] == 'application/x-palmreader':
|
||||||
|
ext = '.pdb'
|
||||||
|
return ext
|
||||||
|
|
||||||
def get_types_map():
|
def get_types_map():
|
||||||
import mimetypes
|
import mimetypes
|
||||||
if not _mt_inited:
|
if not _mt_inited:
|
||||||
|
@ -1351,6 +1351,15 @@ class StoreEbookscomStore(StoreBase):
|
|||||||
formats = ['EPUB', 'LIT', 'MOBI', 'PDF']
|
formats = ['EPUB', 'LIT', 'MOBI', 'PDF']
|
||||||
affiliate = True
|
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 StoreEBookShoppeUKStore(StoreBase):
|
# class StoreEBookShoppeUKStore(StoreBase):
|
||||||
# name = 'ebookShoppe UK'
|
# name = 'ebookShoppe UK'
|
||||||
# author = u'Charles Haley'
|
# author = u'Charles Haley'
|
||||||
@ -1645,6 +1654,7 @@ plugins += [
|
|||||||
StoreEbookNLStore,
|
StoreEbookNLStore,
|
||||||
StoreEbookpointStore,
|
StoreEbookpointStore,
|
||||||
StoreEbookscomStore,
|
StoreEbookscomStore,
|
||||||
|
# StoreEbooksGratuitsStore,
|
||||||
StoreEHarlequinStore,
|
StoreEHarlequinStore,
|
||||||
StoreEKnigiStore,
|
StoreEKnigiStore,
|
||||||
StoreEscapeMagazineStore,
|
StoreEscapeMagazineStore,
|
||||||
|
@ -13,7 +13,7 @@ from lxml import etree
|
|||||||
|
|
||||||
from PyQt4.Qt import QUrl
|
from PyQt4.Qt import QUrl
|
||||||
|
|
||||||
from calibre import browser
|
from calibre import (browser, guess_extension)
|
||||||
from calibre.gui2 import open_url
|
from calibre.gui2 import open_url
|
||||||
from calibre.gui2.store import StorePlugin
|
from calibre.gui2.store import StorePlugin
|
||||||
from calibre.gui2.store.search_result import SearchResult
|
from calibre.gui2.store.search_result import SearchResult
|
||||||
@ -81,7 +81,7 @@ class OpenSearchOPDSStore(StorePlugin):
|
|||||||
s.detail_item = href
|
s.detail_item = href
|
||||||
elif 'http://opds-spec.org/acquisition' in rel:
|
elif 'http://opds-spec.org/acquisition' in rel:
|
||||||
if type:
|
if type:
|
||||||
ext = mimetypes.guess_extension(type)
|
ext = guess_extension(type)
|
||||||
if ext:
|
if ext:
|
||||||
ext = ext[1:].upper().strip()
|
ext = ext[1:].upper().strip()
|
||||||
s.downloads[ext] = href
|
s.downloads[ext] = href
|
||||||
|
Loading…
x
Reference in New Issue
Block a user