dteviot / WebToEpub

A simple Chrome (and Firefox) Extension that converts Web Novels (and other web pages) into an EPUB.
Other
730 stars 139 forks source link

hello! pls add site >> https://gratuit-4049025.webador.com/ #1225

Closed plsbenice-immadeofjelly closed 8 months ago

plsbenice-immadeofjelly commented 8 months ago

Provide URL for web page that contains Table of Contents (list of chapters) of a typical story on the site

https://gratuit-4049025.webador.com/on-going-novels/everyday-the-demon-lord-is-escaping-his-marriage

Did you try using the Default Parser for the site? If not, why not?

I did try this method, but the CSS Selectors seem to be inconstant and the selectors for the "heading" and "body content" changes for every single individual chapter, meaning the content had to be manually selected for each chapter. And using the whole element (i.e. main, div, etc) or a specific attribute (.content) instead pulled in too much unnecessary source data.

I'm new here so I'm not sure how to go about asking for the new addition of a site, so I understand that my request may go unanswered. But, thank you for considering it and for all the effort put into maintaining this extension.

dteviot commented 8 months ago

@plsbenice-immadeofjelly

Using "main" for the content body looks like it will do a reasonable job for chapters 1 and 3.

plsbenice-immadeofjelly commented 8 months ago

Hello! Although I inputted the "main" element to select the [body content], the output was extremely cluttered at both the beginning and end of all xhtml files... This is how it appears for all files (beware of incoming large wall of text since there's too many tags from the source data pulled in):

Beginning of xhtml file:

</head><body>
    <div data-section-name="content" class="jw-section jw-section-content jw-responsive">
        <div class="jw-strip-root"><div class="jw-strip jw-strip--color-default jw-strip--default jw-strip--padding-both jw-node-is-first-child jw-node-is-last-child"><div id="jw-element-257413816" data-jw-element-id="257413816" class="jw-tree-node jw-element jw-simple-root jw-tree-container jw-node-is-first-child jw-node-is-last-child jw-strip__content jw-responsive">

<div id="jw-element-257413817" data-jw-element-id="257413817" class="jw-tree-node jw-element jw-image-text jw-node-is-first-child">
    <div class="jw-element-imagetext-text">
            <h1 class="jw-heading-70">EDLEM- Chapter 1 - Delaying you for a lifetime.</h1>    </div>
</div><div id="jw-element-257413818" data-jw-element-id="257413818" class="jw-tree-node jw-element jw-image-text">
    <div class="jw-element-imagetext-text">

Bottom of xhtml file:

<p><span><em>Translator : DarNan</em></span></p>    </div>
</div><div id="jw-element-257413820" data-jw-element-id="257413820" class="jw-tree-node jw-element jw-columns jw-tree-container jw-tree-horizontal">
    <div id="jw-element-257413823" data-jw-element-id="257413823" style="width: 50%" class="jw-tree-node jw-element jw-column jw-tree-container jw-node-is-first-child jw-responsive lt540 lt600 lt640 lt800">
    <div id="jw-element-257413826" data-jw-element-id="257413826" class="jw-tree-node jw-element jw-button jw-node-is-first-child jw-node-is-last-child">
    <div class="jw-btn-container jw-btn-is-left">

                        <div class="jw-btn-caption">
                Back to description            </div>

    </div>
</div></div><div id="jw-element-257413824" data-jw-element-id="257413824" style="width: 50%" class="jw-tree-node jw-element jw-column jw-tree-container jw-node-is-last-child jw-responsive lt540 lt600 lt640 lt800">
    <div id="jw-element-257413827" data-jw-element-id="257413827" class="jw-tree-node jw-element jw-button jw-node-is-first-child jw-node-is-last-child">
    <div class="jw-btn-container jw-btn-is-left">

                        <div class="jw-btn-caption">
                Next chapter            </div>

    </div>
</div></div></div></div></div></div>        <div class="jw-strip jw-strip--color-default jw-strip--default jw-strip--padding-end"><div class="jw-strip__content jw-responsive">    <div class="jw-element-ads js-ads jw-element-ads-WebsiteRenderingSignup jw-element-ads--tint jw-element-ads--logo">
        <div class="jw-comment">
            <h1>
                Create Your Own Website With <a href="https://www.webador.com/?utm_source=sites&amp;utm_medium=banner&amp;utm_content=logo%2Btint&amp;utm_campaign=house%20banner%20webador" rel="nofollow"><span class="sr-only">Webador</span><svg xmlns="http://www.w3.org/2000/svg" width="150" height="32" fill="none"><path fill="#FFC814" fill-rule="evenodd" d="M26.7031 27.8932C25.0458 28.3613 23.2972 28.6118 21.4901 28.6118C17.8893 28.6118 14.5207 27.6173 11.644 25.8879C19.9275 22.0923 26.0947 14.475 27.8892 5.2926C30.4445 8.12812 31.9999 11.8824 31.9999 16C31.9999 20.7211 29.9552 24.9646 26.7031 27.8932Z" clip-rule="evenodd"/><path fill="#479FD6" fill-rule="evenodd" d="M27.8931 5.29691C28.3612 6.95416 28.6117 8.70271 28.6117 10.5098C28.6117 14.1107 27.6172 17.4793 25.8878 20.3559C22.0922 12.0725 14.4749 5.90522 5.29248 4.11071C8.12803 1.5554 11.8823 1.79984e-07 15.9999 0C20.721 -2.06369e-07 24.9645 2.04472 27.8931 5.29691Z" clip-rule="evenodd"/><path fill="#ED1C24" fill-rule="evenodd" d="M5.29688 4.10677C6.95413 3.63866 8.70271 3.38818 10.5098 3.38818C14.1107 3.38818 17.4793 4.38269 20.3559 6.11204C12.0725 9.90768 5.90519 17.525 4.11071 26.7074C1.5554 23.8719 1.79987e-07 20.1175 0 15.9999C-2.06362e-07 11.2789 2.04472 7.0354 5.29688 4.10677Z" clip-rule="evenodd"/><path fill="#8CC63F" fill-rule="evenodd" d="M4.10677 26.7032C3.63866 25.0459 3.38818 23.2973 3.38818 21.4903C3.38818 17.8894 4.38269 14.5208 6.11204 11.6442C9.90768 19.9276 17.525 26.0949 26.7074 27.8893C23.8719 30.4447 20.1175 32.0001 15.9999 32.0001C11.2789 32.0001 7.0354 29.9553 4.10677 26.7032Z" clip-rule="evenodd"/><path fill="#FFC814" fill-rule="evenodd" d="M20.0628 20.0128C17.6466 22.4424 14.7988 24.4423 11.644 25.8878C14.5207 27.6172 17.8893 28.6117 21.4901 28.6117C23.2972 28.6117 25.0458 28.3612 26.7031 27.8931C27.2335 27.4154 27.7318 26.9028 28.1944 26.3588L20.0628 20.0128Z" clip-rule="evenodd"/><path fill="url(#a)" fill-rule="evenodd" d="M14.9572 3.90759C16.8864 4.36673 18.7024 5.11798 20.3559 6.11198C15.5955 8.29329 11.534 11.7367 8.59972 16.0141C7.649 14.6395 6.81499 13.1781 6.11206 11.644C8.16762 8.22474 11.2614 5.50057 14.9572 3.90759Z" clip-rule="evenodd"/><path fill="url(#b)" fill-rule="evenodd" d="M28.0923 14.9572C27.6332 16.8864 26.8819 18.7024 25.8879 20.3559C23.7066 15.5955 20.2632 11.534 15.9858 8.59972C17.3604 7.64897 18.8218 6.81499 20.3559 6.11206C23.7752 8.16762 26.4993 11.2614 28.0923 14.9572Z" clip-rule="evenodd"/><path fill="url(#c)" fill-rule="evenodd" d="M17.0427 28.0922C15.1135 27.633 13.2975 26.8818 11.644 25.8878C16.4044 23.7065 20.4659 20.263 23.4002 15.9857C24.3509 17.3603 25.1849 18.8217 25.8878 20.3558C23.8323 23.775 20.7385 26.4992 17.0427 28.0922Z" clip-rule="evenodd"/><path fill="url(#d)" fill-rule="evenodd" d="M3.90771 17.0428C4.36685 15.1136 5.1181 13.2976 6.11211 11.6442C8.29338 16.4045 11.7369 20.466 16.0142 23.4003C14.6396 24.351 13.1782 25.185 11.6441 25.888C8.22486 23.8324 5.50069 20.7386 3.90771 17.0428Z" clip-rule="evenodd"/><path fill="currentColor" d="M55.416 23.5L59.532 9.976H55.836L53.316 19.076L50.348 9.976H47.184L44.216 19.076L41.696 9.976H38L42.116 23.5H45.924L48.78 14.288L51.636 23.5H55.416ZM67.6395 23.836C69.7395 23.836 71.8675 23.192 73.2115 21.96L71.6435 19.664C70.7755 20.504 69.1795 21.008 68.0315 21.008C65.7355 21.008 64.3635 19.58 64.1395 17.872H74.1915V17.088C74.1915 12.664 71.4475 9.64 67.4155 9.64C63.2995 9.64 60.4155 12.804 60.4155 16.724C60.4155 21.064 63.5235 23.836 67.6395 23.836ZM70.7475 15.464H64.0835C64.2515 14.12 65.2035 12.468 67.4155 12.468C69.7675 12.468 70.6635 14.176 70.7475 15.464ZM80.3161 19.16V14.372C80.9041 13.476 82.2201 12.804 83.3681 12.804C85.4401 12.804 86.8121 14.4 86.8121 16.752C86.8121 19.104 85.4401 20.672 83.3681 20.672C82.2201 20.672 80.9041 20.028 80.3161 19.16ZM80.3161 23.5V21.764C81.3801 23.108 82.8641 23.836 84.4881 23.836C87.9041 23.836 90.4801 21.26 90.4801 16.752C90.4801 12.328 87.9321 9.64 84.4881 9.64C82.8921 9.64 81.3801 10.34 80.3161 11.712V4.824H76.7601V23.5H80.3161ZM104.842 23.5V14.764C104.842 10.872 102.014 9.64 98.9343 9.64C96.8063 9.64 94.6783 10.312 93.0263 11.768L94.3703 14.148C95.5183 13.084 96.8623 12.552 98.3183 12.552C100.11 12.552 101.286 13.448 101.286 14.82V16.64C100.39 15.576 98.7943 14.988 97.0023 14.988C94.8463 14.988 92.2983 16.192 92.2983 19.356C92.2983 22.38 94.8463 23.836 97.0023 23.836C98.7663 23.836 100.362 23.192 101.286 22.1V23.5H104.842ZM98.4303 21.428C97.0303 21.428 95.8823 20.7 95.8823 19.44C95.8823 18.124 97.0303 17.396 98.4303 17.396C99.5783 17.396 100.698 17.788 101.286 18.572V20.252C100.698 21.036 99.5783 21.428 98.4303 21.428ZM121.249 23.5V4.824H117.665V11.712C116.601 10.34 115.089 9.64 113.493 9.64C110.049 9.64 107.501 12.328 107.501 16.752C107.501 21.26 110.077 23.836 113.493 23.836C115.117 23.836 116.601 23.108 117.665 21.764V23.5H121.249ZM114.585 20.672C112.569 20.672 111.169 19.076 111.169 16.752C111.169 14.4 112.569 12.804 114.585 12.804C115.789 12.804 117.077 13.448 117.665 14.344V19.132C117.077 20.028 115.789 20.672 114.585 20.672ZM131.048 23.836C135.528 23.836 138.216 20.588 138.216 16.724C138.216 12.888 135.528 9.64 131.048 9.64C126.596 9.64 123.908 12.888 123.908 16.724C123.908 20.588 126.596 23.836 131.048 23.836ZM131.048 20.672C128.836 20.672 127.604 18.852 127.604 16.724C127.604 14.624 128.836 12.804 131.048 12.804C133.26 12.804 134.52 14.624 134.52 16.724C134.52 18.852 133.26 20.672 131.048 20.672ZM144.41 23.5V14.568C144.998 13.7 146.566 13.028 147.742 13.028C148.134 13.028 148.47 13.056 148.722 13.112V9.64C147.042 9.64 145.362 10.62 144.41 11.824V9.976H140.854V23.5H144.41Z"/><defs><linearGradient id="a" x1="16.456" x2="7.867" y1="5.979" y2="15.009" gradientUnits="userSpaceOnUse"><stop stop-color="#ED1C24"/><stop offset=".348" stop-color="#EA1B23"/><stop offset=".557" stop-color="#E2171E"/><stop offset=".73" stop-color="#D41116"/><stop offset=".882" stop-color="#C0090C"/><stop offset="1" stop-color="#A00"/></linearGradient><linearGradient id="b" x1="25.998" x2="17.408" y1="16.647" y2="7.837" gradientUnits="userSpaceOnUse"><stop stop-color="#479FD6"/><stop offset=".393" stop-color="#459DD3"/><stop offset=".629" stop-color="#3E95CB"/><stop offset=".823" stop-color="#3388BD"/><stop offset=".995" stop-color="#2476A9"/><stop offset="1" stop-color="#2375A8"/></linearGradient><linearGradient id="c" x1="16.372" x2="23.861" y1="25.853" y2="16.162" gradientUnits="userSpaceOnUse"><stop stop-color="#FFC814"/><stop offset=".348" stop-color="#FEC513"/><stop offset=".557" stop-color="#FABD11"/><stop offset=".73" stop-color="#F4AF0C"/><stop offset=".882" stop-color="#EC9B06"/><stop offset="1" stop-color="#E38500"/></linearGradient><linearGradient id="d" x1="6.094" x2="15.234" y1="15.915" y2="24.064" gradientUnits="userSpaceOnUse"><stop stop-color="#8CC63F"/><stop offset=".38" stop-color="#8AC33D"/><stop offset=".609" stop-color="#82BB37"/><stop offset=".797" stop-color="#75AD2C"/><stop offset=".963" stop-color="#63991D"/><stop offset="1" stop-color="#5E9319"/></linearGradient></defs></svg>
</a>            </h1>
        </div>
            </div>
</div></div>    </div></body></html>

To answer your first question, I think selecting the "main" tag does work universally for all novels on the source but the output is just extremely messy, as shown above. I think I read about your ePubEditor too (from previous issues prior to opening this issue in order to see if I could find a workaround myself first) and although I did try it out, the result was not as cleanly done as wanted, so I was hoping for an in-built parser that would circumvent this issue instead, for convenience, if that's okay. Although, if this proves to be too time-consuming, I completely understand if you'd prefer not to do this. Regardless, thank you for answering my request (and for the quick completed fix on my second open issue)!

ImLJS commented 8 months ago

Use ".jw-strip-root" as value for "(required) CSS selector for element holding content to put into EPUB:".

plsbenice-immadeofjelly commented 8 months ago

Use ".jw-strip-root" as value for "(required) CSS selector for element holding content to put into EPUB:".

Thank you for the much appreciated help!! That worked well~!

I'm not sure if this will be merged into the extension, so I'll just close this issue since it's been resolved :)