py-anime-scraper


Namepy-anime-scraper JSON
Version 1.0.4 PyPI version JSON
download
home_pageNone
SummaryAsync-first Python library for scraping anime websites, currently supporting AnimeFLV
upload_time2025-08-17 06:26:18
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords anime scraping playwright async python
VCS
bugtrack_url
requirements aiohappyeyeballs aiohttp aiosignal attrs beautifulsoup4 bs4 certifi cffi charset-normalizer colorama curl_cffi frozenlist greenlet idna loguru lxml multidict playwright playwright-stealth propcache pycparser pyee pyjsparser pyparsing requests-toolbelt six soupsieve typing_extensions tzdata tzlocal urllib3 win32_setctime yarl
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Py Anime Scraper

[![PyPI Version](https://img.shields.io/pypi/v/py-anime-scraper.svg)](https://pypi.org/project/py-anime-scraper/)

[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

<!-- [![Build Status](https://github.com/your_username/py-anime-scraper/actions/workflows/main.yml/badge.svg)](https://github.com/your_username/py-anime-scraper/actions) -->

Python library for scraping anime websites, designed to be async-first with sync support. Currently supports only **AnimeFLV**.

---

## 🚀 Features

- Asynchronous and synchronous anime search
- Retrieve detailed anime and episode information
- Download static links (aiohttp + bs4) and dynamic links (playwright for JS)
- Support for concurrent and controlled scraping
- Easily extendable to add more scrapers

---

## 📦 Installation

From PyPI:

```bash
pip install py-anime-scraper
```

From GitHub:

```bash
pip install git+https://github.com/ElPitagoras14/py-anime-scraper.git
```

---

## 🐍 Requirements

- Python >= 3.9 (tested with 3.12)
- Main dependencies: `aiohttp`, `beautifulsoup4`, `playwright`, `lxml`, `loguru`

Optional manual install:

```bash
pip install aiohttp beautifulsoup4 playwright lxml loguru
```

Then, install Chromium (only once):

```bash
playwright install chromium
```

---

## ⚙️ Basic Usage

```python
from anime_scraper.scrapers.animeflv import AnimeFLVScraper
from anime_scraper.scrapers.jkanime.scraper import JKAnimeScraper
import asyncio


async def main():
    animeflv_scraper = AnimeFLVScraper(verbose=False)
    jkanime_scraper = JKAnimeScraper(verbose=False)

    # Search anime
    an_results = await animeflv_scraper.search_anime_async(query="naruto", page=1)
    print(an_results)
    jk_results = await jkanime_scraper.search_anime_async(query="naruto")
    print(jk_results)

    # Get anime info
    an_info = await animeflv_scraper.get_anime_info_async(anime_id=an_results.animes[0].id)
    print(an_info)
    jk_info = await jkanime_scraper.get_anime_info_async(anime_id=jk_results.animes[0].id)
    print(jk_info)

    # Get table download links
    an_table_links = await animeflv_scraper.get_table_download_links_async(
        anime_id=an_info.id, episode_id=1
    )
    print(an_table_links)
    jk_table_links = await jkanime_scraper.get_table_download_links_async(
        anime_id=jk_info.id, episode_id=1
    )
    print(jk_table_links)

    # Get iframe download links
    an_iframe_links = await animeflv_scraper.get_iframe_download_links_async(
        anime_id=an_info.id, episode_id=1
    )
    print(an_iframe_links)

    # Note: Not supported yet
    # jk_iframe_links = await jkanime_scraper.get_iframe_download_links_async(
    #     anime_id=jk_info.id, episode_id=1
    # )
    # print(jk_iframe_links)

    # Get file download links
    an_file_links = await animeflv_scraper.get_file_download_links_async(
        download_info=an_iframe_links.download_links[0]
    )
    print(an_file_links)
    jk_file_links = await jkanime_scraper.get_file_download_links_async(
        download_info=jk_table_links.download_links[0]
    )
    print(jk_file_links)


if __name__ == "__main__":
    asyncio.run(main())
```

For synchronous use, you can do:

```python
scraper = AnimeFLVScraper()
results = scraper.search_anime("naruto")
```

---

## ⚠️ Disclaimer

This library is **for educational and personal use only**. Scraping should be done respecting the websites' terms of service and applicable laws. The author is not responsible for any misuse.

---

## 🛠️ How to add a new scraper

1. Create a class inheriting from `BaseAnimeScraper`.
2. Implement the required async methods (`search_anime_async`, `get_anime_info_async`, etc.).
3. Use `aiohttp` and `bs4` for static scraping and `playwright` for dynamic scraping when JS execution is needed.
4. Register your scraper in the package for easy use.

---

## 🧪 Development and Testing

Install development dependencies:

```bash
pip install -r requirements.txt
```

---

## 🚧 Coming Soon

Currently, **py-anime-scraper** only supports **AnimeFLV**, but support for more anime websites is in progress and will be added soon.

If you want to contribute by adding new scrapers for other sites, contributions are welcome!

---

## 📄 License

MIT © 2025 El Pitágoras

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "py-anime-scraper",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "anime, scraping, playwright, async, python",
    "author": null,
    "author_email": "\"github:ElPitagoras14\" <jonfrgar@espol.edu.ec>",
    "download_url": "https://files.pythonhosted.org/packages/a2/5f/05c3535de8e25587d95beb312ff58fdf4a8bd13c9e0bbb7ad248b84c96db/py_anime_scraper-1.0.4.tar.gz",
    "platform": null,
    "description": "# Py Anime Scraper\r\n\r\n[![PyPI Version](https://img.shields.io/pypi/v/py-anime-scraper.svg)](https://pypi.org/project/py-anime-scraper/)\r\n\r\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\r\n\r\n<!-- [![Build Status](https://github.com/your_username/py-anime-scraper/actions/workflows/main.yml/badge.svg)](https://github.com/your_username/py-anime-scraper/actions) -->\r\n\r\nPython library for scraping anime websites, designed to be async-first with sync support. Currently supports only **AnimeFLV**.\r\n\r\n---\r\n\r\n## \ud83d\ude80 Features\r\n\r\n- Asynchronous and synchronous anime search\r\n- Retrieve detailed anime and episode information\r\n- Download static links (aiohttp + bs4) and dynamic links (playwright for JS)\r\n- Support for concurrent and controlled scraping\r\n- Easily extendable to add more scrapers\r\n\r\n---\r\n\r\n## \ud83d\udce6 Installation\r\n\r\nFrom PyPI:\r\n\r\n```bash\r\npip install py-anime-scraper\r\n```\r\n\r\nFrom GitHub:\r\n\r\n```bash\r\npip install git+https://github.com/ElPitagoras14/py-anime-scraper.git\r\n```\r\n\r\n---\r\n\r\n## \ud83d\udc0d Requirements\r\n\r\n- Python >= 3.9 (tested with 3.12)\r\n- Main dependencies: `aiohttp`, `beautifulsoup4`, `playwright`, `lxml`, `loguru`\r\n\r\nOptional manual install:\r\n\r\n```bash\r\npip install aiohttp beautifulsoup4 playwright lxml loguru\r\n```\r\n\r\nThen, install Chromium (only once):\r\n\r\n```bash\r\nplaywright install chromium\r\n```\r\n\r\n---\r\n\r\n## \u2699\ufe0f Basic Usage\r\n\r\n```python\r\nfrom anime_scraper.scrapers.animeflv import AnimeFLVScraper\r\nfrom anime_scraper.scrapers.jkanime.scraper import JKAnimeScraper\r\nimport asyncio\r\n\r\n\r\nasync def main():\r\n    animeflv_scraper = AnimeFLVScraper(verbose=False)\r\n    jkanime_scraper = JKAnimeScraper(verbose=False)\r\n\r\n    # Search anime\r\n    an_results = await animeflv_scraper.search_anime_async(query=\"naruto\", page=1)\r\n    print(an_results)\r\n    jk_results = await jkanime_scraper.search_anime_async(query=\"naruto\")\r\n    print(jk_results)\r\n\r\n    # Get anime info\r\n    an_info = await animeflv_scraper.get_anime_info_async(anime_id=an_results.animes[0].id)\r\n    print(an_info)\r\n    jk_info = await jkanime_scraper.get_anime_info_async(anime_id=jk_results.animes[0].id)\r\n    print(jk_info)\r\n\r\n    # Get table download links\r\n    an_table_links = await animeflv_scraper.get_table_download_links_async(\r\n        anime_id=an_info.id, episode_id=1\r\n    )\r\n    print(an_table_links)\r\n    jk_table_links = await jkanime_scraper.get_table_download_links_async(\r\n        anime_id=jk_info.id, episode_id=1\r\n    )\r\n    print(jk_table_links)\r\n\r\n    # Get iframe download links\r\n    an_iframe_links = await animeflv_scraper.get_iframe_download_links_async(\r\n        anime_id=an_info.id, episode_id=1\r\n    )\r\n    print(an_iframe_links)\r\n\r\n    # Note: Not supported yet\r\n    # jk_iframe_links = await jkanime_scraper.get_iframe_download_links_async(\r\n    #     anime_id=jk_info.id, episode_id=1\r\n    # )\r\n    # print(jk_iframe_links)\r\n\r\n    # Get file download links\r\n    an_file_links = await animeflv_scraper.get_file_download_links_async(\r\n        download_info=an_iframe_links.download_links[0]\r\n    )\r\n    print(an_file_links)\r\n    jk_file_links = await jkanime_scraper.get_file_download_links_async(\r\n        download_info=jk_table_links.download_links[0]\r\n    )\r\n    print(jk_file_links)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    asyncio.run(main())\r\n```\r\n\r\nFor synchronous use, you can do:\r\n\r\n```python\r\nscraper = AnimeFLVScraper()\r\nresults = scraper.search_anime(\"naruto\")\r\n```\r\n\r\n---\r\n\r\n## \u26a0\ufe0f Disclaimer\r\n\r\nThis library is **for educational and personal use only**. Scraping should be done respecting the websites' terms of service and applicable laws. The author is not responsible for any misuse.\r\n\r\n---\r\n\r\n## \ud83d\udee0\ufe0f How to add a new scraper\r\n\r\n1. Create a class inheriting from `BaseAnimeScraper`.\r\n2. Implement the required async methods (`search_anime_async`, `get_anime_info_async`, etc.).\r\n3. Use `aiohttp` and `bs4` for static scraping and `playwright` for dynamic scraping when JS execution is needed.\r\n4. Register your scraper in the package for easy use.\r\n\r\n---\r\n\r\n## \ud83e\uddea Development and Testing\r\n\r\nInstall development dependencies:\r\n\r\n```bash\r\npip install -r requirements.txt\r\n```\r\n\r\n---\r\n\r\n## \ud83d\udea7 Coming Soon\r\n\r\nCurrently, **py-anime-scraper** only supports **AnimeFLV**, but support for more anime websites is in progress and will be added soon.\r\n\r\nIf you want to contribute by adding new scrapers for other sites, contributions are welcome!\r\n\r\n---\r\n\r\n## \ud83d\udcc4 License\r\n\r\nMIT \u00a9 2025 El Pit\u00e1goras\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Async-first Python library for scraping anime websites, currently supporting AnimeFLV",
    "version": "1.0.4",
    "project_urls": {
        "Homepage": "https://github.com/ElPitagoras14/py-anime-scraper",
        "Repository": "https://github.com/ElPitagoras14/py-anime-scraper"
    },
    "split_keywords": [
        "anime",
        " scraping",
        " playwright",
        " async",
        " python"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "94442e8a92452d192aac3a856f1d1ec1a39ae6296e13bac107aeac77b37095fc",
                "md5": "2af120cd2024b1c83f123cd6155a08e0",
                "sha256": "df429cf73fb3ca946f26076001f4829f127ae2b1fe5c0e72282581a060d6cfa8"
            },
            "downloads": -1,
            "filename": "py_anime_scraper-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2af120cd2024b1c83f123cd6155a08e0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 19678,
            "upload_time": "2025-08-17T06:26:16",
            "upload_time_iso_8601": "2025-08-17T06:26:16.104160Z",
            "url": "https://files.pythonhosted.org/packages/94/44/2e8a92452d192aac3a856f1d1ec1a39ae6296e13bac107aeac77b37095fc/py_anime_scraper-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a25f05c3535de8e25587d95beb312ff58fdf4a8bd13c9e0bbb7ad248b84c96db",
                "md5": "1cc1c46878ac139c63fc34b2035f1c54",
                "sha256": "d6a9dfc550124054ac966ac59e1db233ee5504f11f4622072c7c67b6d3414620"
            },
            "downloads": -1,
            "filename": "py_anime_scraper-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "1cc1c46878ac139c63fc34b2035f1c54",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 16445,
            "upload_time": "2025-08-17T06:26:18",
            "upload_time_iso_8601": "2025-08-17T06:26:18.661738Z",
            "url": "https://files.pythonhosted.org/packages/a2/5f/05c3535de8e25587d95beb312ff58fdf4a8bd13c9e0bbb7ad248b84c96db/py_anime_scraper-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-17 06:26:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ElPitagoras14",
    "github_project": "py-anime-scraper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "aiohappyeyeballs",
            "specs": [
                [
                    "==",
                    "2.6.1"
                ]
            ]
        },
        {
            "name": "aiohttp",
            "specs": [
                [
                    "==",
                    "3.12.14"
                ]
            ]
        },
        {
            "name": "aiosignal",
            "specs": [
                [
                    "==",
                    "1.4.0"
                ]
            ]
        },
        {
            "name": "attrs",
            "specs": [
                [
                    "==",
                    "25.3.0"
                ]
            ]
        },
        {
            "name": "beautifulsoup4",
            "specs": [
                [
                    "==",
                    "4.13.4"
                ]
            ]
        },
        {
            "name": "bs4",
            "specs": [
                [
                    "==",
                    "0.0.2"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2025.8.3"
                ]
            ]
        },
        {
            "name": "cffi",
            "specs": [
                [
                    "==",
                    "1.17.1"
                ]
            ]
        },
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "==",
                    "3.4.3"
                ]
            ]
        },
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.4.6"
                ]
            ]
        },
        {
            "name": "curl_cffi",
            "specs": [
                [
                    "==",
                    "0.13.0"
                ]
            ]
        },
        {
            "name": "frozenlist",
            "specs": [
                [
                    "==",
                    "1.7.0"
                ]
            ]
        },
        {
            "name": "greenlet",
            "specs": [
                [
                    "==",
                    "3.2.3"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.10"
                ]
            ]
        },
        {
            "name": "loguru",
            "specs": [
                [
                    "==",
                    "0.7.3"
                ]
            ]
        },
        {
            "name": "lxml",
            "specs": [
                [
                    "==",
                    "6.0.0"
                ]
            ]
        },
        {
            "name": "multidict",
            "specs": [
                [
                    "==",
                    "6.6.3"
                ]
            ]
        },
        {
            "name": "playwright",
            "specs": [
                [
                    "==",
                    "1.53.0"
                ]
            ]
        },
        {
            "name": "playwright-stealth",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "propcache",
            "specs": [
                [
                    "==",
                    "0.3.2"
                ]
            ]
        },
        {
            "name": "pycparser",
            "specs": [
                [
                    "==",
                    "2.22"
                ]
            ]
        },
        {
            "name": "pyee",
            "specs": [
                [
                    "==",
                    "13.0.0"
                ]
            ]
        },
        {
            "name": "pyjsparser",
            "specs": [
                [
                    "==",
                    "2.7.1"
                ]
            ]
        },
        {
            "name": "pyparsing",
            "specs": [
                [
                    "==",
                    "3.2.3"
                ]
            ]
        },
        {
            "name": "requests-toolbelt",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.17.0"
                ]
            ]
        },
        {
            "name": "soupsieve",
            "specs": [
                [
                    "==",
                    "2.7"
                ]
            ]
        },
        {
            "name": "typing_extensions",
            "specs": [
                [
                    "==",
                    "4.14.1"
                ]
            ]
        },
        {
            "name": "tzdata",
            "specs": [
                [
                    "==",
                    "2025.2"
                ]
            ]
        },
        {
            "name": "tzlocal",
            "specs": [
                [
                    "==",
                    "5.3.1"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "2.5.0"
                ]
            ]
        },
        {
            "name": "win32_setctime",
            "specs": [
                [
                    "==",
                    "1.2.0"
                ]
            ]
        },
        {
            "name": "yarl",
            "specs": [
                [
                    "==",
                    "1.20.1"
                ]
            ]
        }
    ],
    "lcname": "py-anime-scraper"
}
        
Elapsed time: 2.27258s