Class WebEngine
java.lang.Object
com.biglybt.core.metasearch.impl.EngineImpl
com.biglybt.core.metasearch.impl.web.WebEngine
- All Implemented Interfaces:
Engine
- Direct Known Subclasses:
JSONEngine
,RegexEngine
,RSSEngine
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
private String
private static final boolean
private boolean
private String
private static final Pattern
private static final Pattern
private DateParser
private String
private String
private String
private String
private String
private FieldMapping[]
private static final boolean
private boolean
private String[]
private String
private static final Pattern
private static int
private String
private String
private String
Fields inherited from class com.biglybt.core.metasearch.impl.EngineImpl
LD_AUTO_DL_SUPPORTED, LD_COOKIES, LD_CREATED_BY_ME, LD_ETAG, LD_LAST_MODIFIED, LD_LAST_UPDATE_CHECK, LD_LINK_IS_TORRENT, LD_UPDATE_CHECK_SECS
Fields inherited from interface com.biglybt.core.metasearch.Engine
AUTO_DL_SUPPORTED_NO, AUTO_DL_SUPPORTED_UNKNOWN, AUTO_DL_SUPPORTED_YES, AZ_VERSION, CT_AUDIO, CT_GAME, CT_VIDEO, ENGINE_SOURCE_LOCAL, ENGINE_SOURCE_RSS, ENGINE_SOURCE_STRS, ENGINE_SOURCE_UNKNOWN, ENGINE_SOURCE_VUZE, ENGINE_TYPE_JSON, ENGINE_TYPE_PLUGIN, ENGINE_TYPE_REGEX, ENGINE_TYPE_RSS, ENGINE_TYPE_STRS, FIELD_ASSET_DATE, FIELD_CATEGORY, FIELD_CDPLINK, FIELD_COMMENTS, FIELD_CONTENT_TYPE, FIELD_DATE, FIELD_DISCARD, FIELD_DOWNLOADBTNLINK, FIELD_DRMKEY, FIELD_HASH, FIELD_IDS, FIELD_NAME, FIELD_NAMES, FIELD_PEERS, FIELD_PLAYLINK, FIELD_PRIVATE, FIELD_RANK, FIELD_SEEDS, FIELD_SIZE, FIELD_SUPERSEEDS, FIELD_TORRENTLINK, FIELD_VOTES, FIELD_VOTES_DOWN, SC_BATCH_PERIOD, SC_FORCE_FULL, SC_REMOVE_DUP_HASH, SC_SOURCE, SEL_STATE_AUTO_SELECTED, SEL_STATE_DESELECTED, SEL_STATE_FORCE_DESELECTED, SEL_STATE_MANUAL_SELECTED, SEL_STATE_STRINGS, VUZE_FILE_COMPONENT_ENGINE_KEY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionWebEngine
(MetaSearchImpl meta_search, int type, long id, long last_updated, float rank_bias, String name, String searchURLFormat, String timeZone, boolean automaticDateParser, String userDateFormat, FieldMapping[] mappings, boolean needs_auth, String auth_method, String login_url, String[] required_cookies) protected
WebEngine
(MetaSearchImpl meta_search, int type, long id, long last_updated, float rank_bias, String name, JSONObject map) protected
WebEngine
(MetaSearchImpl meta_search, Map map) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
exportToBencodedMap
(Map map, boolean generic) protected void
protected String
protected String
protected DateParser
getIcon()
protected FieldMapping[]
String[]
protected String
getSearchUrl
(boolean raw) getString
(boolean full) protected WebEngine.pageDetails
getWebPageContent
(SearchParameter[] searchParameters, Map<String, String> searchContext, String headers, boolean only_if_modified) protected WebEngine.pageDetails
getWebPageContent
(SearchParameter[] searchParameters, Map<String, String> searchContext, String headers, boolean only_if_modified, WebEngine.pageDetailsVerifier verifier) private WebEngine.pageDetails
getWebPageContentSupport
(Proxy proxy, String proxy_host, String searchURL, SearchParameter[] searchParameters, Map<String, String> searchContext, String headers, boolean only_if_modified) protected void
init()
boolean
boolean
boolean
boolean
boolean
void
setCookies
(String cookies) protected void
setHeaders
(ResourceDownloader rd, String encoded_headers) void
setLoginPageUrl
(String loginPageUrl) protected void
setNeedsAuth
(boolean b) void
setRequiredCookies
(String[] requiredCookies) void
setSearchUrl
(String str) boolean
supportsContext
(String context_key) boolean
supportsField
(int field_id) Methods inherited from class com.biglybt.core.metasearch.impl.EngineImpl
addPotentialAssociation, allocateUID, applyRankBias, checkSelectionStateRecorded, configDirty, debugLog, debugStart, delete, exportBEncodedMappings, exportJSONMappings, exportToJSONString, exportToVuzeFile, exportToVuzeFile, exportToVuzeFile, getAutoDownloadSupported, getAZVersion, getDebugFile, getId, getLastUpdateCheck, getLastUpdated, getLocalBoolean, getLocalLong, getLocalString, getMetaSearch, getName, getPreferredWeighting, getRankBias, getSelectionState, getSource, getSubscription, getType, getUID, getUpdateCheckSecs, getUpdateURL, getUserData, getVersion, importBEncodedMappings, importFromBEncodedMap, importFromJSONString, importJSONMappings, isActive, isMine, isPublic, log, log, mapResults, recordSelectionState, reset, sameLogicAs, search, searchAndMap, searchSupport, setDefaultUpdateCheckSecs, setId, setLastUpdateCheck, setLocalBoolean, setLocalLong, setLocalString, setLocalUpdateCheckSecs, setMine, setName, setPreferredDelta, setPublic, setRankBias, setSelectionState, setSource, setUID, setUpdateURL, setUserData, setVersion, vuzeFieldToID, vuzeIDToField
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.core.metasearch.Engine
exportToBencodedMap, exportToBencodedMap
-
Field Details
-
AM_TRANSPARENT
- See Also:
-
AM_PROXY
- See Also:
-
NEEDS_AUTH_DEFAULT
private static final boolean NEEDS_AUTH_DEFAULT- See Also:
-
AUTOMATIC_DATE_PARSER_DEFAULT
private static final boolean AUTOMATIC_DATE_PARSER_DEFAULT- See Also:
-
baseTagPattern
-
rootURLPattern
-
baseURLPattern
-
search_timeout_secs
private static int search_timeout_secs -
searchURLFormat
-
timeZone
-
automaticDateParser
private boolean automaticDateParser -
userDateFormat
-
downloadLinkCSS
-
mappings
-
rootPage
-
basePage
-
dateParser
-
needsAuth
private boolean needsAuth -
authMethod
-
loginPageUrl
-
iconUrl
-
requiredCookies
-
fullCookies
-
local_cookies
-
-
Constructor Details
-
WebEngine
public WebEngine(MetaSearchImpl meta_search, int type, long id, long last_updated, float rank_bias, String name, String searchURLFormat, String timeZone, boolean automaticDateParser, String userDateFormat, FieldMapping[] mappings, boolean needs_auth, String auth_method, String login_url, String[] required_cookies) -
WebEngine
- Throws:
IOException
-
WebEngine
protected WebEngine(MetaSearchImpl meta_search, int type, long id, long last_updated, float rank_bias, String name, JSONObject map) throws IOException - Throws:
IOException
-
-
Method Details
-
exportToBencodedMap
- Overrides:
exportToBencodedMap
in classEngineImpl
- Throws:
IOException
-
exportToJSONObject
- Overrides:
exportToJSONObject
in classEngineImpl
- Throws:
IOException
-
init
protected void init() -
getNameEx
-
getReferer
-
supportsContext
-
isAnonymous
public boolean isAnonymous() -
getWebPageContent
protected WebEngine.pageDetails getWebPageContent(SearchParameter[] searchParameters, Map<String, String> searchContext, String headers, boolean only_if_modified) throws SearchException- Throws:
SearchException
-
getWebPageContent
protected WebEngine.pageDetails getWebPageContent(SearchParameter[] searchParameters, Map<String, String> searchContext, String headers, boolean only_if_modified, WebEngine.pageDetailsVerifier verifier) throws SearchException- Throws:
SearchException
-
getWebPageContentSupport
private WebEngine.pageDetails getWebPageContentSupport(Proxy proxy, String proxy_host, String searchURL, SearchParameter[] searchParameters, Map<String, String> searchContext, String headers, boolean only_if_modified) throws SearchException- Throws:
SearchException
-
extractProperty
-
setHeaders
-
getIcon
-
getMappings
-
supportsField
public boolean supportsField(int field_id) -
getRootPage
-
getBasePage
-
getDateParser
-
getDownloadLinkCSS
-
requiresLogin
public boolean requiresLogin() -
setCookies
-
getSearchUrl
-
getSearchUrl
-
setSearchUrl
-
getLoginPageUrl
-
setLoginPageUrl
-
getRequiredCookies
-
setRequiredCookies
-
isNeedsAuth
public boolean isNeedsAuth() -
isAuthenticated
public boolean isAuthenticated()- Specified by:
isAuthenticated
in interfaceEngine
- Overrides:
isAuthenticated
in classEngineImpl
-
setNeedsAuth
protected void setNeedsAuth(boolean b) -
getAuthMethod
-
getCookies
-
getString
- Specified by:
getString
in interfaceEngine
- Overrides:
getString
in classEngineImpl
-
getString
- Overrides:
getString
in classEngineImpl
-