Skip to content

Reference for youtube_dl_scraper/core/base_scraper.py

youtube_dl_scraper.core.base_scraper.BaseScraper

BaseScraper(download_path: str)

Base class for scrapers

Source code in youtube_dl_scraper/core/base_scraper.py
def __init__(self, download_path: str):
    self.download_path = download_path
async_scrape async
async_scrape(url: str)

Scrapes youtube video data from sites asynchronously

Source code in youtube_dl_scraper/core/base_scraper.py
async def async_scrape(self, url: str):
    """Scrapes youtube video data from sites asynchronously"""
    raise NotImplementedError("This method should be overwritten")
async_scrape_captions async
async_scrape_captions(url: str)

Scrape youtube caprions data from site asynchronously

Source code in youtube_dl_scraper/core/base_scraper.py
async def async_scrape_captions(self, url: str):
    """Scrape youtube caprions data from site asynchronously"""
    raise NotImplementedError("This method should be overwritten")
custom_prop
custom_prop(obj, data: str)

adds custom properties in data to obj

Source code in youtube_dl_scraper/core/base_scraper.py
def custom_prop(self, obj, data: str):
    """adds custom properties in data to obj"""
    return obj
scrape
scrape(url: str)

Scrape youtube video data from site

Source code in youtube_dl_scraper/core/base_scraper.py
def scrape(self, url: str):
    """Scrape youtube video data from site"""
    raise NotImplementedError("This method should be overwritten")
scrape_captions
scrape_captions(url: str)

Scrape youtube caprions data from site

Source code in youtube_dl_scraper/core/base_scraper.py
def scrape_captions(self, url: str):
    """Scrape youtube caprions data from site"""
    raise NotImplementedError("This method should be overwritten")