Check-in [5d05601f03]
Overview
| Comment: | Remove ahttp aliases, print warning for "raw" extractor fallback, add some comment headlines for better overview. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
5d05601f03c5fac05e39c166b9eae8cd |
| User & Date: | mario on 2015-05-17 03:04:25 |
| Other Links: | manifest | tags |
Context
|
2015-05-17
| ||
| 03:04 | Minor comment updates, version bumps. check-in: a9cf073956 user: mario tags: trunk | |
| 03:04 | Remove ahttp aliases, print warning for "raw" extractor fallback, add some comment headlines for better overview. check-in: 5d05601f03 user: mario tags: trunk | |
| 03:03 | Get rid of StringIO wrapper for json loading. check-in: d1a36e5bde user: mario tags: trunk | |
Changes
Modified action.py from [02cf432a5f] to [b70f71d85a].
| ︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - - + + + | # Still needs some rewrites to transition off the [url] lists, # and work with full [rows] primarily. (And perhaps it should be # renamed to "playlist" module now). import re import os |
| ︙ | |||
181 182 183 184 185 186 187 | 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | - + + |
for match in [ fmt, major + "/*", "*/*", "video/*", "audio/*" ]:
if cmd_list.get(match):
return cmd_list[match]
log.ERR("No audio player for stream type found")
|
| ︙ | |||
210 211 212 213 214 215 216 | 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | - + + + + + + |
url = convert_playlist(url, listfmt(source), listfmt(dest), local_file=True, row=row)
# insert quoted URL/filepath
return re.sub(rx, quote(url), cmd, 2, re.X)
return "/bin/false"
|
| ︙ | |||
276 277 278 279 280 281 282 | 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | - + |
# Tries to fetch a resource, aborts on ICY responses.
#
def http_probe_get(url):
# HTTP request, abort if streaming server hit (no HTTP/ header, but ICY/ response)
try:
|
| ︙ | |||
301 302 303 304 305 306 307 | 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | - - + + |
# Rejoin into string
content = "\n".join(str.decode(errors='replace') for str in r.iter_lines())
return (mime, content)
|
| ︙ | |||
353 354 355 356 357 358 359 | 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | - + + + + |
log.DATA("input extractor/regex:", fmt, len(self.src))
# specific extractor implementations
if hasattr(self, fmt):
try:
return getattr(self, fmt)()
except Exception as e:
|
| ︙ | |||
539 540 541 542 543 544 545 | 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 | - - + + |
video = re.findall("(mp4|flv|avi|mp2|theora|3gp|nsv|fli|ogv|webm|mng|mxu|wmv|mpv|mkv)", url)
if audio:
return "video/{}".format(*audio)
return "x-audio-video/unknown"
|
| ︙ | |||
624 625 626 627 628 629 630 | 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 | - + |
# M3U
def m3u(self, rows):
txt = "#EXTM3U\n"
for r in rows:
txt += "#EXTINF:-1,%s\n" % r["title"]
|
| ︙ |