Check-in [1937c5766b]
Overview
Comment: | Fixed ASX and SMIL playlist exporting, allowed new placeholders %xspf, %jspf, %asx, %smil for application configuration. Documented in help/ pages. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | action-mapfmts |
Files: | files | file ages | folders |
SHA1: |
1937c5766b8ddd88c304baac7cc206ee |
User & Date: | mario on 2015-04-10 02:36:21 |
Other Links: | branch diff | manifest | tags |
Context
2015-04-10
| ||
10:45 | Update comment on rewritten action module. Add alternative MIME types for m3u and asx, spport asf detection and extraction. Fix listformat→source arg. Move save() and filename handling out of save_playlist. Fix mediafmt_t lookup and print warning when there's an audio-response on playlist fetching (and it does happen). Change myoggradio plugin "format" population, and set listformat to "mixed(..)" for automatic probing. check-in: 223368ebbf user: mario tags: action-mapfmts | |
02:36 | Fixed ASX and SMIL playlist exporting, allowed new placeholders %xspf, %jspf, %asx, %smil for application configuration. Documented in help/ pages. check-in: 1937c5766b user: mario tags: action-mapfmts | |
2015-04-09
| ||
21:58 | Python3 doesn't like `if [x = ...]` inline assignment trickery (kwargs out of scope). check-in: 82cf514e49 user: mario tags: action-mapfmts | |
Changes
Modified action.py from [941a6a0502] to [f7b4eccd84].
︙ | |||
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | 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 | + + + + - + | "audio/xm+zip": "mod", } # Player command placeholders for playlist formats placeholder_map = dict( pls = "(%url | %pls | %u | %l | %r) \\b", m3u = "(%m3u | %f | %g | %m) \\b", xspf= "(%xspf | %xpsf | %x) \\b", jspf= "(%jspf | %j) \\b", asx = "(%asx) \\b", smil= "(%smil) \\b", srv = "(%srv | %d | %s) \\b", ) # Playlist format content probing (assert type) playlist_content_map = [ ("pls", r""" (?i)\[playlist\].*numberofentries """), ("xspf", r""" <\?xml .* <playlist .* http://xspf\.org/ns/0/ """), ("m3u", r""" ^ \s* #(EXT)?M3U """), |
︙ | |||
182 183 184 185 186 187 188 | 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | - - + + | # · But returns a list of [urls] after playlist extraction. # · If repackaging as .m3u/.pls/.xspf, returns the local [fn]. # def convert_playlist(url, source, dest, local_file=True, title=""): urls = [] debug(dbg.PROC, "convert_playlist(", url, source, dest, ")") |
︙ | |||
210 211 212 213 214 215 216 | 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | - - + + | break # with `probe` set # Check ambiguity (except pseudo extension) if len(set([source, mime, probe])) > 1: debug(dbg.ERR, "Possible playlist format mismatch:", (source, mime, probe, ext)) # Extract URLs from content |
︙ | |||
267 268 269 270 271 272 273 274 | 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 | + + - - + + - - - - + + + + - - - - + + + + + + + - - - - | # class extract_playlist(object): # Content of playlist file src = "" def __init__(self, text): self.src = text # Extract only URLs from given source type def format(self, fmt): |
︙ | |||
365 366 367 368 369 370 371 | 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | - - - - - - - + + + + + + - - - - + + + + + - - + + + + - + + + - - - + + - - - - + + + + + + + - - + + + + + + + + | return txt # JSON (native lists of streamtuner2) def json(self, rows): return json.dumps(rows, indent=4) |
︙ |
Modified help/config_apps.page from [eda5c4f097] to [d8a5ff9529].
︙ | |||
12 13 14 15 16 17 18 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | - + - + - - + | <p>On BSD/Linux systems there are a plethora of audio players. In streamtuner2 you can <link xref="configuration">configure</link> most of them as target application. Mostly it makes sense to use a single application for all audio formats. But at least the */* media type should be handled by a generic player, like vlc.</p> <table shade="rows" rules="rows cols"> |
︙ | |||
43 44 45 46 47 48 49 50 | 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 | + - + + + + - - + + + + + + + | <p>Any listed application can be invoked with a different kind of URL or filename. Most are rather flexible, but some depend on specific playlist file types or URLs. You can control this by adding a placeholder after the configured application name:</p> <table shade="rows" rules="rows cols"> <thead> <tr><td><p>Placeholder</p></td><td><p>Alternatives</p></td><td><p>URL/Filename type</p></td></tr> </thead> <tr><td><p>%pls</p></td><td><p>%url %u %r</p></td><td><p>Either a remote .pls resource (fastest), or a local .pls file (if converted)</p></td></tr> <tr><td><p>%m3u</p></td><td><p>%f %g %m</p></td><td><p>Provides a local .m3u file for the streaming station</p></td></tr> |
Modified help/configuration.page from [6c83ddf5a5] to [cec2e8132d].
︙ | |||
56 57 58 59 60 61 62 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | - + - + | <p>Application names are most always lowercase binary names. Double click an entry to edit it. After editing the icon next to the application name will be updated. If it stays green, it's likely to work. If it turns red / into a stop symbol, then the entered name is likely incorrect.</p> <p><media type="image" src="img/configapps.png" mime="image/png" /></p> <p>After the application name, you can use a placeholder like "<var>%pls</var>" (default), |
︙ |
Modified st2.py from [ad8ec4ecd9] to [707c0d6df4].
︙ | |||
351 352 353 354 355 356 357 | 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | - + - + | entries = self.channel().stations() favicon.download_all(entries) # Save stream to file (.m3u) def save_as(self, widget): row = self.row() default_fn = row["title"] + ".m3u" |
︙ |