Package: webcomix
webcomixDescriptionwebcomix is a webcomic downloader that can additionally create a .cbz (Comic Book ZIP) file once downloaded.NoticeThis program is for personal use only. Please be aware that by making the downloaded comics publicly available without the permission of the author, you may be infringing upon various copyrights.InstallationDependenciesPython (3.8 or newer)clickscrapy (Some additional steps might be required to include this package and can be foundhere)scrapy-splashscrapy-fake-useragenttqdmDocker(To be able to download JavaScript-dependent websites with-joption)ProcessEnd userInstallPython 3Install the command line interface tool withpip install webcomixDeveloperInstallPython 3Clone this repository and open a terminal in its directoryInstallpoetrywithpip install poetryDownload the dependencies by runningpoetry installInstall pre-commit hooks withpre-commit installUsagewebcomix [OPTIONS] COMMAND [ARGS]Global FlagshelpShow the help message and exit.VersionShow the version number and exit.CommandscomicsShows all predefined comics which can be used with thedownloadcommand.downloadDownloads a predefined comic. Supports the--cbzflag, which creates a .cbz archive of the downloaded comic.searchSearches for an XPath that can download the whole comic. Supports the--cbzflag, which creates a .cbz archive of the downloaded comic,-s, which verifies only the provided page of the comic,-y, which skips the verification prompt, and-j, which runs the javascript on pages before downloading.customDownloads a user-defined comic. To download a specific comic, you'll need a link to the first page, an XPath expression giving out the link to the next page and an XPath expression giving out the link to the image. More infohere. Supports the--cbzflag, which creates a .cbz archive of the downloaded comic,-s, which verifies only the provided page of the comic, and-y, which skips the verification prompt.Exampleswebcomix download xkcdwebcomix search xkcd --start-url=http://xkcd.com/1/webcomix custom --cbz(You will be prompted about other needed arguments)webcomix custom xkcd --start-url=http://xkcd.com/1/ --next-page-xpath="//a[@rel='next']/@href" --image-xpath="//div[@id='comic']//img/@src" --cbz(Same as before, but with all arguments declared beforehand)Making an XPath selectorUsing an HTML inspector, spot a html path to the next link'shrefattribute/comic image'ssrcattribute.e.g.://div[@class='foo']/img/@srcThis will select the src attribute of the first image whose class is: fooNote:webcomixworks best on static websites, sincescrapy(the framework we use to travel web pages) doesn't process Javascript.To make sure your XPath is correct, you have to go intoscrapy shell, which should be downloaded when you've installedwebcomix.scrapy shell <website> --> Use the website's url to go to it.
> response.body --> Will give you the html from the website.
> response.xpath --> Test an xpath selection. If you get [], this means your XPath expression hasn't gotten anything from the webpage.ContributionThe procedure depends on the type of contribution:If you simply want to request the addition of a comic to the list of supported comics, make an issue with the label "Enhancement".If you want to request the addition of a feature to the system or a bug fix, make an issue with the appropriate label.Running the testsTo run the tests, you have to use thepytestcommand in the webcomix folder.