Check-in [749715cb39]
Overview
Comment: | Fix .desktop file exporting. Add mime_guess() for streaming url. Move insert_rows() implementation out of DND module. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
749715cb398b898b57332b26f29f5be0 |
User & Date: | mario on 2015-04-22 20:52:07 |
Other Links: | manifest | tags |
Context
2015-04-22
| ||
21:16 | Add some notes about DND to the manual. check-in: faacd9c284 user: mario tags: trunk | |
20:52 | Fix .desktop file exporting. Add mime_guess() for streaming url. Move insert_rows() implementation out of DND module. check-in: 749715cb39 user: mario tags: trunk | |
20:50 | Move DND insert_rows() into GenericChannel. Add load(y=) parameter to scroll back to previous position after insert_rows(). Reenable select_path("0") after reloading category list. (Fixes initial startup.) check-in: a5893e591c user: mario tags: trunk | |
Changes
Modified action.py from [29efeecded] to [b6bfb9c13d].
︙ | |||
317 318 319 320 321 322 323 | 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | - + | if fn and self.probe_ext(fn): self.fn = fn self.src = open(fn, "rt").read() # Test URL/path "extension" for ".pls" / ".m3u" etc. def probe_ext(self, url): |
︙ | |||
426 427 428 429 430 431 432 | 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | - + - + | "asx": dict( split = r" (?x) <entry[^>]*> ", url = r" (?x) <ref \b[^>]+\b href \s*=\s* [\'\"] (\w+://[^\s\"\']+) [\'\"] ", title = r"(?x) <title> ([^<>]+) ", unesc = "xml", ), "smil": dict( |
︙ | |||
469 470 471 472 473 474 475 | 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 | - + - - + + + + + + + + + + + + + | } # Add placeholder fields to extracted row def mkrow(self, row, title=None): url = row.get("url", "") comb = { |
︙ | |||
610 611 612 613 614 615 616 617 618 619 620 621 622 623 | 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 | + + + + | txt = """<smil>\n<head>\n\t<meta name="title" content="%s"/>\n</head>\n<body>\n\t<seq>\n""" % (rows[0]["title"]) for row in rows: if row.get("url"): txt += """\t\t<{} src="{}"/>\n""".format(row.get("format", "audio").split("/")[0], row["url"]) txt += """\t</seq>\n</body>\n</smil>\n""" return txt # .DESKTOP links def desktop(self, rows): row = rows[0] return "[Desktop Entry]\nVersion=1.0\nIcon=media-playback-start\nType=Link\nName={title}\nComment={playing}\nURL={url}\n".format(**row) # Generate filename for temporary .m3u, if possible with unique id def tmp_fn(pls, ext="m3u"): # use shoutcast unique stream id if available stream_id = re.search("http://.+?/.*?(\d+)", pls, re.M) |
︙ |
Modified channels/dnd.py from [08769a579d] to [badcdb5ec3].
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | - + | # encoding: UTF-8 # api: streamtuner2 # title: Drag and Drop (experimental) # description: Copy streams/stations from and to other applications. # depends: uikit # version: 0.5 # type: interface # config: |
︙ | |||
70 71 72 73 74 75 76 77 78 79 80 81 82 83 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | + | ("audio/x-mpegurl", 0, 20), ("application/x-scpls", 0, 21), ("application/xspf+xml", 0, 22), ("application/smil", 0, 23), ("text/html", 0, 23), ("text/richtext", 0, 23), ("application/jspf+json", 0, 25), ("application/x-desktop", 0, 26), # direct srv urls ("text/url", 0, 15), #@TODO: support in action.save_/convert_ ("message/external-body", 0, 15), ("url/direct", 0, 15), # filename, file:// IRL ("FILE_NAME", 0, 3), ("text/uri-list", 0, 4), |
︙ | |||
91 92 93 94 95 96 97 98 99 100 101 102 103 104 | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | + | # Map target/`info` integers to action. module identifiers cnv_types = { 20: "m3u", 21: "pls", 22: "xspf", 23: "smil", 25: "jspf", 26: "desktop", 15: "srv", 4: "temp", 5: "srv", 51: "json", } |
︙ | |||
192 193 194 195 196 197 198 | 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | - + | # Keep in type request buffer self.buf[info] = buf return buf |
︙ | |||
227 228 229 230 231 232 233 | 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 | - - + + + - - - - - + - - - - - - + + + + + + | return True # Received files or payload has to be converted, copied into streams def import_row(self, info, urls, data, y=5000): # Internal target dicts cn = self.parent.channel() rows = [] |