~q3cpma/mangadex-tools

Tcl tools to interact with mangadex.org

2c97154 Don't redownload all pages when switching to fallback server

13 days ago

cdbd702 Use fallback server in case of failure

13 days ago
                        Mangadex tools
                        ==============

        Overview
        --------

Some useful tools to interface with Mangadex via its JSON API:

* mangadex_dl.tcl
+-------------------------------------------------------------------------+
| NAME                                                                    |
|     mangadex_dl.tcl - download Mangadex chapters                        |
|                                                                         |
| SYNOPSIS                                                                |
|     mangadex_dl.tcl [OPTIONS] SERIE_URL [CHAPTER...]                    |
|                                                                         |
| DESCRIPTION                                                             |
|     Download each of the specified chapters into its own properly named |
|     directory. If no chapter is specified, download all of them.        |
|                                                                         |
| OPTIONS                                                                 |
|     -help                                                               |
|         Print this help message and exit.                               |
|                                                                         |
|     -proxy PROXY_URL                                                    |
|         Set the curl HTTP/HTTPS proxy.                                  |
|                                                                         |
|     -lang LANG_CODE                                                     |
|         Only download chapters in this language.                        |
|         Defaults to "gb".                                               |
|                                                                         |
|     -covers                                                             |
|         Download the serie covers too.                                  |
|                                                                         |
+-------------------------------------------------------------------------+

* mangadex_monitor.tcl
+---------------------------------------------------------------------------+
| NAME                                                                      |
|     mangadex_monitor.tcl - monitor Mangadex series                        |
|                                                                           |
| SYNOPSIS                                                                  |
|     mangadex_monitor.tcl [OPTIONS] CATALOG                                |
|                                                                           |
| DESCRIPTION                                                               |
|     Read series to monitor from CATALOG, a file containing a Tcl list     |
|     using the following syntax:                                           |
|         {serie_url ?option value? ...} ...                                |
|                                                                           |
|     with the following options available:                                 |
|         autodl                                                            |
|             If value is 1, new chapters for this serie are downloaded to  |
|             the directory specified via the -autodl-dir option. If the    |
|             -autodl option is set, using a value of 0 disables it.        |
|                                                                           |
|         group                                                             |
|             Only download chapters having the value matching one of their |
|             group names.                                                  |
|                                                                           |
|         title                                                             |
|             Use this title instead of the Mangadex provided one.          |
|                                                                           |
|     For each serie, an Atom feed is created next to the given CATALOG     |
|     file and updated for each new chapter.                                |
|     A database holding the last timestamp for each catalog entry is also  |
|     created at the same place.                                            |
|                                                                           |
| OPTIONS                                                                   |
|     -help                                                                 |
|         Print this help message and exit.                                 |
|                                                                           |
|     -proxy PROXY_URL                                                      |
|         Set the curl HTTP/HTTPS proxy.                                    |
|                                                                           |
|     -lang LANG_CODE                                                       |
|         Only monitor chapters in this language.                           |
|         Defaults to "gb".                                                 |
|                                                                           |
|     -autodl                                                               |
|         Set the "autodl" option for every serie.                          |
|                                                                           |
|     -autodl-dir DIRECTORY                                                 |
|         Where to auto download new chapters.                              |
|         Defaults to the same directory as CATALOG.                        |
|                                                                           |
|     -single-feed                                                          |
|         Use a single feed instead of one per serie.                       |
|                                                                           |
+---------------------------------------------------------------------------+


        Examples
        --------

Download all the english chapters of Grappler Baki:
    $ mangadex_dl.tcl https://mangadex.org/title/2434/grappler-baki

Idem but only the chapters 11 and 12, using a proxy:
    $ mangadex_dl.tcl -proxy socks5h://localhost:9050 https://mangadex.org/title/2434/grappler-baki 11 12

Monitoring example:
    $ ls
    catalog.tcllist
    $ cat catalog.tcllist
    {https://mangadex.org/title/2434/grappler-baki autodl 1 title "Baki the Grappler" group "TheSpinyBackTeam"}
    {https://mangadex.org/title/30907/baki-dou-2018 autodl 1}
    $ mangadex_monitor.tcl -autodl-dir ~/Mangos/autodl catalog.tcllist
    ...
    $ ls
    Baki Dou (2018)_30907.xml
    Baki the Grappler_2434.xml
    catalog.tcllist
    timestamps.tcldict

Idem using a single feed:
    $ mangadex_monitor.tcl -single-feed -autodl-dir ~/Mangos/autodl catalog.tcllist
    ...
    $ ls
    catalog.tcllist
    mangadex.xml
    timestamps.tcldict


        Dependencies
        ------------

* Tcl 8.6
* tcllib (json module)
* curl
* tdom (mangadex_monitor.tcl only)