quickstream

Find stream URIs for common streaming services.
git clone https://git.ce9e.org/quickstream.git

commit
0f1ee7b0f1aa0c8d4fba341b9f69ed12db584de8
parent
64602de6800b1b7a4adb9bf805dd0f2c6fdc488e
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2026-03-27 09:09
soundcloud: try until something works

Diffstat

M quickstream/providers/soundcloud.py 15 ++++++++++-----

1 files changed, 10 insertions, 5 deletions


diff --git a/quickstream/providers/soundcloud.py b/quickstream/providers/soundcloud.py

@@ -1,5 +1,7 @@
    1     1 import json
    2     2 
   -1     3 import aiohttp
   -1     4 
    3     5 from ..base import provider
    4     6 
    5     7 
@@ -22,11 +24,14 @@ async def get_streams(client, trackinfo):
   22    24         if item['format']['protocol'] not in ['hls', 'progressive']:
   23    25             continue
   24    26 
   25    -1         streaminfo = await client.fetch_json(item['url'], params={
   26    -1             'client_id': trackinfo['_client_id'],
   27    -1             'track_authorization': trackinfo['track_authorization'],
   28    -1         })
   29    -1         return streaminfo['url']
   -1    27         try:
   -1    28             streaminfo = await client.fetch_json(item['url'], params={
   -1    29                 'client_id': trackinfo['_client_id'],
   -1    30                 'track_authorization': trackinfo['track_authorization'],
   -1    31             })
   -1    32             return streaminfo['url']
   -1    33         except aiohttp.ClientResponseError:
   -1    34             pass
   30    35 
   31    36 
   32    37 @provider(r'https?://soundcloud.com/([^/]+)/([^/]+)', tests={