This is a Python script that can be used to search and download anime episodes from animepahe. It uses the requests
, beautifulsoup4
, and selenium
libraries to interact with the website and scrape relevant data.
- Python3
- Any of the main web browser(Chrome,firefox,brave, e.t.c)
- Selenium
- BeautifulSoup4
- requests
- webdriver-manager
- tqdm
- Make sure you have Python and Firefox installed in your system
- Install PyPI package using
pip install autopahe
- Wait for pip to install autopahe and all required dependencies. Enjoy the script π
- Syntax:
autopahe -<optional arguments>
- To run the script, execute
autopahe
- Search for an anime.
- Select anime from search result.
- Select episodes to download.
- Downloads are made using inbuilt-dlr (default).
- Inbuilt-dlr finds and resumes incomplete downloads by default.
- Episode Selection Options:
-
i : downloads episode i.
- eg:-
1
: downloads episode 1,5
downloads episode 5 and so on.
- eg:-
-
x-y : downloads episodes from x to y.
- eg:-
3-9
: downloads episodes 3 to 9 (3 and 9 inclusive)
- eg:-
-
In case of multiple options, each options must be seperated by a
,
-
Example:
1, 3, 6-11
: downloads episodes 1,3,6,7,8,9,10,11
-
To use the script, run it in your terminal using the following command:
python fetchanime.py [-h] [-b BROWSER] [-s SEARCH] [-sh SEARCH_HIDDEN] [-i INDEX] [-sd SINGLE_DOWNLOAD] [-md MULTI_DOWNLOAD_OPTIMIZED] [-mdv MULTI_DOWNLOAD_VERBOSE] [-a ABOUT]
Here are the available options:
-h
,--help
: show the help message and exit-b
,--browser
: choose the browser to use (chrome
,firefox
orbrave
). If omitted, the script will usechrome
by default. Useffgui
for a GUI Firefox window.-s
,--search
: search for an anime using a keyword. The script will display a list of matching results.-sh
,--search_hidden
: search for an anime using its name and index. This option is less verbose than the regular search.-i
,--index
: choose an anime from the search results by its index.-sd
,--single_download
: download a single episode of an anime by its number.-md
,--multi_download_optimized
: download multiple episodes of an anime at once using a faster, optimized method. Specify a comma-separated string of episode numbers to download.-mdv
,--multi_download_verbose
: download multiple episodes of an anime at once and show a verbose output. Specify a comma-separated string of episode numbers to download.-a
,--about
: display an overview of the chosen anime.
Here are some example commands to run the script:
-
Search for an anime:
python fetchanime.py --search "jujutsu kaisen"
-
Choose an anime from the search results:
python fetchanime.py --search "jujutsu kaisen" --index 0
-
Download a single episode:
python fetchanime.py --search "jujutsu kaisen" --single_download 1
-
Download multiple episodes (optimized):
python fetchanime.py --search "jujutsu kaisen" --multi_download_optimized "1,2,3"
-
Download multiple episodes (verbose):
python fetchanime.py --search "jujutsu kaisen" --multi_download_verbose "1,2,3"
-
Get an overview of an anime:
python fetchanime.py --search "jujutsu kaisen" --index 0 --about
-
Downloading and Quality :
- Files are downloaded to your Default downloads directory.
- Downloads are taken care of by the inbuilt downloader on default.
- Currently the download quality priority is only 720p
-
you need a browser to be installed for this script to work (since the script uses selenium for some of its functions).
-
This script is a work under progress and therefore may lack some features, please bear with it, and consider contributing if you have any fixes or improvements
βΊοΈ . -
In Windows the webdriver if found to misbehave if the script is forced to exit using
ctrl^c
. A good solution to this couldn't be found and a temporary fix have been implemented. And as such, please be noted that if you use ctrl^c to exit, your active firefox sessions or tabs have a good chance of crashing. (Note: ctrl^c doesn't have any issues in Linux)
This script was created by Arinze(haxsys) using the following resources: