https://bugs.kde.org/show_bug.cgi?id=529078
Bug ID: 529078
Summary: Importing a YouTube Music playlist fails with "Unable
to cast Python instance of type NoneType to C++ type
'?'" (playlist id and duration come back null)
Classification: I don't know
Product: kde
Version First unspecified
Reported In:
Platform: Nobara Linux
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 198626
--> https://bugs.kde.org/attachment.cgi?id=198626&action=edit
First half is the terminal log of the broken playlist and the second half is
the working playlist.
SOFTWARE/OS VERSIONS
AudioTube: [output of: flatpak info org.kde.audiotube]
Installed as: Flatpak
OS: Nobara Linux (Fedora-based), KDE Plasma [6.7.5]
OS: Nobara Linux (Fedora-based), KDE Frameworks [6.31.0]
OS: Nobara Linux (Fedora-based), Qt Version [6.11.2]
OS: Nobara Linux (Fedora-based), Kernal Version [7.3.4-202.nobara.fc44.x86_64
(64-bit)]
Qt multimedia backend: GStreamer 1.26.11
STEPS TO REPRODUCE
1. Create a playlist in YouTube Music (mine was created by transferring from
Apple Music with TuneMyMusic). Set it to Public.
2. In AudioTube, import the playlist using the URL from the browser address bar
(no &si= parameter).
3. Run AudioTube from a terminal (flatpak run org.kde.audiotube) to see the
output.
OBSERVED RESULT
Import fails with:
"Unable to cast Python instance of type <class 'NoneType'> to C++ type '?'"
A half-imported local playlist is left behind with empty fields, which also
produces
"Unable to assign [undefined] to QString" errors in LocalPlaylistsPage.qml
(lines 211-223).
EXPECTED RESULT
The playlist imports, or AudioTube shows a clear error and does not leave a
broken local playlist.
ADDITIONAL INFORMATION
I compared a playlist that imports with one that fails. Both were created and
shared the same way:
Vibez 91 tracks imports fine
Kegato's Biggest Hits 142 tracks fails
The failing playlist is over 100 tracks and the working one is under, so the
failure may be related to playlist size.
The logs print the playlist data returned by ytmusicapi. All 142 tracks of the
failing playlist were returned (trackCount matches the number of tracks), so
loading the tracks is not the problem. The difference is in the playlist's own
metadata:
Working playlist Failing playlist
"id" a valid playlist ID null
"duration" "4 hours, 30 minutes" null
thumbnail URL format ...=s192 / s576 / s1200 ...=w60-h60-l90-rj etc.
The different thumbnail format suggests YouTube returned a different page
layout for the failing playlist, and ytmusicapi could not parse the playlist id
and duration from it. AudioTube then appears to fail when it receives None
where it expects a string. This is my interpretation of the logs, not something
I confirmed in the code.
Things I ruled out:
- Playlist visibility (both are unlisted)
- URL format (address-bar URL, no tracking parameter)
- Playlist description (added a description, same error)
- Individual tracks: in the failing playlist, one track had a null album (a "-
Topic" upload, MUSIC_VIDEO_TYPE_UGC). I removed it and the error was unchanged.
All other 141 tracks have complete metadata.
- A new playlist made directly in YouTube Music (a few songs) imports fine.
Suggested fix: handle a null playlist id/duration from ytmusicapi gracefully
(skip, fall back to the id from the URL, or show an error), and avoid creating
a local playlist entry before the import succeeds.
Attached: log from the failing import (Kegato's Biggest Hits) and log from the
working import (Vibez).
--
You are receiving this mail because:
You are watching all bug changes.