From d0950dcbaaf323bacd2681215bb016b0b7ff887d Mon Sep 17 00:00:00 2001 From: Moss Date: Fri, 30 Sep 2022 01:13:42 -0400 Subject: [PATCH] Series: Added Series Documentation --- src/series.h | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/src/series.h b/src/series.h index fcebf87..3fe392c 100644 --- a/src/series.h +++ b/src/series.h @@ -10,22 +10,68 @@ namespace dropout_dl { + + /// A class for handling all series information and functions. class series { public: + /// The name of the series std::string name; + /// The link to the series page std::string url; + /// The series page data std::string page_data; + /// The directory which will contain the seasons of the series std::string series_directory; + /// A vector containing all the season that this series include std::vector seasons; + /** + * + * @param html_data - The series page data + * @return The name of the series + * + * Scrapes the series page for the name of the series + */ static std::string get_series_name(const std::string& html_data); + /** + * + * @param html_data - The series page data + * @param cookies - The cookies from a browser + * @return A list of all seasons in the series + * + * Scrapes the series page for the names and link of all the season. Creates season objects for each of these. + * These season object contain all the episodes of the season as episode objects. + * The cookies this function takes are passed to the episode objects. + */ static std::vector get_seasons(const std::string& html_data, const std::vector& cookies); + /** + * + * @param url - The url to the season + * @param cookies - The browser cookies + * @return A season object + * + * Gets the season page, which is really just a series page, and creates a season object with all the episodes of the season + */ static season get_season(const std::string& url, const std::vector& cookies); - void download(const std::string& quality, const std::string& base); + /** + * + * @param quality - The quality of the video + * @param base - The base directory to download to + * + * Downloads the series into the base directory with the format \/\/\/\ + */ + void download(const std::string& quality, const std::string& base = "."); + /** + * + * @param url - The link to the series page + * @param cookies - The browser cookies + * + * Creates a series object and populates the needed variables + */ explicit series(const std::string& url, const std::vector& cookies) { this->url = url; this->page_data = get_generic_page(url);