Skip to content

Commit

Permalink
Update musicyt.py
Browse files Browse the repository at this point in the history
  • Loading branch information
CheapNightbot committed Dec 9, 2024
1 parent 650e521 commit fdb49e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions yutify/musicyt.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ def _get_song(self, result: dict) -> None:

try:
song_data = self.ytmusic.get_song(video_id)
except exceptions.YTMusicServerError:
song_data = {}
else:
release_date = (
song_data.get("microformat")
.get("microformatDataRenderer")
Expand All @@ -107,8 +110,6 @@ def _get_song(self, result: dict) -> None:
# Get the index of "T" and slice the string after that or only get string before "T".
# For example, "2016-10-18T11:00:03-07:00" will become "2016-10-18"
release_date: str = release_date[: release_date.index("T")]
except exceptions.YTMusicServerError:
song_data = {}

try:
lyrics = self.ytmusic.get_lyrics(lyrics_id.get("lyrics"))
Expand Down

0 comments on commit fdb49e8

Please sign in to comment.