~q3cpma/mangadex-tools

Tcl tools to interact with mangadex.org

d6600ad Switch to the new API URL

a month ago

9120690 Add link element to entries to accomodate sfeed

2 months 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? ...} ...                                |
|     Everything between a # and a newline is ignored.                      |
|                                                                           |
|     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 VALUE matching one of their     |
|             group names.                                                  |
|                                                                           |
|         title                                                             |
|             Use VALUE as 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)