Help creating a tag source for Litres.com

Hi, i tried creating a source file but failed. (and maybe posting this to a wrong place) but is it possible to get help creating a source for litres.com

as far as failed, that is about how far i went before i figured out that i am over my head..
[Name]=LitRes
[BasedOn]=sitename(cause it will not allow me put links here)
[IndexUrl]=sitename(cause it will not allow me put links here)%s
[AlbumUrl]=sitename(cause it will not allow me put links here)
[WordSeparator]=+
[Encoding]=url-utf-8
[UserAgent]=1
[IndexFormat]=%_preview%|%_url%|% ↓ Release Date%|% ↓ Title%|% ↓ Author%
#remove everything inside ()
[SearchBy]=Enter Album Name||$regexp(%album%,'([^)]*)',,1)||%s
[Encoding]=url-utf-8
[UserAgent]=1

It would possible helpers if you could show what you have tried so far and perhaps point out particular error messages or unexpected results.
Also, links to an API for that site and/or its documentation would help.
All this would still not guarantee that someone is willing to spend the effort.

A very quick primer about WS scripting:
on litres.com, searching for a term like "hello world", returns a series of query results; the URL of the page of these results is Search results for books: «hello world».

From this url you can get some useful info for the initial scripting fields:

  • the url for a search is https://litres.com/search/, with an argument ?q= for a query string ("hello world")
  • the word separator used in the query string is +, so that is what should be used
  • in Windows, you can get a preview of the raw data, by opening the search URL in a text editor. In plain Notepad (my personal preference) going to File > Open and (literally) pasting https://litres.com/search/?q=hello+world in the file name box will open the html code for the search results' page. This code text is what you / your script will be working with.

Applying this to your previous script:

---------
[Name]=LitRes
[BasedOn]=litres.com
[IndexUrl]=https://litres.com/search/?q=%s
[AlbumUrl]=(for later)
[WordSeparator]=+
[Encoding]=url-utf-8
[UserAgent]=1
[IndexFormat]=%_preview%|%_url%|% ↓ Release Date%|% ↓ Title%|% ↓ Author%

[SearchBy]=Enter Album Name||hello world||%s
[Encoding]=url-utf-8
[UserAgent]=1

[ParserScriptIndex]=...
Debug "on" "test.txt"
--------

if you copy the above into a .src file and run it in Mp3Tag, you'll get a query input prefilled with "hello world"; by searching it, you'll get..... no results.

BUT, if you go to your Mp3Tag folder, you should find a 'test.txt' debug output file (for Windows only) with the following:

Use DebugWriteInput to inspect the original input data.
------------------------------------------------------------

Output         : ><

Line and position:
<!DOCTYPE html><html lang="en-US"><script>if(typeof window.MutationObserver==='undefined'||typeof window.IntersectionObserver==='undefined'||typeof window.ResizeObserver==='undefined'||typeof window.globalThis==='undefined'||typeof window.Intl==='undefined'||typeof window.Intl.DateTimeFormat==='undefined'){document.write('<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?version=4.8.0&features=MutationObserver%2CIntersectionObserver%2CResizeObserver%2CglobalThis%2CIntl.DateTimeFormat.~locale.ru"></scr'+'ipt>')}
^

------------------------------------------------------------

Total output:
 output["CurrentUrl"]= "https://litres.com/search/?q=hello+world"
 output["Output"]= ""
 output["Error"]= "<OK>"

If you compare the line with "<!DOCTYPE html>...." with the html code from Notepad, you'll find that it matches the first line of text.

Congratulations- You got a hit!

The reason Mp3Tag didn't find 'any results' is because [ParserScriptIndex] is (almost) empty, so there are no commands to process and return results, and nothing is returned -except the debug output file.

This is a bare minimum introduction to how a WS script works.
It is now up to you to use the various commands to collect the necessary information from the raw data and make it recognized by Mp3Tag.

Good luck. :+1: