Skip to content

Get started tutorial

Ayase-252 edited this page Aug 18, 2016 · 3 revisions

Installation

Install requirements

This script is written in Python, and supports all version of Python 3.x. Make sure any version of Python 3.x is correctly installed in your machine.

The following third-party packages is requires by the script.

  • bs4
  • lxml
  • requests
  • hanziconv
  • tinydb
  • tinydb-serialization

If you want to install them by pip, just execute the following commands in your terminal.

pip install -r requirement.txt

Install the script

Script can be installed by cloning the repository or downloading the latest releases.

If you are favor in git, execute the following commands.

git clone https://github.com/Ayase-252/auto-anime-downloader.git your_path

Replace your_path with your path

Tutorial with real example

After installation, let's start to use it. This example is based on a real scenario.

It says you want to watch two anime, New Game and Rewrite, in summer of 2016. You searched things about them, know that New Game starts on air on 5 Jul, 2016 and Rewrite starts on 2 Jul, 2016.

Tell downloader about your interested anime

Downloader relies on information you provided to act correctly. But how to make it known? There is a function to import them from a JSON file.

python aad.py add your_json_file

Provided the above information, you can write a file named as 2016-summer.json as following.

[{
  "name": "New Game",
  "start_date": "2016-07-05",
  },{
  "name": "Rewrite",
  "start_date": "2016-07-02",
  }
]

Then, simply type and execute

python aad.py add 2016-summer.JSON

You will be notified with insertion of 2 anime. Download will check them when its next run to fetch torrent.

A little helper

I fully understand that it is very tedious to write a JSON file like above manually. So, I introduced a management system to relieve such pain in v0.5.0. It is shipped with a simple plugin named add which generates an empty JSON file based your choice. All you should to do is to fill the file, and to import it with tools mentioned above.

There is an example. First, invoke management system by command

python aad.py manage

Then, type add to enter the plugin. It will prompt you to input the number of anime you desire. Finally, it generates a JSON file with empty entries. File name will be new_anime_your-timestamp.json.

Fill it, then execute

python aad.py add new_anime_your-timestamp.json

Program will import your anime into database.

More options available

There are more options you can utilize in your JSON file. The following table shows all options available.

Attribute name Mean
name (Required) Name of anime. Program will check whether provided name is in the string of download page.
start_date (Required) The starting date of anime. Format is Year-Month-Day in numeric representation.
translation_team (Optional) Translation team you picked up. Downloader will always try to fetch episode translated by these teams if you filled. It should be an array. E.g "translation_team":["some","another"]
dled_ep (Optional) Episodes which have been downloaded. Default 0.
total_ep (Optional) Episodes of anime in total. Default 99.
offset (Optional) Offset. If broadcast of anime deviates from normal, fill it to correct. Positive number for delayed weeks and minus number for weeks in advance.
keyword (Optional) Keywords. Program uses keywords to search file in website.

Wrong? Not a problem

If there are something wrong in your file while you are adding anime, don't worry.

Program support to update entry from a JSON file. All options even name, can be modified. JSON file is similar to the one you used to add, except that the name of key you want to change should be leaded by new_.

For example, say, you inserted an entry named new name for anime new game. Because of the error in name, program cannot verify the correctness of download link. It should be corrected.

To amend it, create a file named update.json, then fill it with following content.

[{
  "name": "new name",
  "new_name": "new game"
}]

Execute command

python aad.py update update.json

The error should be fixed.

Another little helper

For some reason, a plugin named change is shipped with management system in v0.5.0. It generates a JSON file filled with present value and changed key name. The generated file will be named as change_anime_your-timestamp.json.

Use it

Simply execute

python aad.py

The program will start to search file by installed scraper.

More configuration

You can make some set in configure.py to meet you requirement. Refer to configuration.