diff --git a/src/MediaWiki.ts b/src/MediaWiki.ts index bbaa26af..5396ee6e 100644 --- a/src/MediaWiki.ts +++ b/src/MediaWiki.ts @@ -44,10 +44,10 @@ class MediaWiki { public queryOpts: QueryOpts #wikiPath: string - #restApiPath: string + #apiPath: string #username: string #password: string - #apiPath: string + #apiActionPath: string #domain: string private apiUrlDirector: ApiURLDirector private wikimediaDesktopUrlDirector: DesktopURLDirector @@ -75,12 +75,12 @@ class MediaWiki { this.#password = value } - set apiPath(value: string) { - this.#apiPath = value + set apiActionPath(value: string) { + this.#apiActionPath = value } - set restApiPath(value: string) { - this.#restApiPath = value + set apiPath(value: string) { + this.#apiPath = value } set domain(value: string) { @@ -109,7 +109,7 @@ class MediaWiki { this.namespaces = {} this.namespacesToMirror = [] - this.#apiPath = 'w/api.php' + this.#apiActionPath = 'w/api.php' this.#wikiPath = 'wiki/' this.apiCheckArticleId = 'MediaWiki:Sidebar' @@ -179,11 +179,11 @@ class MediaWiki { private initMWApis() { const baseUrlDirector = new BaseURLDirector(this.baseUrl.href) this.webUrl = baseUrlDirector.buildURL(this.#wikiPath) - this.apiUrl = baseUrlDirector.buildURL(this.#apiPath) + this.apiUrl = baseUrlDirector.buildURL(this.#apiActionPath) this.apiUrlDirector = new ApiURLDirector(this.apiUrl.href) this.visualEditorApiUrl = this.apiUrlDirector.buildVisualEditorURL() - this.desktopApiUrl = baseUrlDirector.buildDesktopApiUrl(this.#restApiPath) - this.mobileApiUrl = baseUrlDirector.buildMobileApiUrl(this.#restApiPath) + this.desktopApiUrl = baseUrlDirector.buildDesktopApiUrl(this.#apiPath) + this.mobileApiUrl = baseUrlDirector.buildMobileApiUrl(this.#apiPath) this.modulePath = baseUrlDirector.buildModuleURL(this._modulePathOpt) this.wikimediaDesktopUrlDirector = new DesktopURLDirector(this.desktopApiUrl.href) this.wikimediaMobileUrlDirector = new MobileURLDirector(this.mobileApiUrl.href) @@ -412,7 +412,7 @@ class MediaWiki { webUrlPath: this.webUrl.pathname, wikiPath: this.#wikiPath, baseUrl: this.baseUrl.href, - apiPath: this.#apiPath, + apiActionPath: this.#apiActionPath, domain: this.#domain, textDir: textDir as TextDirection, diff --git a/src/mwoffliner.lib.ts b/src/mwoffliner.lib.ts index 752ddbec..0fb4f223 100644 --- a/src/mwoffliner.lib.ts +++ b/src/mwoffliner.lib.ts @@ -75,8 +75,8 @@ async function execute(argv: any) { keepEmptyParagraphs, mwUrl, mwWikiPath, + mwActionApiPath, mwApiPath, - mwRestApiPath, mwModulePath, mwDomain, mwUsername, @@ -158,8 +158,8 @@ async function execute(argv: any) { /* Wikipedia/... URL; Normalize by adding trailing / as necessary */ MediaWiki.base = mwUrl MediaWiki.getCategories = !!argv.getCategories + MediaWiki.apiActionPath = mwActionApiPath MediaWiki.apiPath = mwApiPath - MediaWiki.restApiPath = mwRestApiPath MediaWiki.modulePathOpt = mwModulePath MediaWiki.domain = mwDomain MediaWiki.password = mwPassword diff --git a/src/parameterList.ts b/src/parameterList.ts index 6f31e797..eee869e4 100644 --- a/src/parameterList.ts +++ b/src/parameterList.ts @@ -17,8 +17,8 @@ export const parameterDescriptions = { 'Specify a flavour for the scraping. If missing, scrape all article contents. Each --format argument will cause a new local file to be created but options can be combined. Supported options are:\n * novid: no video & audio content\n * nopic: no pictures (implies "novid")\n * nopdf: no PDF files\n * nodet: only the first/head paragraph (implies "novid")\nFormat names can also be aliased using a ":"\nExample: "... --format=nopic:mini --format=novid,nopdf"', keepEmptyParagraphs: 'Keep all paragraphs, even empty ones.', mwWikiPath: 'Mediawiki wiki base path (per default "/wiki/")', - mwApiPath: 'Mediawiki API path (per default "/w/api.php")', - mwRestApiPath: 'Mediawiki Rest API path (per default "/api/rest_v1")', + mwActionApiPath: 'Mediawiki action API path (per default "/w/api.php")', + mwApiPath: 'Mediawiki Rest API path (per default "/api/rest_v1")', mwModulePath: 'Mediawiki module load path (per default "/w/load.php")', mwDomain: 'Mediawiki user domain (thought for private wikis)', mwUsername: 'Mediawiki username (thought for private wikis)', diff --git a/src/types.d.ts b/src/types.d.ts index 9e25f752..00856ca6 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -159,7 +159,7 @@ interface MWMetaData { baseUrl: string wikiPath: string - apiPath: string + apiActionPath: string domain: string webUrl: string apiUrl: string @@ -178,8 +178,8 @@ interface MWNamespaces { interface MWConfig { base: string wikiPath?: string + apiActionPath?: string apiPath?: string - restApiPath?: string domain?: string username?: string password?: string