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

⌈⌋ branch:  streamtuner2


Check-in [0041f793e7]

Overview
Comment:Remove radioreddit, update some of the categories, and implement full subreddit extraction from wiki page.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0041f793e753aadbf4396621af9970fe09a66a07
User & Date: mario on 2020-05-20 07:00:24
Other Links: manifest | tags
Context
2020-05-20
07:01
Remove more stale links check-in: 3017ab4842 user: mario tags: trunk
07:00
Remove radioreddit, update some of the categories, and implement full subreddit extraction from wiki page. check-in: 0041f793e7 user: mario tags: trunk
2020-05-18
17:27
Introduce wiki/links source for according bookmarks category. check-in: aa18167fee user: mario tags: trunk
Changes

Modified channels/reddit.py from [828a881eea] to [d6ea5d8f2b].

1
2
3
4
5

6
7

8
9
10
11
12
13
14
1
2
3
4

5
6

7
8
9
10
11
12
13
14




-
+

-
+







# encoding: UTF-8
# api: streamtuner2
# title: reddit
# description: Music recommendations from reddit /r/music and associated subreddits.
# version: 0.9
# version: 1.0
# type: channel
# url: http://reddit.com/r/Music
# url: http://old.reddit.com/r/Music
# category: playlist
# config:
#   { name: reddit_pages, type: int, value: 2, description: Number of pages to fetch. }
#   { name: filter_walledgardens, type: boolean, value: 1, description: Filter walled gardens (soundcloud/spotify/…) if there's no player. }
#   { name: reddit_keep_all, type: boolean, value: 0, description: Keep all web links (starts a browser for websites/news). }
# png:
#   iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJ1BMVEUAAAAcICX/AABHSk1jZ299hYz/bmajq6//lY/d0M3C1+3T7P38+/iaLhuGAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF
57
58
59
60
61
62
63
64

65
66
67
68
69

70
71
72
73



74
75
76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
57
58
59
60
61
62
63

64
65
66
67


68
69
70
71

72
73
74
75
76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
91







-
+



-
-
+



-
+
+
+









-
+







    # favicon scaling (from reddit preview `img`)
    img_resize = 32
    fixed_size = [32,26]
    
    # just subreddit names to extract from
    categories = [
        # static radio list
        "radioreddit 📟",
        #"radioreddit 📟", # https://archive.org/details/radioreddit

        # major subreddits
        "Music",
        ["trueMusic", "futurebeats", "FutureFunkAirlines",
        "Turntablists", "Catchysongs", "MusicForConcentration", "MusicToSleepTo"],
        ["trueMusic", "futurebeats", "Turntablists", "Catchysongs", "MusicForConcentration", "MusicToSleepTo"],

        # cover bands/songs
        "CoverSongs",
        ["ICoveredASong", "MyMusic", "UserProduced", "RepublicOfMusic", "RoyaltyFreeMusic"],
        ["ICoveredASong", "MyMusic", "UserProduced", "RepublicOfMusic",
         "RoyaltyFreeMusic",
        ],

        # discover subreddits
        "music_discovery",
        ["ListenToThis", "ListenToUs", "WhatIListenTo", "ListenToConcerts",
        "HeadBangToThis", "unheardof", "under10k", "lt10k"],
        
        # Classical
        "ClassicalMusic",
        ["composer", "baroque", "classicalmusic", "contemporary",
        "choralmusic", "ChamberMusic", "EarlyMusic",
        "choralmusic", "ChamberMusic", "EarlyMusic", "ElitistClassical",
        "ElitistClassical", "icm", "Opera", "pianocovers"],

        # Electronic Music
        "ElectronicMusic",
        ["acidhouse", "ambientmusic",  "AtmosphericDnB", "BigBeat",
        "boogiemusic", "breakbeat", "breakcore", #"brostep", "chicagohouse",
        "chillout", "Chipbreak", "darkstep", "deephouse",
149
150
151
152
153
154
155
156
157
158
159






160
161
162
163
164
165




166
167
168



169
170
171
172
173






174
175
176
177




178
179


180
181

182
183
184
185
186
187
188
189
190

191
192
193
194
195
196
197
150
151
152
153
154
155
156




157
158
159
160
161
162
163
164
165



166
167
168
169



170
171
172
173




174
175
176
177
178
179
180



181
182
183
184


185
186


187









188
189
190
191
192
193
194
195







-
-
-
-
+
+
+
+
+
+



-
-
-
+
+
+
+
-
-
-
+
+
+

-
-
-
-
+
+
+
+
+
+

-
-
-
+
+
+
+
-
-
+
+
-
-
+
-
-
-
-
-
-
-
-
-
+







        "reggae", "remixxd", "RetroMusic", "rnb", "rootsmusic", "SalsaMusic", "Ska",
        "Soca", "Soulies", "SoulDivas", "SoundsVintage", "SpaceMusic",
        "swing", "Tango", "TheRealBookVideos", "TouhouMusic", "TraditionalMusic",
        "treemusic", "triphop", "vaporwave", "VintageObscura", "vocaloid"],

        # Redditor Made Music (removed some spotify/soundcloud-only subreddits)
        "Redditor-Made →",
        ["AcousticOriginals", "Composer", "ICoveredASong",
        "independentmusic", "MusicCritique", "MyMusic",
        "ratemyband", "Songwriters",
        "ThisIsOurMusic", "UserProduced",],
        ["300Songs", "AcousticOriginals", "BedroomBands", "MyMusic",
         "Composer", "independentmusic", "MusicCritique",
         "MusicInTheMaking", "RoastMyTrack", "ratemyband", "Songwriters",
         "TheseAreOurAlbums", "ThisIsOurMusic", "UserProduced",
         "WereOnSpotify", "WhiteLabels"
        ],

        # Multi-Genre & Community Subreddits (a third cleaned out for too few usable links)
        "Community →",
        ["audioinsurrection", "albumaday", "albumoftheday", #"Albums",
        "albumlisteners", "BinauralMusic", "Catchysongs",
        "CircleMusic", "CoverSongs", "cyberpunk_music", "DANCEPARTY", "danktunes",
        ["audioinsurrection", "albumaday", "albumoftheday", "Albums",
        "albumlisteners", "bassheavy", "BinauralMusic", "BoyBands",
        "Catchysongs", "Chopping", "CircleMusic", "CoverSongs",
        "cyberpunk_music", "DANCEPARTY", "danktunes", "deepcuts",
        "deepcuts", "EarlyMusic", "FemaleVocalists",
        "FitTunes", "freemusic", "Frisson",
        "GayMusic", "germusic", "gethightothis",
        "EarlyMusic", "earlymusicalnotation", "FemaleVocalists",
        "festivals", "findaband", "FitTunes", "FreeAlbums", "freemusic",
        "Frisson", "gameofbands", "GayMusic", "germusic", "gethightothis",
        "GuiltyPleasureMusic", "HeadNodders", "heady", "HeyThatWasIn",
        "indie", "IndieWok", "Instrumentals",
        "ipm", "IsolatedVocals", "LetsTalkMusic", "listentoconcerts",
        "listentomusic", "ListenToThis", "ListenToUs", "livemusic",
        "llawenyddhebddiwedd", "Lyrics", "mainstreammusic",
        "HighFidelity", "ifyoulikeblank", "ilikethissong", "indie",
        "IndieWok", "Indieheads", "Instrumentals", "ipm", "IsolatedVocals",
        "LeeHallMusic", "LetsTalkMusic", "listentoconcerts",
        "listentodynamic", "listentomusic", "listentonews", "ListenToThis",
        "ListenToUs", "livemusic", "llawenyddhebddiwedd", "LongerJams",
        "Lyrics", "mainstreammusic", "makemeaplaylist",
        "MiddleEasternMusic", "MLPtunes", "Music", "MusicAlbums",
        "musicsuggestions", "MusicToSleepTo", "musicvideos", "NameThatSong",
        "newmusic", "onealbumaweek", "partymusic", "RedditOriginals",
        "RepublicOfMusic", "RoyaltyFreeMusic", "runningmusic",
        "musicanova", "musicsuggestions", "MusicToSleepTo", "musicvideos",
        "NameThatSong", "NewAlbums", "newmusic", "onealbumaweek",
        "partymusic", "RedditOriginals", "RepublicOfMusic",
        "RoyaltyFreeMusic", "runningmusic", "ScottishMusic",
        "ScottishMusic", "ThemVoices",
        "unheardof", "WhatIListenTo", "WTFMusicVideos"],
        "SlavicMusicVideos", "songwriterscircle", "SpotifyMusic",
        "ThemVoices", "TodaysFavoriteSong", "unheardof", "WhatIListenTo",
        # Community
        #["AlbumArtPorn", "albumreviews", "Audio", "Audiophile", "AustinMusicians",
        "WTFMusicVideos"],
        #"bandmembers", "CarAV", "CassetteCulture", "Cd_collectors",
        #"ConcertTickets", "germusic", "glastonbury_festival", "ICoveredASong",
        #"ifyoulikeblank", "independentmusic", "ineedasong/", "japanesemusic",
        #"Jazzguitar", "koreanmusic", "LubbockMusicians", "mixcd", "musiccritics",
        #"MusicalComedy", "musicessentials", "MusicEventMeetUp", "musicfestivals",
        #"musicnews", "MusiciansBlogs", "Musicians", "NeedVocals", "OSOM",
        #"performer", "RecordClub", "recordstore", "redditmusicclub", "Rockband",
        #"RockbandChallenges", "TheSongRemainsTheSame", "TipOfMyTongue",
        #"TouringMusicians", "vinyl", "VinylReleases", "WeAreTheMusicMakers"],


        # Single Artist/Band subreddits (unchecked list)
        "Bands/Artists →",
        ["311", "ADTR", "AliciaKeys", "ArcadeFire", "ArethaFranklin",
        "APerfectCircle", "TheAvettBrothers", "BaysideIsACult", "TheBeachBoys",
        "Beatles", "billytalent", "Blink182", "BMSR", "boniver", "brandnew",
        "BruceSpringsteen", "Burial", "ChristinaAguilera", "cityandcolour",
218
219
220
221
222
223
224
225

226
227












228
229
230
231
232
233

234
235
236

237
238
239
240
241
242
243
216
217
218
219
220
221
222

223
224

225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241

242



243
244
245
246
247
248
249
250







-
+

-
+
+
+
+
+
+
+
+
+
+
+
+





-
+
-
-
-
+







        ["DJs", "PirateRadio", "Spotify", "Turntablists", "GroveSharkPlaylists"],
        
        "Midi",
        ["midimusic", "MidiCovers", "ModernMidiMusic", "StarboundSongbase", "synthesizers"],
    ]


    # static
    # from wiki
    def update_categories(self):
        pass
        html = ahttp.get("https://old.reddit.com/r/Music/wiki/musicsubreddits")
        log.HTML(html)
        del self.categories[2:]
        sub = []
        for title, link in re.findall('^<h2[^>]+>(\w[^<]+)</h2>|^<li><a href="/r/(\w+)" rel', html, re.M):
            log.DATA(title,link)
            if title:
                self.categories.append(title + " →")
                sub = []
                self.categories.append(sub)
            elif link:
                sub.append(link)


    # Extract video/music news links
    def update_streams(self, cat, search=None):
        
        # radioreddit
        # decorative "→" entry
        if cat == "radioreddit 📟":
            return self.radioreddit()
        elif cat.find("→") > 0:
        if cat.find("→") > 0:
            return self.placeholder

        # collect links
        data = []
        after = None
        for i in range(1, int(conf.reddit_pages) + 1):
            self.progress(conf.reddit_pages)
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
330
331
332
333
334
335
336






















-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
                format = format,
                listformat = listformat,
                state = state,
            ))
        return r        


    # static station list
    def radioreddit(self):
        return [
            dict(
                genre=id, title=id.title(),
                url="http://cdn.audiopump.co/radioreddit/"+id+"_mp3_128k",
                format="audio/mpeg", homepage="http://radioreddit.com/",
                listformat="srv"
            )
            for id in [
                "main", "random", "rock", "metal", "indie",
                "electronic", "hiphop", "talk", "festival"
            ]
        ]