mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 10:42:34 +01:00
chg: dev: fix error (#32)
* fix: dev: error * fix: dev: AttributeError when getting artist * fix: dev: typo on luscious parser
This commit is contained in:
parent
c4713404c8
commit
dcd573806e
@ -62,7 +62,10 @@ class LusciousAlbumExtractor(AsynchronousExtractor):
|
||||
("language", '<p>Language:', ' '),
|
||||
), values={"gallery-id": self.gid})[0]
|
||||
data["lang"] = util.language_to_code(data["language"] or "", None)
|
||||
data["artist"] = text.extract(data["tags"], "rtist: ", ",")[0] or None
|
||||
try:
|
||||
data["artist"] = text.extract(data["tags"], "rtist: ", ",")[0] or None
|
||||
except AttributeError:
|
||||
data["artist"] = None
|
||||
self.section = data["com"]
|
||||
del data["com"]
|
||||
return data
|
||||
|
@ -87,6 +87,8 @@ def code_to_language(code, default="English"):
|
||||
|
||||
def language_to_code(lang, default="en"):
|
||||
"""Map a language name to its ISO 639-1 code"""
|
||||
if lang is None:
|
||||
return None
|
||||
lang = lang.capitalize()
|
||||
for code, language in CODES.items():
|
||||
if language == lang:
|
||||
|
Loading…
Reference in New Issue
Block a user