A high-performance, asynchronous REST API built with FastAPI to search and extract application data from PDALife.com. This tool automates the retrieval of download links, handling complex redirects, CDN (MobDisc) traversals, and magnet link extraction.
- Overview
- Key Features
- Technology Stack
- Prerequisites
- Installation
- Usage
- API Endpoints
- Legal Disclaimer
- License
This project provides a programmatic interface to PDALife.com. It allows users to search for applications and retrieve direct download links that are often hidden behind multiple redirect layers or proprietary CDN pages (MobDisc). The system uses asynchronous request handling to ensure speed and efficiency, even when processing multiple search results simultaneously.
- Asynchronous Processing: Built on
httpxandasyncioto handle concurrent network requests efficiently. - Deep Link Extraction: Automatically resolves
MobDiscCDN redirects to find the actual file or magnet link. - Google Translate Unwrap: Detects and cleans URLs wrapped in Google Translate proxies.
- Pagination Support: Automatically navigates through search result pages to fulfill the requested limit.
- Robust Error Handling: Includes retry logic for 429 (Rate Limit) and 5xx errors, with fallback mechanisms for different HTML structures.
- Magnet Link Support: Native detection and extraction of BitTorrent magnet links.
- Python 3.8+
- FastAPI: Modern, fast web framework for building APIs.
- Uvicorn: Lightning-fast ASGI server implementation.
- HTTPX: A next-generation HTTP client for Python with async support.
- BeautifulSoup4: Library for parsing HTML and XML documents.
Ensure you have Python 3.8 or higher installed on your system.
- Clone the repository:
git clone https://github.com/SaptaZ/PDALife-Scraper-API.git
cd PDALife-Scraper-API
- Create a virtual environment (optional but recommended):
python -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
- Install dependencies:
pip install fastapi uvicorn httpx beautifulsoup4
You can run the application directly using the built-in entry point or via Uvicorn CLI.
python main.py
uvicorn main:app --host 0.0.0.0 --port 7860 --reload
The server will start on port 7860 (or the port defined in your environment variables).
Verifies that the API is running.
- URL:
/ - Method:
GET - Response:
{
"message": "Search API for PDALife.com by Bowo",
"github": "https://github.com/SaptaZ",
"example_usage": "/search?query=minecraft&limit=5"
}Searches for an application and scrapes download details.
-
URL:
/search -
Method:
GET -
Query Parameters:
-
query(string, required): The name of the application to search for. -
limit(integer, optional): Maximum number of results to retrieve. Default is5. -
Example Request:
GET /search?query=minecraft&limit=5
- Example Response:
{
"success": true,
"query": "minecraft",
"limit": 5,
"count": 5,
"results": [
{
"name": "Minecraft - Pocket Edition APK mod full",
"link": "https://pdalife.com/minecraft-pocket-edition-android-a1552.html",
"image": "https://pdacdn.com/app/59522ace02abb/minecraft-play-with-friends.png",
"download": "https://mobdisc.com/download/Minecraft-v1-21-132-1-patched.apk, https://mobdisc.com/download/Minecraft-v1-21-131-1.apk, https://mobdisc.com/download/Minecraft-v1-21-130-3-patched.apk, https://mobdisc.com/download/Minecraft-v1-26-0-23-patched.apk",
"size": "699.25 Mb"
}
]
}This repository is for educational purposes only. The code demonstrates how to use Python for web scraping and data extraction. The author is not responsible for any misuse of this software or for any copyright infringements caused by downloading content from third-party sources. Users should comply with the Terms of Service of the target websites.
This project is licensed under the MIT License - see the LICENSE file for details.