Skip to content

QuickStart

First, let's import the library:

import animeworld as aw

Find

Now let's try searching for an anime:

res = aw.find("Sword Art Online")
print(res)
Output
[
    {
        "id": 1717,
        "name": "Sword Art Online",
        "jtitle": "Sword Art Online",
        "studio": "A-1 Pictures",
        "release": "05 Luglio 2014",
        "episodes": 25,
        "state": "1",
        "story": 'Kazuto "Kirito" Kirigaya, un genio della programmazione, entra in una realtà  virtuale interattiva con pluralità  di giocatori (una realtà  "massively multi-player online" o "MMO") denominata "Sword Art Online". Il problema sta nel fatto che, una volta entrati, se ne può uscire solo vincitori, completando il gioco, perché il game over equivale a morte certa del giocatore.',
        "categories": [...],
        "image": "https://img.animeworld.so/locandine/36343l.jpg",
        "durationEpisodes": "23",
        "link": "https://www.animeworld.so/play/sword-art-online.N0onT",
        "createdAt": "2020-08-02T15:42:44.000Z",
        "language": "jp",
        "year": "2012",
        "dub": False,
        "season": "summer",
        "totViews": 461576,
        "dayViews": 204,
        "weekViews": 459,
        "monthViews": 6416,
        "malId": 11757,
        "anilistId": 11757,
        "mangaworldId": None,
        "malVote": 7.35,
        "trailer": "https://www.youtube.com/embed/6ohYYtxfDCg?enablejsapi=1&wmode=opaque",
    },
    ...
]

The find function returns a list of dictionaries, one for each found anime. Each dictionary contains many details, including the name, episode count, release date, link, etc.

Anime

The Anime class is the core object of this library. To instantiate it, you need to pass the anime link, obtained directly from the AnimeWorld site or from the find function seen earlier.

anime = aw.Anime("https://www.animeworld.so/play/sword-art-online.N0onT")

Warning

If the passed link points to a 404 page, the Error404 exception will be raised.

With this class, you can obtain information about the anime:

# Title
print("Title:", anime.getName())
print("----------------------------------\n")

# Plot
print("Plot:", anime.getTrama())
print("----------------------------------\n")

# General information
info = anime.getInfo()
print("General Information:\n", "\n".join(
    [f"{x}: {info[x]}" for x in info]
))
print("----------------------------------\n")
Output
Title: Sword Art Online
----------------------------------

Plot: Kazuto "Kirito" Kirigaya, un genio della programmazione, entra in una realtà  virtuale interattiva con pluralità  di giocatori (una realtà  "massively multi-player online" o "MMO") denominata "Sword Art Online". Il problema sta nel fatto che, una volta entrati, se ne può uscire solo vincitori, completando il gioco, perché il game over equivale a morte certa del giocatore.
----------------------------------

General Information:
Category: Anime
Audio: Giapponese
Release Date: 08 Luglio 2012
Season: Estate 2012
Studio: A-1 Pictures
Genre: ['Avventura', 'Azione', 'Fantasy', 'Gioco', 'Romantico', 'Sentimentale']
Rating: 8.36 / 10
Duration: 23 min/ep
Episodes: 25
Status: Finito
Views: 461.733
----------------------------------

But most importantly, download the episodes:

Info

If no argument is passed to the getEpisodes() method, ALL episodes of the anime will be obtained.

Warning

ep.number is an attribute of type str, more information here.

# Obtain a list of episodes
# that interest me
episodes = anime.getEpisodes([1, 2, 4])


# And download them
for ep in episodes:

    print(f"Downloading episode {ep.number}.")

    # One at a time...
    ep.download() 

    print(f"Download completed.")
Output
Downloading episode 1.
Download completed.
Downloading episode 2.
Download completed.
Downloading episode 4.
Download completed.

Last update: November 18, 2023