A cmd tool for downloading ads and their media content from the Meta Ad Library.
Project description
AdDownloader
Add the description here
Installation
AdDownloader can be installed in three different ways: from source, from a wheel-file, or as a package.
Installing from source or wheel-file
Open a command-line tool (or a terminal) and navigate to your folder with
cd "[path-to-your-project]/AdDownloader"
Once you're inside your repository, to install from source run:
python setup.py install
To install from the wheel-file run:
pip install "dist/AdDownloader-0.1.0.tar.gz"
Installing as a Python package
To install AdDownloader as a Python package run:
pip install "111"
AdDownloader is now installed and can be run!
Usage
Once installed, AdDownloader can be run in two ways: as a command-line tool (CLI) or as a Python package.
AdDownloader as a Python package
- Create an AdDownloader instance:
from AdDownloader import adlib_api
from AdDownloader.media_download import start_media_download
ads_api = adlib_api.AdLibAPI(your-fb-access-token-here)
- Add parameters to your search:
ads.add_parameters(countries = 'BE', start_date = "2023-09-01", end_date = "2023-09-02", search_terms = "pizza", project_name = "test1")
Note that search_terms
and search_pages_id
are complementary.
- Check the parameters and start the download of ads data:
# check the parameters
ads.get_parameters()
data = ads.start_download()
- Start the media content retrieval of the ads downloaded in the previous step:
start_media_download(project_name = "test1", nr_ads = 20, data = data)
All the ouput can be found inside the 'output/your-project-name
' folder.
AdDownloader as a CLI
- Open a cmd/terminal and navigate to your directory with:
cd "[path-to-your-project]/AdDownloader"
- Create and activate a virtual environment (venv) with:
///
venv\Scripts\activate.bat
- Finally, start the CLI tool with:
python -m AdDownloader.cli
Once the tool is running, more instructions and questions will appear in the cmd/terminal
For further help see the documentation.
License
This project is licensed under the GNU General Public License v3.0. See the LICENSE.txt file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for AdDownloader-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe9f47f76f35eddefc4d1cb67f766e42a0547774f19c404355a127465ccc9db8 |
|
MD5 | 570a3e7ac4a33accfaf36e7545cda545 |
|
BLAKE2b-256 | 23c3fc7c802a357c38da0e8c31e4ea73e2dd0f2a9933e1698509ec5a3ff70d82 |