Skip to content
Snippets Groups Projects
Commit cd933fff authored by John Xina's avatar John Xina
Browse files

add title to articles, and fix rare crashes with preprocessing

parent fd2290ef
Branches
Tags v2.0
No related merge requests found
......@@ -47,15 +47,21 @@ def article_to_html(article_text):
continue
if child.name == 'a':
if 'href' not in child:
continue
child['href'] = child['href'].split('//')[1].strip('www.bilibili.com')
continue
elif child.name == 'img':
if appconf['proxy']['image']:
child['src'] = '/proxy/pic/' + child['data-src'].split('//')[1]
else:
child['src'] = child['data-src']
del child['data-src']
del child['data-size']
try:
if appconf['proxy']['image']:
child['src'] = '/proxy/pic/' + child['data-src'].split('//')[1]
else:
child['src'] = child['data-src']
del child['data-src']
del child['data-size']
except:
pass
continue
elif child.name == 'span' and not child.parent in purge_elems:
purge_elems.append(child.parent)
......
......@@ -3,7 +3,7 @@
{% block head %}
<link rel="alternate" href="https://www.bilibili.com/read/{{ cid }}">
<meta name="referrer" content="never">
<title>专栏 - MikuInvidious</title>
<title>{{ arinfo['title'] }} - 专栏 - MikuInvidious</title>
<style>
@media only screen and (min-width: 600px) {
figure > img {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment