Note: I am a completely beginner in YAML and I have not understood why and how YAML yet. So, my question may contain some irrelevant content to YAML. Excuse me and please correct them.
In a music player (MusicBee), I found a plugin which fetches the lyrics for songs. How the lyric is fetched from the lyric provider is written in a YAML file (yml). And as an example the lyrics from the AZLyrics fetched by the following yml file;
name: A-Z Lyrics Universe
url: "http://www.azlyrics.com/lyrics/{artist}/{title}.html"
extractor: '(?s)<div>\s+<!--\s+Usage.*?\s+-->(?P<lyrics>.+?)<\/div>'
headers:
- name: User-Agent
value: 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0' # Firefox 30 Win x64 user agent
variables:
- &artist
name: artist
filters:
- [lowercase]
- [strip_nonascii]
- <<: *artist
name: title
filters:
- [strip_html]
- [trim]
- [utf8_encode]
Here the URL of the lyric is directly given by;
http://www.azlyrics.com/lyrics/{artist}/{title}.html
But this is my problem. Instead using the above link I need to do a simple google search as
https://www.google.lk/search?q={artist}+{title}+azlyrics+lyrics
and grab the first URL from the searched result and then use it as the URL of the lyric.
Questions:
- Does YAML, able to do the task that I need to do?
- If yes, How can I do it? How to deal with google results?
- If no, Can you give me any suggestions, what is the path I have to go to do my task?
Note: Heres, the source code of the given plugin.