From 9c53acf9803aae7eaa8af0bd364477d769eb59b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D1=82=D0=B0=D0=BB=D0=B8=D0=B9=20=D0=9A=D0=B2?= =?UTF-8?q?=D0=B0=D1=88=D0=B8=D0=BD?= Date: Sat, 5 Apr 2025 20:13:43 +0400 Subject: [PATCH] #48 Remove lyrics header information from the result for Genius provider --- .../Providers/Genius/GeniusProvider.cs | 9 + .../Genius/Resources/Lyrics_HtmlPage_01.txt | 1276 +++++++++-------- 2 files changed, 665 insertions(+), 620 deletions(-) diff --git a/LyricsScraperNET/Providers/Genius/GeniusProvider.cs b/LyricsScraperNET/Providers/Genius/GeniusProvider.cs index f5be658..6b66df9 100644 --- a/LyricsScraperNET/Providers/Genius/GeniusProvider.cs +++ b/LyricsScraperNET/Providers/Genius/GeniusProvider.cs @@ -25,6 +25,9 @@ public sealed class GeniusProvider : ExternalProviderBase // Format: "artist song". Example: "Parkway Drive Carrion". private const string GeniusSearchQueryFormat = "{0} {1}"; + // Lyrics header. Note: Should be skipped in result + private const string _lyricsHeaderNodesXPath = "//div[contains(@class, 'LyricsHeader')]"; + private const string _referentFragmentNodesXPath = "//a[contains(@class, 'ReferentFragmentVariantdesktop') or contains(@class, 'ReferentFragmentdesktop') or contains(@class, 'ReferentFragment-desktop')]"; private const string _lyricsContainerNodesXPath = "//div[@data-lyrics-container]"; @@ -179,6 +182,12 @@ private string GetParsedLyricFromHtmlPageBody(string htmlPageBody, out bool inst foreach (HtmlNode spanNode in spanNodes) spanNode.Remove(); + // Lyric's header node with additional information should be skipped. + var lyricsHeaderNodes = htmlDocument.DocumentNode.SelectNodes(_lyricsHeaderNodesXPath); + if (lyricsHeaderNodes != null) + foreach (HtmlNode headerNode in lyricsHeaderNodes) + headerNode.Remove(); + var lyricNodes = htmlDocument.DocumentNode.SelectNodes(_lyricsContainerNodesXPath); if (lyricNodes == null) { diff --git a/Tests/LyricsScraperNET.UnitTest/Providers/Genius/Resources/Lyrics_HtmlPage_01.txt b/Tests/LyricsScraperNET.UnitTest/Providers/Genius/Resources/Lyrics_HtmlPage_01.txt index 47489d6..c545af8 100644 --- a/Tests/LyricsScraperNET.UnitTest/Providers/Genius/Resources/Lyrics_HtmlPage_01.txt +++ b/Tests/LyricsScraperNET.UnitTest/Providers/Genius/Resources/Lyrics_HtmlPage_01.txt @@ -3,10 +3,10 @@ - + - - + + Iron Maiden – The Number of the Beast Lyrics | Genius Lyrics @@ -15,12 +15,12 @@ - + - + @@ -38,13 +38,6 @@ - - - @@ -118,8 +111,8 @@ g.o.observe({entryTypes:['longtask']})}}(); + - + - + - + @@ -1125,7 +1155,8 @@ window['_fs_namespace'] = 'FS'; + + -

The Number of the Beast Lyrics

How to Format Lyrics:

  • Type out all lyrics, even repeating song parts like the chorus
  • Lyrics should be broken down into individual lines
  • Use section headers above different song parts like [Verse], [Chorus], etc.
  • Use italics (<i>lyric</i>) and bold (<b>lyric</b>) to distinguish between different vocalists in the same song part
  • If you don’t understand a lyric, use [?]

To learn more, check out our transcription guide or visit our transcribers forum

About

Genius Annotation

This song was the band’s second single from their 1982 album. It was influenced by the 1978 horror movie Damien: Omen II, which is about the 13-year-old Antichrist. It is one of Iron Maiden’s most famous and one of heavy metal’s most recognizable songs.

+
Cover art for The Number of the Beast by Iron Maiden

The Number of the Beast

Producer
Mar. 22, 19821 viewer301.4K views

How to Format Lyrics:

  • Type out all lyrics, even repeating song parts like the chorus
  • Lyrics should be broken down into individual lines
  • Use section headers above different song parts like [Verse], [Chorus], etc.
  • Use italics (<i>lyric</i>) and bold (<b>lyric</b>) to distinguish between different vocalists in the same song part
  • If you don’t understand a lyric, use [?]

To learn more, check out our transcription guide or visit our transcribers forum

About

Genius Annotation

This song was the band’s second single from their 1982 album. It was influenced by the 1978 horror movie Damien: Omen II, which is about the 13-year-old Antichrist. It is one of Iron Maiden’s most famous and one of heavy metal’s most recognizable songs.

Basically, this song is about a dream. It’s not about devil worship.

@@ -1173,20 +1207,22 @@ window['_fs_namespace'] = 'FS';

During the recording of the album, there were rumors floating about that supernatural occurrences had been going on in the studio, such as lights flipping on and off, strange noises and visions of Satan, that culminated in a car accident their producer Martin Birch was involved, the bill of which was 666 GBP. This was used as evidence that Satan and the Antichrist had a hand in making this. Many preachers and enemies of rock music were led to believe Maiden were Satanists because of the song’s title. Steve Harris replied: “They completely got the wrong end of the stick. They obviously hadn’t read the lyrics. They just wanted to believe all that rubbish about us being Satanists.”

-

Bruce Dickinson’s high-pitched scream at the end of the intro was a result of producer Martin Birch forcing the band to replay the intro several times. Dickinson became so fed up with the constant repeats that he emitted the scream out of frustration, and it fit so well that the band decided to keep it.

Q&A

Find answers to frequently asked questions about the song and explore its deeper meaning

What did Iron Maiden say about "The Number of the Beast"?
Genius Answer
+

Bruce Dickinson’s high-pitched scream at the end of the intro was a result of producer Martin Birch forcing the band to replay the intro several times. Dickinson became so fed up with the constant repeats that he emitted the scream out of frustration, and it fit so well that the band decided to keep it.

Q&A

Find answers to frequently asked questions about the song and explore its deeper meaning

What did Iron Maiden say about "The Number of the Beast"?
Genius Answer

They completely got the wrong end of the stick. They obviously hadn’t read the lyrics. They just wanted to believe all that rubbish about us being Satanists.

Basically, this song is about a dream. It’s not about devil worship.

-

—Steve Harris, composer, about complaints of the supposed satanic meaning of the song

which bible did steve harris use for number of the beast
Genius Answer

If you mean which verse is being referenced in the opening passage of the song, then it’s: Revelation 13:18 from the final ‘Book’ in the ‘New Testament’.

+

—Steve Harris, composer, about complaints of the supposed satanic meaning of the song

which bible did steve harris use for number of the beast
Genius Answer

If you mean which verse is being referenced in the opening passage of the song, then it’s: Revelation 13:18 from the final ‘Book’ in the ‘New Testament’.

Also known as: ‘Book of Revelation,’ ‘Revelation to John,’ ‘Apocalypse of John’.

-

It’s often misquoted as Revelations.

Credits
Producer
Mastering Engineer
Illustration
Manufacturer
Phonographic Copyright ℗
Recorded At
Battery Studios, London, England
Released on
March 22, 1982
View The Number of the Beast samples
Tags
Comments
Sign Up And Drop Knowledge 🤓
Genius is the ultimate source of music knowledge, created by scholars like you who share facts and insight about the songs and artists they love.
+

It’s often misquoted as Revelations.

Is there a live performance of "The Number of the Beast" by Iron Maiden?
Genius Answer

+ +
Credits
Producer
Co-Producer
Copyright ©
Mastering Engineer
Illustration
Manufacturer
Phonographic Copyright ℗
Recorded At
Battery Studios, London, England
Released on
March 22, 1982
View The Number of the Beast samples
Tags
Comments