Check-in [85313637a3]
Comment: | Consolidate listformat types to just "pls", "m3u" and "srv". Probe for direct ICY server contact in action.playlist_convert(), unify extraction methods. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | action-mapfmts |
Files: | files | file ages | folders |
SHA1: |
85313637a3e4505df25aeed95d661c6d |
User & Date: | mario on 2015-04-08 23:32:30 |
Other Links: | branch diff | manifest | tags |
2015-04-09
| ||
02:51 | Use ordered list for playlist content probing. Fix listfmt() mime to abbr conversion. Allow non-http URLs for raw() extraction. check-in: babd818a96 user: mario tags: action-mapfmts | |
2015-04-08
| ||
23:32 | Consolidate listformat types to just "pls", "m3u" and "srv". Probe for direct ICY server contact in action.playlist_convert(), unify extraction methods. check-in: 85313637a3 user: mario tags: action-mapfmts | |
17:59 | Remove extraneous class wrapper action.action. Start to regroup listformat mapping (pls-url → m3u-fn rewrites). Will need some heuristics, as depending just on the channel.listformat assumption won't work in practice (some .pls servers actually host direct server links, or occasionally .m3u references even). Currently does nothing, just returns the pls/etc URL. check-in: ea628d6426 user: mario tags: trunk | |
17:57 | Create new branch named "action-mapfmts" check-in: 320e271864 user: mario tags: action-mapfmts | |
Modified action.py from [b136303bf1] to [2ff7501bb2].
︙ | |||
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 19 20 21 22 23 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 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 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 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 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 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 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | - + - - - + + - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - - - + + - - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + - - + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + - + + + + + + - + - - - + + + + - + + + + + + + + + + + + + + + - + - - + + - + - - + - - - - - + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - + + + + - - - + + + - - - + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | # # Each channel plugin has a .listtype which describes the linked # audio playlist format. It's audio/x-scpls mostly, seldomly m3u, # but sometimes url/direct if the entry[url] directly leads to the # streaming server. # # As fallback there is a regex which just looks for URLs in the |
Modified channels/__init__.py from [11f92592f3] to [f28fdd4cc1].
︙ | |||
56 57 58 59 60 61 62 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | - + | # generic channel module --------------------------------------- class GenericChannel(object): # desc meta = { "config": [] } homepage = "http://fossil.include-once.org/streamtuner2/" base_url = "" |
︙ | |||
449 450 451 452 453 454 455 | 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 | - + | if row.get("url"): # parameters audioformat = row.get("format", self.audioformat) listformat = row.get("listformat", self.listformat) # invoke audio player |
︙ | |||
476 477 478 479 480 481 482 | 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | - + | "ogg":"ogg", "ogm":"ogg", "xiph":"ogg", "vorbis":"ogg", "vnd.xiph.vorbis":"ogg", "mp3":"mpeg", "mp":"mpeg", "mp2":"mpeg", "mpc":"mpeg", "mps":"mpeg", "aac+":"aac", "aacp":"aac", "realaudio":"x-pn-realaudio", "real":"x-pn-realaudio", "ra":"x-pn-realaudio", "ram":"x-pn-realaudio", "rm":"x-pn-realaudio", # yes, we do video "flv":"video/flv", "mp4":"video/mp4", } |
︙ |
Modified channels/bookmarks.py from [2e6c240bb2] to [7e6a019f1a].
︙ | |||
36 37 38 39 40 41 42 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | - + | # class bookmarks(GenericChannel): # desc module = "bookmarks" title = "bookmarks" base_url = "file:.config/streamtuner2/bookmarks.json" |
︙ |
Modified channels/global_key.py from [b551af8b08] to [6c7e3b19fe].
︙ | |||
65 66 67 68 69 70 71 | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | - + | if self.last >= len(streams): self.last = 0 elif self.last < 0: self.last = len(streams)-1 # play i = self.last |
Modified channels/icast.py from [9166297ac1] to [202f901cdd].
︙ | |||
40 41 42 43 44 45 46 | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | - + | # Surfmusik sharing site class icast (ChannelPlugin): # description homepage = "http://www.icast.io/" has_search = True |
︙ |
Modified channels/internet_radio.py from [2353be4e7b] to [c485fff9cd].
︙ | |||
39 40 41 42 43 44 45 | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | - + | class internet_radio (ChannelPlugin): # description title = "InternetRadio" module = "internet_radio" homepage = "http://www.internet-radio.org.uk/" |
︙ |
Modified channels/itunes.py from [fe2beb6695] to [53ab5aa446].
︙ | |||
42 43 44 45 46 47 48 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | - + | # description title = "iTunes RS" module = "itunes" #module = "rs_playlist" homepage = "http://www.itunes.com?" has_search = False |
︙ |
Modified channels/jamendo.py from [00f47620eb] to [833b488235].
︙ | |||
58 59 60 61 62 63 64 | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | - + | title = "Jamendo" module = "jamendo" homepage = "http://www.jamendo.com/" version = 0.3 has_search = True base = "http://www.jamendo.com/en/" |
︙ |
Modified channels/live365.py from [2380a719ae] to [e2484ab83b].
︙ | |||
55 56 57 58 59 60 61 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | - + | # desc module = "live365" title = "Live365" homepage = "http://www.live365.com/" base_url = "http://www.live365.com/" has_search = True |
︙ | |||
131 132 133 134 135 136 137 | 131 132 133 134 135 136 137 138 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - | gi = 0 def group_by_station(self, kv): if kv[0] == "stationName": self.gi += 1 return self.gi |
Modified channels/modarchive.py from [34fcb77755] to [499e517889].
︙ | |||
41 42 43 44 45 46 47 48 49 50 51 52 53 54 | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | + | class modarchive (ChannelPlugin): # description title = "modarchive" module = "modarchive" homepage = "http://www.modarchive.org/" base = "http://modarchive.org/" listformat = "href" titles = dict(genre="Genre", title="Song", playing="File", listeners="Rating", bitrate=0) # keeps category titles->urls catmap = {"Chiptune": "54", "Electronic - Ambient": "2", "Electronic - Other": "100", "Rock (general)": "13", "Trance - Hard": "64", "Swing": "75", "Rock - Soft": "15", "R & B": "26", "Big Band": "74", "Ska": "24", "Electronic - Rave": "65", "Electronic - Progressive": "11", "Piano": "59", "Comedy": "45", "Christmas": "72", "Chillout": "106", "Reggae": "27", "Electronic - Industrial": "34", "Grunge": "103", "Medieval": "28", "Demo Style": "55", "Orchestral": "50", "Soundtrack": "43", "Electronic - Jungle": "60", "Fusion": "102", "Electronic - IDM": "99", "Ballad": "56", "Country": "18", "World": "42", "Jazz - Modern": "31", "Video Game": "8", "Funk": "32", "Electronic - Drum & Bass": "6", "Alternative": "48", "Electronic - Minimal": "101", "Electronic - Gabber": "40", "Vocal Montage": "76", "Metal (general)": "36", "Electronic - Breakbeat": "9", "Soul": "25", "Electronic (general)": "1", "Punk": "35", "Pop - Synth": "61", "Electronic - Dance": "3", "Pop (general)": "12", "Trance - Progressive": "85", "Trance (general)": "71", "Disco": "58", "Electronic - House": "10", "Experimental": "46", "Trance - Goa": "66", "Rock - Hard": "14", "Trance - Dream": "67", "Spiritual": "47", "Metal - Extreme": "37", "Jazz (general)": "29", "Trance - Tribal": "70", "Classical": "20", "Hip-Hop": "22", "Bluegrass": "105", "Halloween": "82", "Jazz - Acid": "30", "Easy Listening": "107", "New Age": "44", "Fantasy": "52", "Blues": "19", "Other": "41", "Trance - Acid": "63", "Gothic": "38", "Electronic - Hardcore": "39", "One Hour Compo": "53", "Pop - Soft": "62", "Electronic - Techno": "7", "Religious": "49", "Folk": "21"} categories = [] |
︙ |
Modified channels/myoggradio.py from [acdf73781d] to [172a61f6a0].
︙ | |||
25 26 27 28 29 30 31 | 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 | - + - + | # Beforehand an account needs to be configured in the settings. (Registration # on myoggradio doesn't require an email address or personal information.) # from channels import * from config import * |
︙ |
Modified channels/punkcast.py from [b3964ae39a] to [eea2622232].
︙ | |||
86 87 88 89 90 91 92 | 86 87 88 89 90 91 92 93 94 95 96 97 98 | - + - + | rx_sound = re.compile("""(http://[^"<>]+[.](mp3|ogg|m3u|pls|ram))""") html = http.get(row["homepage"]) # look up ANY audio url for uu in rx_sound.findall(html): __print__( dbg.DATA, uu ) (url, fmt) = uu |
Modified channels/radiobrowser.py from [776df88d1e] to [efa310538d].
︙ | |||
57 58 59 60 61 62 63 | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | - + | # "votes":4,"negativevotes":10}, # class radiobrowser (ChannelPlugin): # description homepage = "http://www.radio-browser.info/" has_search = True |
︙ |
Modified channels/shoutcast.py from [05b00913ff] to [e812eed775].
︙ | |||
50 51 52 53 54 55 56 | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | - + | # class shoutcast(channels.ChannelPlugin): # desc module = "shoutcast" title = "SHOUTcast" base_url = "http://shoutcast.com/" |
︙ |
Modified channels/surfmusik.py from [48d1f40b6c] to [4040006a47].
︙ | |||
42 43 44 45 46 47 48 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | - + | # Surfmusik sharing site class surfmusik (ChannelPlugin): # description title = "SurfMusik" module = "surfmusik" homepage = "http://www.surfmusik.de/" |
︙ |
Modified channels/timer.py from [242512e240] to [0abfc97e9b].
︙ | |||
21 22 23 24 25 26 27 | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | - + | # from config import * from channels import * import bundle.kronos as kronos # Doesn't work with Python3 from uikit import uikit |
︙ | |||
93 94 95 96 97 98 99 | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | - + | # close dialog,get data def add_timer(self, *w): self.parent.timer_dialog.hide() row = self.parent.row() row = copy.copy(row) # add data |
︙ | |||
168 169 170 171 172 173 174 | 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 198 199 200 | - + - + | return 0 # no limit # action wrapper def play(self, row, *args, **kwargs): action.play( url = row["url"], audioformat = row.get("format","audio/mpeg"), |
Modified channels/tunein.py from [becae358dd] to [6f7da7eac6].
︙ | |||
36 37 38 39 40 41 42 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | - + | class tunein (ChannelPlugin): # description title = "TuneIn" module = "tunein" homepage = "http://tunein.com/" has_search = False |
︙ |
Modified channels/xiph.py from [747e142e4c] to [87b6bef7f2].
︙ | |||
58 59 60 61 62 63 64 | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | - + | # desc module = "xiph" title = "Xiph.org" homepage = "http://dir.xiph.org/" #xml_url = "http://dir.xiph.org/yp.xml" json_url = "http://api.include-once.org/xiph/cache.php" |
︙ |
Modified st2.py from [cbc6a632be] to [eacd2e641f].
︙ | |||
104 105 106 107 108 109 110 | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | - | "configwin": channels.configwin.configwin(self), "streamedit": channels.streamedit.streamedit(self), } gui_startup(4/20.0) # early module coupling action.main = self # action (play/record) module needs a reference to main window for gtk interaction and some URL/URI callbacks |
︙ | |||
178 179 180 181 182 183 184 | 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | - - - - + + + + | # else "update_categories": self.update_categories, "update_favicons": self.update_favicons, "app_state": self.app_state, "bookmark": self.bookmark, "save_as": self.save_as, "menu_about": lambda w: AboutStreamtuner2(self), |
︙ | |||
289 290 291 292 293 294 295 | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | - + - + - + | if row: self.channel().play(row) [callback(row) for callback in self.hooks["play"]] # Recording: invoke streamripper for current stream URL def on_record_clicked(self, widget): row = self.row() |
︙ | |||
354 355 356 357 358 359 360 | 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | - + | # Save stream to file (.m3u) def save_as(self, widget): row = self.row() default_fn = row["title"] + ".m3u" fn = uikit.save_file("Save Stream", None, default_fn, [(".m3u","*m3u"),(".pls","*pls"),(".xspf","*xspf"),(".smil","*smil"),(".asx","*asx"),("all files","*")]) if fn: |
︙ |