fix: wrong creation of source types
This commit is contained in:
@@ -502,9 +502,18 @@ class Musify(Page):
|
||||
for video_container in video_container_list:
|
||||
iframe_list: List[BeautifulSoup] = video_container.findAll("iframe")
|
||||
for iframe in iframe_list:
|
||||
"""
|
||||
the url could look like this
|
||||
https://www.youtube.com/embed/sNObCkhzOYA?si=dNVgnZMBNVlNb0P_
|
||||
"""
|
||||
parsed_url = urlparse(iframe["src"])
|
||||
path_parts = parsed_url.path.strip("/").split("/")
|
||||
if path_parts[0] != "embed" or len(path_parts) < 2:
|
||||
continue
|
||||
|
||||
source_list.append(Source(
|
||||
SourceType.YOUTUBE,
|
||||
iframe["src"],
|
||||
ALL_SOURCE_TYPES.YOUTUBE,
|
||||
f"https://music.youtube.com/watch?v={path_parts[1]}",
|
||||
referrer_page=self.SOURCE_TYPE
|
||||
))
|
||||
|
||||
|
@@ -620,7 +620,7 @@ class YoutubeMusic(SuperYouTube):
|
||||
Artist(
|
||||
name=name,
|
||||
source_list=[Source(
|
||||
SourceType.YOUTUBE_MUSIC,
|
||||
self.SOURCE_TYPE,
|
||||
f"https://music.youtube.com/channel/{ydl_res.get('channel_id', ydl_res.get('uploader_id', ''))}"
|
||||
)]
|
||||
) for name in artist_names]
|
||||
@@ -641,7 +641,7 @@ class YoutubeMusic(SuperYouTube):
|
||||
artwork=Artwork(*ydl_res.get("thumbnails", [])),
|
||||
main_artist_list=artist_list,
|
||||
source_list=[Source(
|
||||
SourceType.YOUTUBE_MUSIC,
|
||||
self.SOURCE_TYPE,
|
||||
f"https://music.youtube.com/watch?v={ydl_res.get('id')}"
|
||||
), source],
|
||||
)
|
||||
|
Reference in New Issue
Block a user