Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CScraperUrl Class Reference

#include <ScraperUrl.h>

Classes

struct  SUrlEntry
 

Public Types

enum class  UrlType { General = 1 , Season = 2 }
 

Public Member Functions

 CScraperUrl ()
 
 CScraperUrl (const std::string &strUrl)
 
 CScraperUrl (const TiXmlElement *element)
 
 ~CScraperUrl ()
 
void Clear ()
 
bool HasData () const
 
const std::string & GetData () const
 
void SetData (std::string data)
 
const std::string & GetTitle () const
 
void SetTitle (std::string title)
 
const std::string & GetId () const
 
void SetId (std::string id)
 
double GetRelevance () const
 
void SetRelevance (double relevance)
 
bool HasUrls () const
 
const std::vector< SUrlEntry > & GetUrls () const
 
void SetUrls (std::vector< SUrlEntry > urls)
 
void AppendUrl (SUrlEntry url)
 
const SUrlEntry GetFirstUrlByType (const std::string &type="") const
 
const SUrlEntry GetSeasonUrl (int season, const std::string &type="") const
 
unsigned int GetMaxSeasonUrl () const
 
std::string GetFirstThumbUrl () const
 
void GetThumbUrls (std::vector< std::string > &thumbs, const std::string &type="", int season=-1, bool unique=false) const
 fetch the full URLs (including referrer) of thumbs
 
bool Parse ()
 
bool ParseFromData (const std::string &data)
 
bool ParseAndAppendUrl (const TiXmlElement *element)
 
bool ParseAndAppendUrlsFromEpisodeGuide (const std::string &episodeGuide)
 
void AddParsedUrl (const std::string &url, const std::string &aspect="", const std::string &preview="", const std::string &referrer="", const std::string &cache="", bool post=false, bool isgz=false, int season=-1)
 

Static Public Member Functions

static std::string GetThumbUrl (const CScraperUrl::SUrlEntry &entry)
 fetch the full URL (including referrer) of a thumb
 
static bool Get (const SUrlEntry &scrURL, std::string &strHTML, XFILE::CCurlFile &http, const std::string &cacheContext)
 

Public Attributes

std::string m_data
 

Member Enumeration Documentation

◆ UrlType

enum class CScraperUrl::UrlType
strong
Enumerator
General 
Season 

Constructor & Destructor Documentation

◆ CScraperUrl() [1/3]

CScraperUrl::CScraperUrl ( )

◆ CScraperUrl() [2/3]

CScraperUrl::CScraperUrl ( const std::string & strUrl)
explicit

◆ CScraperUrl() [3/3]

CScraperUrl::CScraperUrl ( const TiXmlElement * element)
explicit

◆ ~CScraperUrl()

CScraperUrl::~CScraperUrl ( )
default

Member Function Documentation

◆ AddParsedUrl()

void CScraperUrl::AddParsedUrl ( const std::string & url,
const std::string & aspect = "",
const std::string & preview = "",
const std::string & referrer = "",
const std::string & cache = "",
bool post = false,
bool isgz = false,
int season = -1 )

◆ AppendUrl()

void CScraperUrl::AppendUrl ( SUrlEntry url)
inline

◆ Clear()

void CScraperUrl::Clear ( )

◆ Get()

bool CScraperUrl::Get ( const SUrlEntry & scrURL,
std::string & strHTML,
XFILE::CCurlFile & http,
const std::string & cacheContext )
static

◆ GetData()

const std::string & CScraperUrl::GetData ( ) const
inline

◆ GetFirstThumbUrl()

std::string CScraperUrl::GetFirstThumbUrl ( ) const

◆ GetFirstUrlByType()

const CScraperUrl::SUrlEntry CScraperUrl::GetFirstUrlByType ( const std::string & type = "") const

◆ GetId()

const std::string & CScraperUrl::GetId ( ) const
inline

◆ GetMaxSeasonUrl()

unsigned int CScraperUrl::GetMaxSeasonUrl ( ) const

◆ GetRelevance()

double CScraperUrl::GetRelevance ( ) const
inline

◆ GetSeasonUrl()

const CScraperUrl::SUrlEntry CScraperUrl::GetSeasonUrl ( int season,
const std::string & type = "" ) const

◆ GetThumbUrl()

std::string CScraperUrl::GetThumbUrl ( const CScraperUrl::SUrlEntry & entry)
static

fetch the full URL (including referrer) of a thumb

Parameters
URLentry to use to create the full URL
Returns
the full URL, including referrer

◆ GetThumbUrls()

void CScraperUrl::GetThumbUrls ( std::vector< std::string > & thumbs,
const std::string & type = "",
int season = -1,
bool unique = false ) const

fetch the full URLs (including referrer) of thumbs

Parameters
thumbs[out] vector of thumb URLs to fill
typethe type of thumb URLs to fetch, if empty (the default) picks any
seasonnumber of season that we want thumbs for, -1 indicates no season (the default)
uniqueavoid adding duplicate URLs when adding to a thumbs vector with existing items

◆ GetTitle()

const std::string & CScraperUrl::GetTitle ( ) const
inline

◆ GetUrls()

const std::vector< SUrlEntry > & CScraperUrl::GetUrls ( ) const
inline

◆ HasData()

bool CScraperUrl::HasData ( ) const
inline

◆ HasUrls()

bool CScraperUrl::HasUrls ( ) const
inline

◆ Parse()

bool CScraperUrl::Parse ( )

◆ ParseAndAppendUrl()

bool CScraperUrl::ParseAndAppendUrl ( const TiXmlElement * element)

◆ ParseAndAppendUrlsFromEpisodeGuide()

bool CScraperUrl::ParseAndAppendUrlsFromEpisodeGuide ( const std::string & episodeGuide)

◆ ParseFromData()

bool CScraperUrl::ParseFromData ( const std::string & data)

◆ SetData()

void CScraperUrl::SetData ( std::string data)

◆ SetId()

void CScraperUrl::SetId ( std::string id)
inline

◆ SetRelevance()

void CScraperUrl::SetRelevance ( double relevance)
inline

◆ SetTitle()

void CScraperUrl::SetTitle ( std::string title)
inline

◆ SetUrls()

void CScraperUrl::SetUrls ( std::vector< SUrlEntry > urls)
inline

Member Data Documentation

◆ m_data

std::string CScraperUrl::m_data

The documentation for this class was generated from the following files: