Check-in [e4fa4859c6]
Overview
| Comment: | Implement new .resolve_urn() hook (replacing .row() override), which is added automatically now in ChannelPlugin init. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
e4fa4859c664fe4856869de74639f0b0 |
| User & Date: | mario on 2016-11-06 11:42:32 |
| Other Links: | manifest | tags |
Context
|
2016-11-06
| ||
| 11:43 | Show player config screenshot also in config_apps/placeholder page. check-in: 2a46669362 user: mario tags: trunk | |
| 11:42 | Implement new .resolve_urn() hook (replacing .row() override), which is added automatically now in ChannelPlugin init. check-in: e4fa4859c6 user: mario tags: trunk | |
| 11:40 | Also perform an action.resolve_urn() right when accessing a row. Thus the stremaing lsits get updated on any .row() acccess (= now centrally covered). check-in: 2859a51985 user: mario tags: trunk | |
Changes
Modified contrib/delicast.py from [f07d91d0e9] to [ecaaf5255a].
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | # encoding: UTF-8 # api: streamtuner2 # title: Delicast # description: directory of streaming media # url: http://delicast.com/ |
| ︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | + - + |
# page (50 stations) is fetched.
import re
from config import *
from channels import *
import ahttp
import action
# Delayed streaming URL discovery
class delicast (ChannelPlugin):
# control flags
has_search = False
listformat = "srv"
audioformat = "audio/mpeg"
titles = dict(listeners=False, bitrate=False, playing="Location")
categories = ["60s", "70s", "80s", "90s", "Alternative", "Blues",
"Chillout", "Christian", "Classical", "Community", "Country", "Culture",
"Dance", "Disco", "Easy listening", "Electronic", "Folk", "Funk",
"Gospel", "Hiphop", "House Indie", "Information", "Jazz", "Latin",
"Lounge", "Love", "Metal", "Oldies", "Pop", "R n b", "Reggae", "Rock",
"Romantic", "Soul", "Sports", "Student", "Talk", "Techno", "Trance",
"Urban", "World music"]
|
| ︙ | |||
78 79 80 81 82 83 84 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | - + - - + - - + + |
genre = cat,
# genre = unhtml(tags),
))
return r
# Update `url` on station data access (incurs a delay for playing or recording)
|
Modified contrib/reciva.py from [56fdd75c9a] to [12c0c0ed91].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | # encoding: UTF-8 # api: streamtuner2 # title: Reciva |
| ︙ | |||
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | + - - - - - - |
# going to be used implicitly.
#
import re
from pq import pq
import ahttp
import action
from config import *
from channels import *
# Reciva directory
class reciva (ChannelPlugin):
# module attributes
module = "reciva"
listformat = "pls"
has_search = True
categories = ['60s', '70s', '80s', '90s', 'Adult', ['Adult Contemporary'], 'Alternative', 'Ambient', 'Bluegrass', 'Blues', 'Bollywood', 'Christian', ['Christian Contemporary'], 'Classic Rock', 'Classical', 'College', 'Comedy', 'Contemporary', 'Country', 'Dance', 'Discussion', 'Easy', 'Electronica', 'Experimental', 'Folk', 'Gospel', 'Greek', 'Hip Hop', 'Indian', 'Indie', ['Indie Rock'], 'Jazz', 'Jungle', 'Kids', 'Latin Hits', 'New Age', 'News', ['News Talk', 'News Updates'], 'Oldies', 'Pop', 'Public', 'Punk', 'Rap', 'Reggae', 'Religious', 'Rock', 'Short Wave Radio', 'Soft Rock', 'Spanish', 'Sports', 'Talk', 'Top 40', 'Unknown', 'Varied', 'World', ['World Africa', 'World Asia', 'World Caribbean', 'World Europe', 'World Mediterranean', 'World Middle East', 'World Tropical']]
catmap = { 'classical': '14', 'dance': '18', 'bluegrass': '52', 'contemporary': '16', 'pop': '34', 'spanish': '66', 'college': '15', 'rap': '38', 'ambient': '69', 'talk': '43', 'alternative': '9', 'religious': '39', 'blues': '10', 'folk': '23', 'classic rock': '13', '90s': '7', 'adult contemporary': '8', 'oldies': '33', 'indie rock': '54', 'electronica': '21', 'unknown': '45', 'discussion': '19', 'news talk': '31', 'world mediterranean': '55', 'sports': '42', 'new age': '51', 'indie': '27', 'indian': '65', 'easy': '20', '80s': '6', 'world africa': '67', 'comedy': '62', 'public': '35', 'jungle': '72', 'reggae': '48', 'world middle east': '50', 'christian': '11', 'world caribbean': '68', '60s': '58', 'world europe': '56', 'jazz': '28', '70s': '5', 'soft rock': '41', 'top 40': '44', 'adult': '57', 'news': '30', 'bollywood': '60', 'world tropical': '53', 'latin hits': '29', 'varied': '46', 'christian contemporary': '12', 'kids': '59', 'short wave radio': '73', 'world': '49', 'world asia': '47', 'country': '17', 'news updates': '32', 'punk': '36', 'greek': '25', 'hip hop': '26', 'rock': '40', 'gospel': '24', 'experimental': '22' }
titles = dict( genre="Genre", title="Station", playing="Location", bitrate="Bitrate", listeners=False )
base_url = "https://radios.reciva.com/stations/genre/%s?&start=0&count=%s"
|
| ︙ | |||
89 90 91 92 93 94 95 | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | - + - - - + + + - + |
})
# done
return entries
# Fetch real `url` on stream access/playback (delay)
|