[SoundCloud] Use long integers (64-bit) for track IDs to prevent overflows#1450
Merged
TobiGr merged 4 commits intoTeamNewPipe:devfrom Feb 21, 2026
Merged
Conversation
TobiGr
reviewed
Jan 30, 2026
| } else { | ||
| // %09d would be enough, but a 0 before the number does not create | ||
| // problems, so let's be sure | ||
| ids.add(String.format("%010d", track.getInt("id"))); |
Contributor
There was a problem hiding this comment.
This change causes the mocks to be invalid. Please add a test for a very small ID and also for one that is exceeding the 32 bit of an int. You can fix the tests by recording the mocks for all SoundCloud tests again (see our docs for more info).
Contributor
Author
There was a problem hiding this comment.
I updated the SoundcloudPlaylistExtractor mocks and also added two SoundcloudStreamExtractor tests, one for a small track ID (135535700) and one for a track ID that's larger than 32 bits of an int (2167944333).
|
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



In TeamNewPipe/NewPipe#12584, loading the https://soundcloud.com/roman-bene-939339090/dreams track will lead to an error that says
no track with id -2139744901 in response, which comes fromSoundcloudPlaylistExtractor.getPage(), as well as an HTTP 404 error fromSoundcloudParsingHelper.getStreamsFromApi().From
SoundcloudStreamExtractor.getId(), the track's ID is2155222395, but inSoundcloudParsingHelper.getStreamsFromApi(), the API URL becomeshttps://api-v2.soundcloud.com/tracks/-2139744901/related?client_id=<client_id>. This led to the HTTP 404 error because the track ID became-2139744901instead of2155222395, which came from using a signed 32-bit track ID that caused2155222395(0x8076157b) to overflow to-2139744901(0x8076157b - 0x100000000).Similarly, in TeamNewPipe/NewPipe#12822, the track "Farming Life in Another World Elf Girls Song Funk" by Bemax - ビマックス has a track ID of
2174506221which overflowed to-2120461075, and in TeamNewPipe/NewPipe#12904, "PLUMMET" by Quarters has a track ID of2214328829which overflowed to-2080638467.These issues can be fixed by increasing the bit width for track IDs from 32 bits to 64 bits. This pull request fixes TeamNewPipe/NewPipe#12584, fixes TeamNewPipe/NewPipe#12822 and fixes TeamNewPipe/NewPipe#12904.