Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[script.cu.lrclyrics] 6.6.2 #2551

Merged
merged 1 commit into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions script.cu.lrclyrics/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.cu.lrclyrics" name="CU LRC Lyrics" version="6.5.2" provider-name="Taxigps, ronie">
<addon id="script.cu.lrclyrics" name="CU LRC Lyrics" version="6.6.2" provider-name="Taxigps, ronie">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.beautifulsoup4" version="4.8.2+matrix.1"/>
Expand Down Expand Up @@ -80,6 +80,6 @@
<assets>
<icon>resources/icon.png</icon>
</assets>
<news>- remove invalid characters from filenames</news>
<news>- fixed broken scrapers and added new ones</news>
</extension>
</addon>
13 changes: 13 additions & 0 deletions script.cu.lrclyrics/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
v6.6.1
- add supermusic scraper

v6.6.0
- removed minilyrics
- removed gomaudio
- fixed lyricsify
- fixed lyricscom
- fixed azlyrics
- added lrclib
- added megalobiz
- added musixmatch lrc

v6.5.2
- remove invalid characters from filenames

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_lyrics(self, song):
return None
req.close()
try:
lyricscode = response.split('. -->')[1].split('</div')[0]
lyricscode = response.split('t. -->')[1].split('</div')[0]
lyricstext = html.unescape(lyricscode).replace('<br />', '\n')
lyr = re.sub('<[^<]+?>', '', lyricstext)
lyrics.lyrics = lyr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
pass

__title__ = 'darklyrics'
__priority__ = '250'
__priority__ = '260'
__lrc__ = False


Expand Down
1 change: 0 additions & 1 deletion script.cu.lrclyrics/lib/culrcscrapers/gomaudio/__init__.py

This file was deleted.

101 changes: 0 additions & 101 deletions script.cu.lrclyrics/lib/culrcscrapers/gomaudio/lyricsScraper.py

This file was deleted.

13 changes: 7 additions & 6 deletions script.cu.lrclyrics/lib/culrcscrapers/lyricscom/lyricsScraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,41 @@ class LyricsFetcher:
def __init__(self, *args, **kwargs):
self.DEBUG = kwargs['debug']
self.settings = kwargs['settings']
self.url = 'http://www.lyrics.com/serp.php?st=%s&qtype=2'
self.url = 'https://www.lyrics.com/serp.php?st=%s&qtype=2'

def get_lyrics(self, song):
sess = requests.Session()
log('%s: searching lyrics for %s - %s' % (__title__, song.artist, song.title), debug=self.DEBUG)
lyrics = Lyrics(settings=self.settings)
lyrics.song = song
lyrics.source = __title__
lyrics.lrc = __lrc__
try:
request = requests.get(self.url % urllib.parse.quote_plus(song.artist), timeout=10)
request = sess.get(self.url % urllib.parse.quote_plus(song.artist), timeout=10)
response = request.text
except:
return
soup = BeautifulSoup(response, 'html.parser')
url = ''
for link in soup.find_all('a'):
if link.string and link.get('href').startswith('artist/'):
url = 'http://www.lyrics.com/' + link.get('href')
url = 'https://www.lyrics.com/' + link.get('href')
break
if url:
try:
req = requests.get(url, timeout=10)
req = sess.get(url, timeout=10)
resp = req.text
except:
return
soup = BeautifulSoup(resp, 'html.parser')
url = ''
for link in soup.find_all('a'):
if link.string and (difflib.SequenceMatcher(None, link.string.lower(), song.title.lower()).ratio() > 0.8):
url = 'http://www.lyrics.com' + link.get('href')
url = 'https://www.lyrics.com' + link.get('href')
break
if url:
try:
req2 = requests.get(url, timeout=10)
req2 = sess.get(url, timeout=10)
resp2 = req2.text
except:
return
Expand Down
13 changes: 6 additions & 7 deletions script.cu.lrclyrics/lib/culrcscrapers/lyricsify/lyricsScraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class LyricsFetcher:
def __init__(self, *args, **kwargs):
self.DEBUG = kwargs['debug']
self.settings = kwargs['settings']
self.SEARCH_URL = 'https://www.lyricsify.com/search?q=%s'
self.SEARCH_URL = 'https://www.lyricsify.com/lyrics/%s/%s'
self.LYRIC_URL = 'https://www.lyricsify.com%s'

def get_lyrics(self, song):
Expand All @@ -29,19 +29,18 @@ def get_lyrics(self, song):
lyrics.song = song
lyrics.source = __title__
lyrics.lrc = __lrc__
artist = song.artist.replace(' ', '+')
title = song.title.replace(' ', '+')
search = '%s+%s' % (artist, title)
artist = song.artist.replace(' ', '-')
title = song.title.replace(' ', '-')
try:
url = self.SEARCH_URL % search
url = self.SEARCH_URL % (artist, title)
search = requests.get(url, headers=UserAgent, timeout=10)
response = search.text
except:
return None
links = []
soup = BeautifulSoup(response, 'html.parser')
for link in soup.find_all('a'):
if link.string and link.get('href').startswith('/lyrics/'):
if link.string and link.get('href').startswith('/lrc/'):
foundartist = link.string.split(' - ', 1)[0]
# some links don't have a proper 'artist - title' format
try:
Expand Down Expand Up @@ -69,7 +68,7 @@ def get_lyrics_from_list(self, link):
response = search.text
except:
return None
matchcode = re.search('div id="entry">(.*?)<div', response, flags=re.DOTALL)
matchcode = re.search('/h3>(.*?)</div', response, flags=re.DOTALL)
if matchcode:
lyricscode = (matchcode.group(1))
cleanlyrics = re.sub('<[^<]+?>', '', lyricscode)
Expand Down

This file was deleted.

Loading
Loading