Skip to content

Instantly share code, notes, and snippets.

@marethyu
Last active May 11, 2022 16:46
Show Gist options
  • Select an option

  • Save marethyu/1ea9b72644742d593aa90870d09356fa to your computer and use it in GitHub Desktop.

Select an option

Save marethyu/1ea9b72644742d593aa90870d09356fa to your computer and use it in GitHub Desktop.
Bash script to fetch all mangas in Mangadex
#!/bin/bash
set -ehv
mkdir -p md
time curl --retry 64 --doh-url https://cloudflare-dns.com/dns-query --compressed --http2 "https://api.mangadex.org/v2/title/[000001-090000]?include=chapters" -o "md/md_titles_#1.json"
time for ((j = 0; j < 9;)); do jq -Mc ".data?|objects" $(seq 0$((j))0001 0$((++j))0000|xargs printf "md/md_titles_%06i.json\n"); done | tee md_titles_data.json
time jq -Mc ".manga | {id, titles: [.title, .altTitles[]], blurbs: .description}" ../md_titles_data.json | ../md_titles.json
@Poederkindje
Copy link

How can i make this work? How/where?

@marethyu
Copy link
Author

@Poederkindje Hi this is old code. The API changed a lot ever since the major update. You can find more information here. I will update my program when I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment