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

⌈⌋ branch:  streamtuner2


Check-in [d1a36e5bde]

Overview
Comment:Get rid of StringIO wrapper for json loading.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d1a36e5bde24859eab1f3d81021cb25959fb44bb
User & Date: mario on 2015-05-17 03:03:25
Other Links: manifest | tags
Context
2015-05-17
03:04
Remove ahttp aliases, print warning for "raw" extractor fallback, add some comment headlines for better overview. check-in: 5d05601f03 user: mario tags: trunk
03:03
Get rid of StringIO wrapper for json loading. check-in: d1a36e5bde user: mario tags: trunk
03:03
Add WinAmp user agent. check-in: d4f8ceee3f user: mario tags: trunk
Changes

Modified channels/myoggradio.py from [7ec1d08cee] to [7b06347ed0].

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# api: streamtuner2
# title: MyOggRadio
# description: Open source internet radio directory.
# type: channel
# category: radio
# version: 0.7
# url: http://www.myoggradio.org/
# depends: json, StringIO, ahttp >= 1.2
# config:
#    { name: myoggradio_login,  type: text,  value: "user:password", description: "Account for storing personal favourites." }
#    { name: myoggradio_morph,  type: boolean, value: 0,  description: "Convert pls/m3u into direct shoutcast url." }
# priority: standard
# png:
#   iVBORw0KGgoAAAANSUhEUgAAAAsAAAAQCAYAAADAvYV+AAAABHNCSVQICAgIfAhkiAAAARdJREFUKJGt0U8rhFEUx/HP3AfjT9QQJo80CyzGG1A2UspL8k4s
#   7G2lvAlLC0skEWliMJTHM2Nx72iSjfJb3Xv6/n7ndA5/UIWz/jtDGZ9rqXQGAT30+vAE6njA80DYCObQxe1QTFdPhlFc4D0lzmMGn3gJGEtQhipFg80a53Uq







|







2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# api: streamtuner2
# title: MyOggRadio
# description: Open source internet radio directory.
# type: channel
# category: radio
# version: 0.7
# url: http://www.myoggradio.org/
# depends: json, ahttp >= 1.5
# config:
#    { name: myoggradio_login,  type: text,  value: "user:password", description: "Account for storing personal favourites." }
#    { name: myoggradio_morph,  type: boolean, value: 0,  description: "Convert pls/m3u into direct shoutcast url." }
# priority: standard
# png:
#   iVBORw0KGgoAAAANSUhEUgAAAAsAAAAQCAYAAADAvYV+AAAABHNCSVQICAgIfAhkiAAAARdJREFUKJGt0U8rhFEUx/HP3AfjT9QQJo80CyzGG1A2UspL8k4s
#   7G2lvAlLC0skEWliMJTHM2Nx72iSjfJb3Xv6/n7ndA5/UIWz/jtDGZ9rqXQGAT30+vAE6njA80DYCObQxe1QTFdPhlFc4D0lzmMGn3gJGEtQhipFg80a53Uq
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from config import *
import action
from uikit import uikit
import ahttp

import re
import json
from compat2and3 import StringIO
import copy
from uikit import gtk


# open source radio sharing stie
class myoggradio(ChannelPlugin):

    # control flags
    listformat = "mixed(pls/m3u/srv)"
    has_search = False
    api = "http://www.myoggradio.org/"
    
    # hide unused columns
    titles = dict(playing=False, listeners=False, bitrate=False)
    
    # category map







<








|







31
32
33
34
35
36
37

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from config import *
import action
from uikit import uikit
import ahttp

import re
import json

import copy
from uikit import gtk


# open source radio sharing stie
class myoggradio(ChannelPlugin):

    # control flags
    listformat = "pls,m3u,srv"
    has_search = False
    api = "http://www.myoggradio.org/"
    
    # hide unused columns
    titles = dict(playing=False, listeners=False, bitrate=False)
    
    # category map
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

        # result list
        entries = []
        
        # common
        if (cat == "common"):
            # fetch
            data = ahttp.get(self.api + "common.json")
            entries = json.load(StringIO(data))
            
        # bookmarks
        elif (cat == "personal") and self.user_pw():
            data = ahttp.get(self.api + "favoriten.json?user=" + self.user_pw()[0])
            entries = json.load(StringIO(data))
        
        # unknown
        else:
            self.parent.status("Unknown category")
            pass

        # augment result list







|
|



|
|







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

        # result list
        entries = []
        
        # common
        if (cat == "common"):
            # fetch
            data = ahttp.get(self.api + "common.json", encoding="utf-8")
            entries = json.loads(data)
            
        # bookmarks
        elif (cat == "personal") and self.user_pw():
            data = ahttp.get(self.api + "favoriten.json?user=" + self.user_pw()[0], encoding="utf-8")
            entries = json.loads(data)
        
        # unknown
        else:
            self.parent.status("Unknown category")
            pass

        # augment result list