Downloading from youtube gives exception and does not work #3

Closed
opened 2025-09-29 13:59:10 +00:00 by sem · 1 comment
Owner

Downloading from youtube gives exception. Because of that, the script cancels and the song gets added without any metadata
image.png

Downloading from youtube gives exception. Because of that, the script cancels and the song gets added without any metadata <img width="557" alt="image.png" src="attachments/dd9e9041-c36e-4d19-b2d2-ad2acaa340fe">
Author
Owner

Also when downloading a youtube song, the tag doesn't get passed correctly:

song used: https://youtu.be/KW-9pAWqZ8Y?si=oZ33SmpShfMtHkQt

Downloading youtube song https://youtu.be/KW-9pAWqZ8Y?si=oZ33SmpShfMtHkQt
[youtube] Extracting URL: https://youtu.be/KW-9pAWqZ8Y?si=oZ33SmpShfMtHkQt
Downloading youtube song https://youtu.be/KW-9pAWqZ8Y?si=oZ33SmpShfMtHkQt
[youtube] KW-9pAWqZ8Y: Downloading webpage
WARNING: [youtube] No supported JavaScript runtime could be found. YouTube extraction without a JS runtime has been deprecated, and some formats may be missing. See  https://github.com/yt-dlp/yt-dlp/wiki/EJS  for details on installing one. To silence this warning, you can use  --extractor-args "youtube:player_client=default"
[youtube] KW-9pAWqZ8Y: Downloading android sdkless player API JSON
[youtube] KW-9pAWqZ8Y: Downloading web safari player API JSON
WARNING: [youtube] KW-9pAWqZ8Y: Some web_safari client https formats have been skipped as they are missing a url. YouTube is forcing SABR streaming for this client. See  https://github.com/yt-dlp/yt-dlp/issues/12482  for more details
[youtube] KW-9pAWqZ8Y: Downloading m3u8 information
WARNING: [youtube] KW-9pAWqZ8Y: Some web client https formats have been skipped as they are missing a url. YouTube is forcing SABR streaming for this client. See  https://github.com/yt-dlp/yt-dlp/issues/12482  for more details
[info] KW-9pAWqZ8Y: Downloading 1 format(s): 251
[download] Sleeping 6.00 seconds as required by the site...
[download] Destination: ishikinonaikranke - Topic - 灼けても尚.webm
[download] 100% of    4.53MiB in 00:00:00 at 20.78MiB/s    
[ExtractAudio] Destination: ishikinonaikranke - Topic - 灼けても尚.mp3
Deleting original file ishikinonaikranke - Topic - 灼けても尚.webm (pass -k to keep)
2026-01-15 08:46 - INFO - [main:654] - ------------------------------------------------
2026-01-15 08:46 - INFO - [main:655] - ishikinonaikranke - Topic - 灼けても尚.mp3
2026-01-15 08:46 - INFO - [main:674] - <class 'mutagen.mp3.MP3'>
2026-01-15 08:46 - INFO - [main:703] - No valid title found in TTI2 tag, using name ishikinonaikranke - Topic - 灼けても尚.mp3
2026-01-15 08:46 - INFO - [check_title_songname:223] - checking title by name ishikinonaikranke - Topic - 灼けても尚.mp3
2026-01-15 08:46 - INFO - [check_title_songname:227] - file has extension mp3. removing it from title. New title: ishikinonaikranke - Topic - 灼けても尚
2026-01-15 08:46 - INFO - [check_title_songname:232] - song title has more than 1 part after the -: ['ishikinonaikranke', 'Topic', '灼けても尚']
2026-01-15 08:46 - INFO - [check_title_songname:240] - title: Topic
2026-01-15 08:46 - INFO - [main:708] - No valid artist found, checking for artist by songname of the file (ishikinonaikranke - Topic - 灼けても尚.mp3)
2026-01-15 08:46 - INFO - [check_artist_songname:285] - Checking artist by name. items: ['ishikinonaikranke', 'Topic', '灼けても尚.mp3']
2026-01-15 08:46 - INFO - [check_for_multiple_artists:259] - checking for multiple artists for name ishikinonaikranke
2026-01-15 08:46 - INFO - [check_for_multiple_artists:279] - no multiple artists found in name ishikinonaikranke
2026-01-15 08:46 - INFO - [check_spotify_and_save:495] - Searching spotify for file ishikinonaikranke - Topic - 灼けても尚.mp3
2026-01-15 08:46 - ERROR - [main:737] - could not find track on spotify: 'TPE2'
Traceback (most recent call last):
  File "/home/sem/music-tools/make_folders.py", line 773, in <module>
    main()
  File "/home/sem/music-tools/make_folders.py", line 745, in main
    logging.info("valid artist found. making folder for artist " + str(audio["TPE1"]))
                                                                       ~~~~~^^^^^^^^
  File "/home/sem/music-tools/.env/lib/python3.12/site-packages/mutagen/_file.py", line 63, in __getitem__
    return self.tags[key]
           ~~~~~~~~~^^^^^
  File "/home/sem/music-tools/.env/lib/python3.12/site-packages/mutagen/_util.py", line 537, in __getitem__
    return self.__dict[key]
           ~~~~~~~~~~~^^^^^
KeyError: 'TPE1'
Also when downloading a youtube song, the tag doesn't get passed correctly: song used: https://youtu.be/KW-9pAWqZ8Y?si=oZ33SmpShfMtHkQt ``` Downloading youtube song https://youtu.be/KW-9pAWqZ8Y?si=oZ33SmpShfMtHkQt [youtube] Extracting URL: https://youtu.be/KW-9pAWqZ8Y?si=oZ33SmpShfMtHkQt Downloading youtube song https://youtu.be/KW-9pAWqZ8Y?si=oZ33SmpShfMtHkQt [youtube] KW-9pAWqZ8Y: Downloading webpage WARNING: [youtube] No supported JavaScript runtime could be found. YouTube extraction without a JS runtime has been deprecated, and some formats may be missing. See https://github.com/yt-dlp/yt-dlp/wiki/EJS for details on installing one. To silence this warning, you can use --extractor-args "youtube:player_client=default" [youtube] KW-9pAWqZ8Y: Downloading android sdkless player API JSON [youtube] KW-9pAWqZ8Y: Downloading web safari player API JSON WARNING: [youtube] KW-9pAWqZ8Y: Some web_safari client https formats have been skipped as they are missing a url. YouTube is forcing SABR streaming for this client. See https://github.com/yt-dlp/yt-dlp/issues/12482 for more details [youtube] KW-9pAWqZ8Y: Downloading m3u8 information WARNING: [youtube] KW-9pAWqZ8Y: Some web client https formats have been skipped as they are missing a url. YouTube is forcing SABR streaming for this client. See https://github.com/yt-dlp/yt-dlp/issues/12482 for more details [info] KW-9pAWqZ8Y: Downloading 1 format(s): 251 [download] Sleeping 6.00 seconds as required by the site... [download] Destination: ishikinonaikranke - Topic - 灼けても尚.webm [download] 100% of 4.53MiB in 00:00:00 at 20.78MiB/s [ExtractAudio] Destination: ishikinonaikranke - Topic - 灼けても尚.mp3 Deleting original file ishikinonaikranke - Topic - 灼けても尚.webm (pass -k to keep) 2026-01-15 08:46 - INFO - [main:654] - ------------------------------------------------ 2026-01-15 08:46 - INFO - [main:655] - ishikinonaikranke - Topic - 灼けても尚.mp3 2026-01-15 08:46 - INFO - [main:674] - <class 'mutagen.mp3.MP3'> 2026-01-15 08:46 - INFO - [main:703] - No valid title found in TTI2 tag, using name ishikinonaikranke - Topic - 灼けても尚.mp3 2026-01-15 08:46 - INFO - [check_title_songname:223] - checking title by name ishikinonaikranke - Topic - 灼けても尚.mp3 2026-01-15 08:46 - INFO - [check_title_songname:227] - file has extension mp3. removing it from title. New title: ishikinonaikranke - Topic - 灼けても尚 2026-01-15 08:46 - INFO - [check_title_songname:232] - song title has more than 1 part after the -: ['ishikinonaikranke', 'Topic', '灼けても尚'] 2026-01-15 08:46 - INFO - [check_title_songname:240] - title: Topic 2026-01-15 08:46 - INFO - [main:708] - No valid artist found, checking for artist by songname of the file (ishikinonaikranke - Topic - 灼けても尚.mp3) 2026-01-15 08:46 - INFO - [check_artist_songname:285] - Checking artist by name. items: ['ishikinonaikranke', 'Topic', '灼けても尚.mp3'] 2026-01-15 08:46 - INFO - [check_for_multiple_artists:259] - checking for multiple artists for name ishikinonaikranke 2026-01-15 08:46 - INFO - [check_for_multiple_artists:279] - no multiple artists found in name ishikinonaikranke 2026-01-15 08:46 - INFO - [check_spotify_and_save:495] - Searching spotify for file ishikinonaikranke - Topic - 灼けても尚.mp3 2026-01-15 08:46 - ERROR - [main:737] - could not find track on spotify: 'TPE2' Traceback (most recent call last): File "/home/sem/music-tools/make_folders.py", line 773, in <module> main() File "/home/sem/music-tools/make_folders.py", line 745, in main logging.info("valid artist found. making folder for artist " + str(audio["TPE1"])) ~~~~~^^^^^^^^ File "/home/sem/music-tools/.env/lib/python3.12/site-packages/mutagen/_file.py", line 63, in __getitem__ return self.tags[key] ~~~~~~~~~^^^^^ File "/home/sem/music-tools/.env/lib/python3.12/site-packages/mutagen/_util.py", line 537, in __getitem__ return self.__dict[key] ~~~~~~~~~~~^^^^^ KeyError: 'TPE1' ```
sem closed this issue 2026-01-31 11:10:55 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sem/music-tools#3
No description provided.