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 installed in your system
- Install all dependencies using
pip install -r requirements.txt
- Wait for pip to install all required dependencies. Enjoy the script :)
- Navigate to the project directory and Run
python3 autopahe/auto_pahe.py
- Syntax:
auto_pahe.py -<optional arguments>
- To run the script, execute
python3 auto_pahe.py
-
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 auto_pahe.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-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.-a
,--about
: display an overview of the chosen anime.-r
,--record
:Interact with the records/database (view, [index], [keyword]).
Here are some example commands to run the script:
To search for an anime
# To search for an anime
python3 auto_pahe.py -s "One piece"
To select an anime from the search result
# To select an anime from the search result
python3 auto_pahe.py -s "One piece" -i 1
To download an episode in the selected anime
# To download an episode in the selected anime
python3 auto_pahe.py -s "One piece" -i 0 -d 1
- 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: