apple music: add jp to supported locales
This commit is contained in:
parent
c5b8632015
commit
e34fed2c1d
1 changed files with 2 additions and 4 deletions
|
@ -39,7 +39,7 @@ class AppleMusic(AbstractSite):
|
|||
def get_localized_urls(self):
|
||||
return [
|
||||
f"https://music.apple.com/{locale}/album/{self.id_value}"
|
||||
for locale in ["hk", "tw", "us", "sg", "cn", "gb", "ca", "fr"]
|
||||
for locale in ["hk", "tw", "us", "sg", "jp", "cn", "gb", "ca", "fr"]
|
||||
]
|
||||
|
||||
def scrape(self):
|
||||
|
@ -88,9 +88,7 @@ class AppleMusic(AbstractSite):
|
|||
genre[0]
|
||||
] # apple treat "Music" as a genre. Thus, only the first genre is obtained.
|
||||
|
||||
images = (
|
||||
content.xpath("//source[@type='image/jpeg']/@srcset") if content else []
|
||||
)
|
||||
images = content.xpath("//source[@type='image/jpeg']/@srcset")
|
||||
image_elem: str = images[0] if images else "" # type:ignore
|
||||
image_url = image_elem.split(" ")[0] if image_elem else None
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue