44from bs4 import BeautifulSoup
55
66
7- def get_cover (url , width , height , format = "jpg" , crop_option = "" ):
7+ def get_cover (url , width , height , img_format = "jpg" , crop_option = "" ):
88 """
99 Generate a full Apple Music artwork URL with proper width, height, format, and crop settings.
1010
@@ -16,8 +16,8 @@ def get_cover(url, width, height, format="jpg", crop_option=""):
1616 Target width of the image.
1717 height : int or str
1818 Target height of the image.
19- format : str, optional
20- Image format (jpg, png, etc.). Defaults to ` "jpg"` .
19+ img_format : str, optional
20+ Image format (jpg, png, etc.). Defaults to "jpg".
2121 crop_option : str, optional
2222 Cropping mode used by Apple Music artwork URLs. Defaults to empty string.
2323
@@ -39,7 +39,7 @@ def get_cover(url, width, height, format="jpg", crop_option=""):
3939 url .replace ("{w}" , str (width ))
4040 .replace ("{h}" , str (height ))
4141 .replace ("{c}" , crop_option )
42- .replace ("{f}" , format )
42+ .replace ("{f}" , img_format )
4343 )
4444 return new_url
4545 except (TypeError , AttributeError ):
0 commit comments