arimatakao / mdx

mdx is a command-line interface program for downloading manga from the MangaDex website. The program uses MangaDex API to fetch manga content.
MIT License
76 stars 5 forks source link

Print output of search as json #4

Open josueBarretogit opened 1 month ago

josueBarretogit commented 1 month ago

When running mdx find -t the output can be quite a lot so I thought I'd redirect it to a file like this mdx find -t "something" >> result.md but this is what the file looks like: image So I think having the option to print as json would be nice, something like mdx find -t -j I don't know if you guys would want this

arimatakao commented 1 month ago

Text like ^[[39;49m is called ANSI codes. To remove them, use additional utilities that delete ANSI codes from the output. Try the ansifilter tool on your system:

mdx find -t "something" | ansifilter >> result.md

My application uses the MangaDex REST API, so if you want to get some information about manga, just send an HTTP request to the API like this:

curl --request GET \
  --url 'https://api.mangadex.org/manga?limit=3&title=YourTitleOfManga&availableTranslatedLanguage%5B%5D=en&includes%5B%5D=author&includes%5B%5D=artist'

Documentation is here: https://api.mangadex.org/docs/03-manga/search/

Maybe I'll add JSON output later.