mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
Improved IPFS support (based on https://github.com/ipfs/go-ipfs/issues/1678#issuecomment-157478515)
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
## master
|
## master
|
||||||
|
|
||||||
* Added playback from stdin: `cat demo.json | asciinema play -`
|
* Added playback from stdin: `cat demo.json | asciinema play -`
|
||||||
* Added playback from IPFS: `asciinema play ipfs://ipfs/QmcdXYJp6e4zNuimuGeWPwNMHQdxuqWmKx7NhZofQ1nw2V`
|
* Added playback from IPFS: `asciinema play ipfs:/ipfs/QmcdXYJp6e4zNuimuGeWPwNMHQdxuqWmKx7NhZofQ1nw2V`
|
||||||
* Added playback from asciicast page URL: `asciinema play https://asciinema.org/a/22124`
|
* Added playback from asciicast page URL: `asciinema play https://asciinema.org/a/22124`
|
||||||
* `-q/--quiet` option added to `rec` command
|
* `-q/--quiet` option added to `rec` command
|
||||||
* Fixed handling of partial UTF-8 sequences in recorded stdout
|
* Fixed handling of partial UTF-8 sequences in recorded stdout
|
||||||
|
|||||||
@@ -114,6 +114,11 @@ Playing from stdin:
|
|||||||
cat /path/to/asciicast.json | asciinema play -
|
cat /path/to/asciicast.json | asciinema play -
|
||||||
curl -sL https://asciinema.org/a/21310.json | asciinema play -
|
curl -sL https://asciinema.org/a/21310.json | asciinema play -
|
||||||
|
|
||||||
|
Playing from IPFS:
|
||||||
|
|
||||||
|
asciinema play ipfs:/ipfs/QmcdXYJp6e4zNuimuGeWPwNMHQdxuqWmKx7NhZofQ1nw2V
|
||||||
|
asciinema play fs:/ipfs/QmcdXYJp6e4zNuimuGeWPwNMHQdxuqWmKx7NhZofQ1nw2V
|
||||||
|
|
||||||
Available options:
|
Available options:
|
||||||
|
|
||||||
* `-w, --max-wait=<sec>` - Reduce replayed terminal inactivity to max <sec> seconds
|
* `-w, --max-wait=<sec>` - Reduce replayed terminal inactivity to max <sec> seconds
|
||||||
|
|||||||
@@ -101,8 +101,10 @@ func getSource(url string) (io.ReadCloser, error) {
|
|||||||
var isHTML bool
|
var isHTML bool
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
if strings.HasPrefix(url, "ipfs://") {
|
if strings.HasPrefix(url, "ipfs:/") {
|
||||||
url = fmt.Sprintf("https://ipfs.io/%v", url[7:len(url)])
|
url = fmt.Sprintf("https://ipfs.io/%v", url[6:])
|
||||||
|
} else if strings.HasPrefix(url, "fs:/") {
|
||||||
|
url = fmt.Sprintf("https://ipfs.io/%v", url[4:])
|
||||||
}
|
}
|
||||||
|
|
||||||
if url == "-" {
|
if url == "-" {
|
||||||
|
|||||||
Reference in New Issue
Block a user