Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
70c9dd1b
Commit
70c9dd1b
authored
Apr 08, 2020
by
xcffl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix opds format errors & extend info
parent
80753b11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
21 deletions
+27
-21
feed.xml
cps/templates/feed.xml
+11
-5
index.xml
cps/templates/index.xml
+16
-16
No files found.
cps/templates/feed.xml
View file @
70c9dd1b
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<feed
xmlns=
"http://www.w3.org/2005/Atom"
xmlns:dc
terms
=
"http://purl.org/dc/terms/"
>
<feed
xmlns=
"http://www.w3.org/2005/Atom"
xmlns:dc=
"http://purl.org/dc/terms/"
>
<id>
urn:uuid:2853dacf-ed79-42f5-8e8a-a7bb3d1ae6a2
</id>
<id>
urn:uuid:2853dacf-ed79-42f5-8e8a-a7bb3d1ae6a2
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<link
rel=
"self"
<link
rel=
"self"
...
@@ -49,18 +49,24 @@
...
@@ -49,18 +49,24 @@
</author>
</author>
{% endif %}
{% endif %}
{% if entry.publishers.__len__() > 0 %}
{% if entry.publishers.__len__() > 0 %}
<publisher>
<
dc:
publisher>
<name>
{{entry.publishers[0].name}}
</name>
<name>
{{entry.publishers[0].name}}
</name>
</publisher>
</dc:publisher>
{% endif %}
{% if entry.pubdate %}
<dc:issued>
{{entry.pubdate}}
</dc:issued>
{% endif %}
{% endif %}
{% for lang in entry.languages %}
{% for lang in entry.languages %}
<dc
terms:language>
{{lang.lang_code}}
</dcterms
:language>
<dc
:language>
{{lang.lang_code}}
</dc
:language>
{% endfor %}
{% endfor %}
{% for tag in entry.tags %}
{% for tag in entry.tags %}
<category
scheme=
"http://www.bisg.org/standards/bisac_subject/index.html"
<category
scheme=
"http://www.bisg.org/standards/bisac_subject/index.html"
term=
"{{tag.name}}"
term=
"{{tag.name}}"
label=
"{{tag.name}}"
/>
label=
"{{tag.name}}"
/>
{% endfor %}
{% endfor %}
{% for identifier in entry.identifiers %}
<dc:identifier>
{{identifier.val}}
</dc:identifier>
{% endfor %}
{% if entry.comments[0] %}
<summary>
{{entry.comments[0].text|striptags}}
</summary>
{% endif %}
{% if entry.comments[0] %}
<summary>
{{entry.comments[0].text|striptags}}
</summary>
{% endif %}
{% if entry.has_cover %}
{% if entry.has_cover %}
<link
type=
"image/jpeg"
href=
"{{url_for('opds.feed_get_cover', book_id=entry.id)}}"
rel=
"http://opds-spec.org/image"
/>
<link
type=
"image/jpeg"
href=
"{{url_for('opds.feed_get_cover', book_id=entry.id)}}"
rel=
"http://opds-spec.org/image"
/>
...
@@ -68,7 +74,7 @@
...
@@ -68,7 +74,7 @@
{% endif %}
{% endif %}
{% for format in entry.data %}
{% for format in entry.data %}
<link
rel=
"http://opds-spec.org/acquisition"
href=
"{{ url_for('opds.opds_download_link', book_id=entry.id, book_format=format.format|lower)}}"
<link
rel=
"http://opds-spec.org/acquisition"
href=
"{{ url_for('opds.opds_download_link', book_id=entry.id, book_format=format.format|lower)}}"
length=
"{{format.uncompressed_size}}"
mtime=
"{{entry.atom_timestamp}}"
type=
"{{format.format|lower|mimetype}}"
/>
length=
"{{format.uncompressed_size}}"
type=
"{{format.format|lower|mimetype}}"
/>
{% endfor %}
{% endfor %}
</entry>
</entry>
{% endfor %}
{% endfor %}
...
...
cps/templates/index.xml
View file @
70c9dd1b
...
@@ -15,28 +15,28 @@
...
@@ -15,28 +15,28 @@
</author>
</author>
<entry>
<entry>
<title>
{{_('Hot Books')}}
</title>
<title>
{{_('Hot Books')}}
</title>
<link
href=
"{{url_for('opds.feed_hot')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_hot')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=acquisition
"
/>
<id>
{{url_for('opds.feed_hot')}}
</id>
<id>
{{url_for('opds.feed_hot')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Popular publications from this catalog based on Downloads.')}}
</content>
<content
type=
"text"
>
{{_('Popular publications from this catalog based on Downloads.')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Top Rated Books')}}
</title>
<title>
{{_('Top Rated Books')}}
</title>
<link
href=
"{{url_for('opds.feed_best_rated')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_best_rated')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=acquisition
"
/>
<id>
{{url_for('opds.feed_best_rated')}}
</id>
<id>
{{url_for('opds.feed_best_rated')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Popular publications from this catalog based on Rating.')}}
</content>
<content
type=
"text"
>
{{_('Popular publications from this catalog based on Rating.')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Recently added Books')}}
</title>
<title>
{{_('Recently added Books')}}
</title>
<link
href=
"{{url_for('opds.feed_new')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_new')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=acquisition
"
/>
<id>
{{url_for('opds.feed_new')}}
</id>
<id>
{{url_for('opds.feed_new')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('The latest Books')}}
</content>
<content
type=
"text"
>
{{_('The latest Books')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Random Books')}}
</title>
<title>
{{_('Random Books')}}
</title>
<link
href=
"{{url_for('opds.feed_discover')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_discover')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=acquisition
"
/>
<id>
{{url_for('opds.feed_discover')}}
</id>
<id>
{{url_for('opds.feed_discover')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Show Random Books')}}
</content>
<content
type=
"text"
>
{{_('Show Random Books')}}
</content>
...
@@ -44,57 +44,57 @@
...
@@ -44,57 +44,57 @@
{% if not current_user.is_anonymous %}
{% if not current_user.is_anonymous %}
<entry>
<entry>
<title>
{{_('Read Books')}}
</title>
<title>
{{_('Read Books')}}
</title>
<link
href=
"{{url_for('opds.feed_read_books')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_read_books')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=acquisition
"
/>
<id>
{{url_for('opds.feed_read_books')}}
</id>
<id>
{{url_for('opds.feed_read_books')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Read Books')}}
</content>
<content
type=
"text"
>
{{_('
Show
Read Books')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Unread Books')}}
</title>
<title>
{{_('Unread Books')}}
</title>
<link
href=
"{{url_for('opds.feed_unread_books')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_unread_books')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=acquisition
"
/>
<id>
{{url_for('opds.feed_unread_books')}}
</id>
<id>
{{url_for('opds.feed_unread_books')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Unread Books')}}
</content>
<content
type=
"text"
>
{{_('
Show
Unread Books')}}
</content>
</entry>
</entry>
{% endif %}
{% endif %}
<entry>
<entry>
<title>
{{_('Authors')}}
</title>
<title>
{{_('Authors')}}
</title>
<link
href=
"{{url_for('opds.feed_authorindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_authorindex')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=acquisition
"
/>
<id>
{{url_for('opds.feed_authorindex')}}
</id>
<id>
{{url_for('opds.feed_authorindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Books ordered by Author')}}
</content>
<content
type=
"text"
>
{{_('Books ordered by Author')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Publishers')}}
</title>
<title>
{{_('Publishers')}}
</title>
<link
href=
"{{url_for('opds.feed_publisherindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_publisherindex')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=acquisition
"
/>
<id>
{{url_for('opds.feed_publisherindex')}}
</id>
<id>
{{url_for('opds.feed_publisherindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Books ordered by publisher')}}
</content>
<content
type=
"text"
>
{{_('Books ordered by publisher')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Categories')}}
</title>
<title>
{{_('Categories')}}
</title>
<link
href=
"{{url_for('opds.feed_categoryindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_categoryindex')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=acquisition
"
/>
<id>
{{url_for('opds.feed_categoryindex')}}
</id>
<id>
{{url_for('opds.feed_categoryindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Books ordered by category')}}
</content>
<content
type=
"text"
>
{{_('Books ordered by category')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Series')}}
</title>
<title>
{{_('Series')}}
</title>
<link
href=
"{{url_for('opds.feed_seriesindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_seriesindex')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=acquisition
"
/>
<id>
{{url_for('opds.feed_seriesindex')}}
</id>
<id>
{{url_for('opds.feed_seriesindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Books ordered by series')}}
</content>
<content
type=
"text"
>
{{_('Books ordered by series')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Languages')}}
</title>
<title>
{{_('Languages')}}
</title>
<link
href=
"{{url_for('opds.feed_languagesindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_languagesindex')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=acquisition
"
/>
<id>
{{url_for('opds.feed_languagesindex')}}
</id>
<id>
{{url_for('opds.feed_languagesindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Books ordered by Languages')}}
</content>
<content
type=
"text"
>
{{_('Books ordered by Languages')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Ratings')}}
</title>
<title>
{{_('Ratings')}}
</title>
<link
href=
"{{url_for('opds.feed_ratingindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_ratingindex')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=acquisition
"
/>
<id>
{{url_for('opds.feed_ratingindex')}}
</id>
<id>
{{url_for('opds.feed_ratingindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Books ordered by Rating')}}
</content>
<content
type=
"text"
>
{{_('Books ordered by Rating')}}
</content>
...
@@ -102,14 +102,14 @@
...
@@ -102,14 +102,14 @@
<entry>
<entry>
<title>
{{_('File formats')}}
</title>
<title>
{{_('File formats')}}
</title>
<link
href=
"{{url_for('opds.feed_formatindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_formatindex')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=navigation
"
/>
<id>
{{url_for('opds.feed_formatindex')}}
</id>
<id>
{{url_for('opds.feed_formatindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Books ordered by file formats')}}
</content>
<content
type=
"text"
>
{{_('Books ordered by file formats')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Shelves')}}
</title>
<title>
{{_('Shelves')}}
</title>
<link
href=
"{{url_for('opds.feed_shelfindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_shelfindex')}}"
type=
"application/atom+xml;profile=opds-catalog
;kind=navigation
"
/>
<id>
{{url_for('opds.feed_shelfindex')}}
</id>
<id>
{{url_for('opds.feed_shelfindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Books organized in shelves')}}
</content>
<content
type=
"text"
>
{{_('Books organized in shelves')}}
</content>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment