Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ branch:  streamtuner2


Check-in [915e4b09da]

Overview
Comment:Don't keep converter Soundcloud streaming URLs (access token time out after an hour or something).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 915e4b09dadfae6d3dbcb238616870b8886dae48
User & Date: mario on 2015-05-26 08:38:25
Other Links: manifest | tags
Context
2015-05-27
10:49
Minor formulation fix. check-in: 80da39f2ec user: mario tags: trunk
2015-05-26
08:38
Don't keep converter Soundcloud streaming URLs (access token time out after an hour or something). check-in: 915e4b09da user: mario tags: trunk
02:09
Move broken plugins into disabled/ folder. check-in: 75f6084791 user: mario tags: trunk
Changes

Modified contrib/url_soundcloud.py from [e898244f76] to [df26d4522d].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

16
17
18
19
20
21
22
..
40
41
42
43
44
45
46

47
48
49
50
51
52
53
# api: streamtuner2
# title: Soundcloud streams
# description: Convert soundcloud links from reddit to streamable tracks
# version: 0.2
# type: filter
# category: audio
# depends: python:soundcloud, action >= 1.1, reddit >= 0.8
# priority: rare
#
# Overrides action.play() function to convert soundcloud URLs
# to track/streaming address.  Disables the reddit filter for
# walled gardens, and overrides any custom player configured
# for "audio/soundcloud" in settings.



import re
import soundcloud
from config import *
import ahttp
import action

fmt = "audio/soundcloud"
................................................................................
            url = row["url"]
            log.DATA_CONVERT_SOUNDCLOUD(url)
            track = client().get('/resolve', url=url)
            track_str = "/tracks/{}/stream".format(track.id)
            url = client().get(track_str, allow_redirects=False).location

            # override attributes

            row["url"] = url
            row["format"] = "audio/mpeg"
            audioformat = "audio/mpeg"
            source = "srv"

        except Exception as e:
            log.ERR_SOUNDCLOUD("URL resolving failed:", e)



|





|





>







 







>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# api: streamtuner2
# title: Soundcloud streams
# description: Convert soundcloud links from reddit to streamable tracks
# version: 0.3
# type: filter
# category: audio
# depends: python:soundcloud, action >= 1.1, reddit >= 0.8
# priority: rare
#
# Hooks into action.play() function to convert soundcloud URLs
# to track/streaming address.  Disables the reddit filter for
# walled gardens, and overrides any custom player configured
# for "audio/soundcloud" in settings.


import copy
import re
import soundcloud
from config import *
import ahttp
import action

fmt = "audio/soundcloud"
................................................................................
            url = row["url"]
            log.DATA_CONVERT_SOUNDCLOUD(url)
            track = client().get('/resolve', url=url)
            track_str = "/tracks/{}/stream".format(track.id)
            url = client().get(track_str, allow_redirects=False).location

            # override attributes
            row = copy.copy(row)  # Throw away afterwards; tokens time out.
            row["url"] = url
            row["format"] = "audio/mpeg"
            audioformat = "audio/mpeg"
            source = "srv"

        except Exception as e:
            log.ERR_SOUNDCLOUD("URL resolving failed:", e)