Index: channels/reddit.py ================================================================== --- channels/reddit.py +++ channels/reddit.py @@ -1,12 +1,12 @@ # 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). } @@ -59,30 +59,31 @@ 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", @@ -151,45 +152,42 @@ "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", - "deepcuts", "EarlyMusic", "FemaleVocalists", - "FitTunes", "freemusic", "Frisson", - "GayMusic", "germusic", "gethightothis", + ["audioinsurrection", "albumaday", "albumoftheday", "Albums", + "albumlisteners", "bassheavy", "BinauralMusic", "BoyBands", + "Catchysongs", "Chopping", "CircleMusic", "CoverSongs", + "cyberpunk_music", "DANCEPARTY", "danktunes", "deepcuts", + "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", - "ScottishMusic", "ThemVoices", - "unheardof", "WhatIListenTo", "WTFMusicVideos"], - # Community - #["AlbumArtPorn", "albumreviews", "Audio", "Audiophile", "AustinMusicians", - #"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"], + "musicanova", "musicsuggestions", "MusicToSleepTo", "musicvideos", + "NameThatSong", "NewAlbums", "newmusic", "onealbumaweek", + "partymusic", "RedditOriginals", "RepublicOfMusic", + "RoyaltyFreeMusic", "runningmusic", "ScottishMusic", + "SlavicMusicVideos", "songwriterscircle", "SpotifyMusic", + "ThemVoices", "TodaysFavoriteSong", "unheardof", "WhatIListenTo", + "WTFMusicVideos"], + # Single Artist/Band subreddits (unchecked list) "Bands/Artists →", ["311", "ADTR", "AliciaKeys", "ArcadeFire", "ArethaFranklin", "APerfectCircle", "TheAvettBrothers", "BaysideIsACult", "TheBeachBoys", @@ -220,22 +218,31 @@ "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('^]+>(\w[^<]+)|^
  • 0: + # decorative "→" entry + if cat.find("→") > 0: return self.placeholder # collect links data = [] after = None @@ -325,20 +332,5 @@ 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" - ] - ] -