Skip to content

Commit

Permalink
fix: add if judgement for not intact text content in linovelib mobile…
Browse files Browse the repository at this point in the history
… traditional version
  • Loading branch information
wdpm committed Nov 2, 2024
1 parent ad3b456 commit 6b9677d
Show file tree
Hide file tree
Showing 4 changed files with 242 additions and 35 deletions.
155 changes: 155 additions & 0 deletions analyze/linovelib-mobile/mobile-version-text-not-intact.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<!DOCTYPE html>
<html lang="zh-Hant">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title> 女主角? 聖女? 不,我是全業女僕(自豪)! 第1章 序章 路多帕克家的大小姐以及萬能女僕 _ 嗶哩輕小說 </title>
<meta name="keywords"
content="女主角? 聖女? 不,我是全業女僕(自豪)!,序章 路多帕克家的大小姐以及萬能女僕,嗶哩輕小說"/>
<meta name="description" content=" 一个少女在乙女游戏世界中作为女主角(圣女)转生
『身为拯救世界圣女的女主角竟没出现! 但是魔王复活.."/>
<meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,user-scalable=yes,width=device-width"/>
<meta name="theme-color" content="#232323" media="(prefers-color-scheme: dark)"/>
<meta name="applicable-device" content="mobile"/>
<link rel="stylesheet" href="https://tw.linovelib.com/themes/zhmb/css/read.css?v0514a2">
<link rel="stylesheet" href="https://tw.linovelib.com/themes/zhmb/css/chapter.css?v1126a3">
<link rel="dns-preconnect" href="https://tw.linovelib.com">
<link rel="prerender" href="https://tw.linovelib.com/novel/4126/236196_2.html">
<link rel="alternate" hreflang="zh-Hans" href="https://www.bilinovel.com/novel/4126/236196.html"/>
<script src="https://tw.linovelib.com/themes/zhmb/js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="/scripts/darkmode.js"></script>
<script async src="https://tw.linovelib.com/themes/zhmb/js/lazysizes.min.js"></script>
<script src="https://tw.linovelib.com/scripts/common.js?v505a3"></script>
<script src="https://tw.linovelib.com/scripts/zation.js?v1018a1"></script>
<script src="https://tw.linovelib.com/themes/zhmb/js/jquery.lazyload.js"></script>
<script type="text/javascript">
var ual = navigator.language.toLowerCase();if(ual == 'zh-cn'){window.location.replace("https://w.linovelib.com/novel/4126/236196.html");}
</script>
</head>
<body id="aread">
<script type="text/javascript">
var ReadParams={url_previous:'/novel/4126/236195.html',url_next:'/novel/4126/236196_2.html',url_index:'/novel/4126/catalog',url_articleinfo:'/novel/4126.html',url_image:'https://tw.linovelib.com/files/article/image/4/4126/4126s.jpg',url_home:'https://tw.linovelib.com/',articleid:'4126',articlename:'女主角? 聖女? 不,我是全業女僕(自豪)!',subid:'/4',author:'あてきち',chapterid:'236196',page:'1',chaptername:'第1章 序章 路多帕克家的大小姐以及萬能女僕',chapterisvip:'0',userid:'0',readtime:'1730557711'}
</script>
<div class="main">
<div id="abox" class="abox">
<div id="apage" class="apage">
<div class="atitle">
<h1 id="atitle"> 序章 路多帕克家的大小姐以及萬能女僕 </h1>
<h3> 第1章 </h3></div>
<div id="acontent1" class="acontent">
<p>「歡迎光臨」</p>
<br>
<p> 面對來訪的兩個少女,黑髮嬌小的女僕彬彬有禮地鞠躬。</p>
<p> 然而,少女們並未注意到女僕,而是看著所謂的宅邸的玄關,露出驚愕的表情。</p>
<br>
<p>「這是露西亞娜家的宅邸?」</p>
<p>「咦?真的嗎?因為,之前來訪的時候更……」</p>
<br>
<p> 兩個少女感到驚訝也是無可厚非的。</p>
<p> 這是她們第二次拜訪這座宅邸。但是,那時候更……</p>
<br>
<p>「更骯髒破舊嗎?」</p>
<p>「「露西亞娜!」」</p>
<br>
<p> 從宅邸深處走出一名少女。穿著一件嫩草色的洋裝,金髮碧眼的她,以優雅的舉止走到了門廳等待的少女們身旁。</p>
<p> 黑髮的女僕輕盈地退到一旁,靜靜地站在宅邸主人的身後。</p>
<br>
<p>「歡迎,貝亞朵莉絲,蜜莉亞莉雅。謝謝你們今天到訪。」</p>
<br>
<p> 面對微笑著的少女,被邀請的兩位少女,貝亞朵莉絲和蜜莉亞莉雅,露出了更加驚訝的表情。</p>
<br>
<p>「露西亞娜,你……」</p>
<p>「……你怎麼變得如此美麗,露西亞娜。」</p>
<br>
<p>
兩個少女無法掩飾自己的驚訝。因為站在她們面前的人,露西亞娜・路多帕克伯爵千金的容貌,站姿,都是如此美麗。</p>
<br>
<p>
她原本就擁有美麗的外貌。然而,雖然是伯爵家,但她的家族卻是聞名的沒落貴族。連傭人都沒錢僱用,更不用說維持宅邸和讓她穿著華麗了,只是個名存實亡的貧窮貴族。</p>
<p>
儘管如此,出現在眼前的少女美麗得難以形容。相隔兩周再次見面的露西亞娜,從頭到腳都展現出真正的伯爵千金的風采。</p>
<br>
<p>
原本素材美麗的未得到妥善的照顧的頭髮,現在,每一根都得到了精心的呵護,光彩奪目。腰間長長的金色頭髮在後腦勺部分編織起來,走路時波浪狀的髮絲輕輕地跳舞著圓舞曲。</p>
<br>
<p>
曾經因為沒有得到足夠照顧而變得粗糙的白皙肌膚,現在已變得與年齡相稱的潤澤美麗。她那白皙的肌膚、淡淡的薄桃色雙唇,在清純中透露著少女的嫵媚。</p>
<br>
<p> 有著一對碧眼的露西亞娜,在貝亞朵莉絲和蜜莉亞莉雅面前,以優美的姿態輕輕拾起裙擺,慢慢地彎膝鞠躬。</p>
<br>
<p>「歡迎至我家來訪,非常感謝。」</p>
<br>
<p> 這是非常優雅的行禮。</p>
<p> 貝亞朵莉絲和蜜莉亞莉雅對她優雅的動作感嘆不已。</p>
<p> 很難相信她們同齡。從未想過她變得如此美麗。</p>
<br>
<p>「梅洛蒂,我們要去露台,請為我們準備茶點。」</p>
<p>「遵命,大小姐。」</p>
<br>
<p> 當露西亞娜微笑著對黑髮的女僕梅洛蒂提出要求時,她優雅地行禮微笑著離開。</p>
<br>
<p>「來,我們走吧。」</p>
<br>
<p> 在露西亞娜的帶領下,貝亞朵莉絲和蜜莉亞莉雅前往露台。在此期間,她們都被露西亞娜和宅邸的美麗所吸引。</p>
<p> 再次看著宅邸,毫無疑問這裡正是她們之前拜訪過的地方。身為伯爵家的宅邸規模較小,擺設並不豪華。……(內容加載失敗!請重載或更換瀏覽器)<br><br>
<center style="color:red;">【手機版頁面由於相容性問題暫不支持電腦端閱讀,請使用手機閱讀。】</center>
<div class="cgo">
<script>zation();</script>
<script async src="https://fundingchoicesmessages.google.com/i/pub-5520793375276242?ers=1"
nonce="woTUo9qj1HYeLZtw0esVrA"></script>
<script nonce="woTUo9qj1HYeLZtw0esVrA">
(function() {function signalGooglefcPresent() {if (!window.frames['googlefcPresent']){if (document.body) {const iframe = document.createElement('iframe'); iframe.style = 'width: 0; height: 0; border: none; z-index: -1000; left: -1000px; top: -1000px;'; iframe.style.display = 'none'; iframe.name = 'googlefcPresent'; document.body.appendChild(iframe);} else {setTimeout(signalGooglefcPresent, 0);}}}signalGooglefcPresent();})();
</script>
</div>
</div>
</div>
</div>
<div id="toptext" class="toptext" style="display:none;"></div>
<div id="bottomtext" class="bottomtext" style="display:none;"></div>
<div id="operatetip" class="operatetip" style="display:none;" onclick="this.style.display='none';">
<div class="tipl"><p> 翻上頁 </p></div>
<div class="tipc"><p> 呼出功能 <br><small> 漫畫&插圖 <br> 建議使用上下翻頁
</small><br><br><small>【翻頁模式】章評·暫時隱藏 </small></p></div>
<div class="tipr"><p> 翻下頁 </p></div>
</div>
</div>
<div id="footlink" class="footlink"><a onclick="window.location.href = ReadParams.url_previous;"> 上一章 </a><a
onclick="window.location.href = ReadParams.url_index;"> 目錄 </a><a
onclick="window.location.href = ReadParams.url_articleinfo;"> 書頁 </a><a
onclick="window.location.href = ReadParams.url_next;"> 下一頁 </a></div>

<script>
$(document).ready(function(){var prevpage="/novel/4126/236195.html";var nextpage="/novel/4126/236196_2.html";var bookpage="/novel/4126.html";$("body").keydown(function(event){var isInput=event.target.tagName==='INPUT'||event.target.tagName==='TEXTAREA';if(!isInput){if(event.keyCode==37){location=prevpage}else if(event.keyCode==39){location=nextpage}}})});
</script>
<script type="text/javascript" src="https://tw.linovelib.com/themes/zhmb/js/readtools.js?v1011a1"></script>
<script type="text/javascript" src="https://tw.linovelib.com/scripts/json2.js"></script>
<script type="text/javascript" src="https://tw.linovelib.com/themes/zhmb/js/chapterlog.js?v1006a1"></script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?1251eb70bc6856bd02196c68e198ee56";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-NG72YQN6TX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-NG72YQN6TX');
</script>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistrations().then(function(registrations) {
for (let registration of registrations) {
registration.unregister();
}
});
}
</script>
<script>
(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'8dc4cfbfe942845e',t:'MTczMDU1NzcxMS4wMDAwMDA='};var a=document.createElement('script');a.nonce='';a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();
</script>
</body>
</html>
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ classifiers = [
# alternatives: use hatch plugin to read requirement.txt
# now is manual work
dependencies = [
'setuptools',
'bs4>=0.0.1',
'demjson3>=3.0.5',
'EbookLib>=0.17.1',
Expand All @@ -46,10 +47,10 @@ dependencies = [
'pillow>=11.0.0',
'inquirer>=3.1.2',
'aiofiles>=23.1.0',
'aiohttp>=3.8.4',
'aiohttp>=3.10.2',
'dynaconf>=3.2.3',
'brotli>=1.1.0',
'lxml>=4.9.2',
'lxml>=5.3.0',
'tabulate>=0.9.0',
'DrissionPage>=4.0.4.5',
'selenium>=4.17.2',
Expand Down
18 changes: 15 additions & 3 deletions src/linovelib2epub/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ class LinovelibException(Exception):
pass

class PageContentAbnormalException(LinovelibException):
def __init__(self, message="Page content is abnormal."):
self.message = message
super().__init__(self.message)
def __init__(self, message="Page content is abnormal"):
super().__init__(message)


class EmptyTitleError(LinovelibException):
def __init__(self, message = "The book title is empty"):
super().__init__(message)

class EmptyArticleError(LinovelibException):
def __init__(self, message = "The article tag can't be found"):
super().__init__(message)

class NotIntactTextError(LinovelibException):
def __init__(self, message="The text content is not intact"):
super().__init__(message)
Loading

0 comments on commit 6b9677d

Please sign in to comment.