public class XBMCScraper extends XBMCExtension
DTD_WEB_LOCATION, SCHEMA_WEB_LOCATION
Constructor and Description |
---|
XBMCScraper(XBMCAddon addon,
java.io.File scraperFile,
java.lang.String point,
Mode mode)
Used to create the class and set the scraper file
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
executeXBMCScraperFunction(XBMCAddon rootAddon,
java.lang.String functionName)
Used to execute a scraper function
|
org.w3c.dom.Element |
findXBMCScraperFunction(XBMCAddon rootAddon,
java.lang.String functionName)
Used to find the scraper function
|
org.w3c.dom.Document |
getCreateSearchUrl(XBMCAddon rootAddon,
java.lang.String searchTerm,
java.lang.String year)
Used to get the URL which should be used to search
|
org.w3c.dom.Document |
getEpisodeGuideUrl(XBMCAddon rootAddon,
java.lang.String rawHtml)
Used to get the episode guide URL
|
org.w3c.dom.Document |
getGetDetails(XBMCAddon rootAddon,
java.io.File file,
java.lang.String... contents)
Used to get the show/film details as a XML document.
|
org.w3c.dom.Document |
getGetEpisodeDetails(XBMCAddon rootAddon,
java.lang.String contents,
java.lang.String episodeId)
Used to get the details of the a episode.
|
org.w3c.dom.Document |
getGetEpisodeList(XBMCAddon rootAddon,
java.lang.String html,
java.net.URL showURL)
Used to get a list of the the episodes in a show
|
org.w3c.dom.Document |
getGetSearchResults(XBMCAddon rootAddon,
java.lang.String rawHtml,
java.lang.String searchTerm)
This function is used to get a XML document of the search results.
|
Mode |
getMode()
Get the mode of the scrper
|
boolean |
getNfoUrl(XBMCAddon rootAddon,
java.lang.String contents)
Used to get a Show or film URL from the contents of a NFO file.
|
boolean |
supportsURL(XBMCAddon rootAddon,
java.net.URL url)
This method is used to check if the scraper can be used for the episode details URL
|
executeXBMCFunction, getAddon, getDocument, getFile, toString
createDocBuilder, createFactory, deleteNode, domToStr, domToStrNoXMLProlog, encodeAttributeValue, firstChild, fixXMl, getAttribute, getElement, getFirstChildElement, getFloatFromXML, getIntegerFromXML, getLastChildElement, getLongFromXML, getSchema, getStringFromXML, getStringFromXMLOrNull, getURLFromXML, getURLFromXMLOrNull, hasNode, parse, parse, parse, quoteXPathQuery, selectChildNodes, selectNodeList, selectSingleNode, strToDom, strToDom, strToDom, writeXML
public XBMCScraper(XBMCAddon addon, java.io.File scraperFile, java.lang.String point, Mode mode)
addon
- The addon been usedpoint
- The addon extension point for this scrapermode
- The mode this scraper is to be used forscraperFile
- The XML scraper filepublic Mode getMode()
public org.w3c.dom.Document getCreateSearchUrl(XBMCAddon rootAddon, java.lang.String searchTerm, java.lang.String year) throws XBMCException
rootAddon
- The root addon that required all the otherssearchTerm
- The search term to useyear
- The year to search for the result or empty string for anyXBMCException
- Thrown if their are any problems creating the search URLpublic org.w3c.dom.Document getGetSearchResults(XBMCAddon rootAddon, java.lang.String rawHtml, java.lang.String searchTerm) throws XBMCException
rootAddon
- The root addon that required all the othersrawHtml
- The raw search resultssearchTerm
- The term been searched forXBMCException
- Thrown if their are any problems creating the search urlXMLpublic org.w3c.dom.Document getGetDetails(XBMCAddon rootAddon, java.io.File file, java.lang.String... contents) throws XBMCException
rootAddon
- The root addon that required all the othersfile
- the file that the details are been retrieved for, or NULL if this is not knowncontents
- A list of webpage contentsXBMCException
- Thrown if their are any problemspublic org.w3c.dom.Document getEpisodeGuideUrl(XBMCAddon rootAddon, java.lang.String rawHtml) throws XBMCException
rootAddon
- The root addon that required all the othersrawHtml
- The show weppageXBMCException
- Thrown if their are any problempublic boolean getNfoUrl(XBMCAddon rootAddon, java.lang.String contents) throws XBMCException
rootAddon
- The root addon that required all the otherscontents
- The contents of a NFO fileXBMCException
- Thrown if their are any problemspublic org.w3c.dom.Document getGetEpisodeList(XBMCAddon rootAddon, java.lang.String html, java.net.URL showURL) throws XBMCException
rootAddon
- The root addon that required all the othershtml
- The contents of the episode listshowURL
- The URL used to fetch show infoXBMCException
- Thrown if their are any problemspublic java.lang.String executeXBMCScraperFunction(XBMCAddon rootAddon, java.lang.String functionName) throws XBMCException, XMLParserException
executeXBMCScraperFunction
in class XBMCExtension
rootAddon
- The root addon that required all the othersfunctionName
- The name of the function to executeXBMCException
- Thrown if their is a XBMC problemXMLParserException
- Thrown if their is a XML problempublic org.w3c.dom.Element findXBMCScraperFunction(XBMCAddon rootAddon, java.lang.String functionName) throws XBMCException, XMLParserException
findXBMCScraperFunction
in class XBMCExtension
rootAddon
- The root addon that required all the othersfunctionName
- The name of the function to executeXBMCException
- Thrown if their is a XBMC problemXMLParserException
- Thrown if their is a XML problempublic boolean supportsURL(XBMCAddon rootAddon, java.net.URL url) throws SourceException
url
- The NFO filerootAddon
- The root addon that required all the othersSourceException
- Thrown if their are any problemspublic org.w3c.dom.Document getGetEpisodeDetails(XBMCAddon rootAddon, java.lang.String contents, java.lang.String episodeId) throws XBMCException
contents
argument contains the downloaded
weppage of the episode details. The episode details URL is obtained by calling getGetEpisodeList(XBMCAddon, String, URL)
rootAddon
- The root addon that required all the otherscontents
- The downloaded HTML of the episode guideepisodeId
- The ID of the episode to get the details forXBMCException
- Thrown if their are any problems