Yes, TikTok can be attributed to song-shortening. However, it might not be the only reason.
According to the Washington Times, “On TikTok, a 10-second snippet can launch a song onto the charts.” “According to TikTok’s 2024 Music Impact Report, 84% of the songs on Billboard’s Global 200 gained traction on TikTok before hitting the charts. The industry has taken notice. ‘TikTok has had a substantial impact on the way that musicians write songs,’ Charlie Harding, co-host of the “Switched On Pop” podcast, told Vice. ‘The platform is one of the most significant forces for discovering and amplifying music both new and old.’”
Historically, music length has been related to the methods of selling music. First through technical limitations, such as Vinyl records. Next, there were radio edit lengths, to allow advertisements to play in between. Now, according to the Washington Post, “Streaming platforms’ pay-per-play model also incentivizes artists to create shorter songs. Shorter songs encourage more replays, and more replays mean more revenue.” 
It should be noted that “Chart analysis by BBC News shows that, since their nadir in 2019, song lengths have crept back up again. The average length of a hit single in the first six months of 2025 rose to almost three and a half minutes. Some stretched out even longer.  The chart is now full of hits defying demands for diminution, like Lola Young’s Messy (4m 44s), Chappell Roan’s Pink Pony Club (4m18s) and Sam Fender’s People Watching (5m 11s). It’s no coincidence that all three contain meaningful lyrics, with a distinctive worldview.”
Sources:
https://www.washingtonpost.com/entertainment/interactive/2024/shorter-songs-again/
https://www.bbc.co.uk/news/resources/idt-052ab668-403d-416f-b5a6-c5692313b9b4
https://www.washingtontimes.com/news/2025/apr/14/songs-getting-shorter-thanks-part-spotify-tiktok-algorithms/