mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-15 19:28:00 +01:00
Support currently suggested ipfs URLs
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
## master
|
||||
|
||||
* Playing asciicast from stdin: `cat demo.json | asciinema play -`
|
||||
* Playing asciicast from IPFS: `asciinema play ipfs://QmcdXYJp6e4zNuimuGeWPwNMHQdxuqWmKx7NhZofQ1nw2V`
|
||||
* Playing asciicast from IPFS: `asciinema play ipfs://ipfs/QmcdXYJp6e4zNuimuGeWPwNMHQdxuqWmKx7NhZofQ1nw2V`
|
||||
* `-q/--quiet` option added to `rec` command
|
||||
|
||||
## 1.1.1 (2015-06-21)
|
||||
|
||||
@@ -61,13 +61,12 @@ func Save(asciicast *Asciicast, path string) error {
|
||||
|
||||
// asciinema play file.json
|
||||
// asciinema play https://asciinema.org/a/123.json
|
||||
// asciinema play ipfs://QmbdpNCwqeZgnmAWBCQcs8u6Ts6P2ku97tfKAycE1XY88p
|
||||
// asciinema play ipfs://ipfs/QmbdpNCwqeZgnmAWBCQcs8u6Ts6P2ku97tfKAycE1XY88p
|
||||
// asciinema play -
|
||||
|
||||
func getSource(url string) (io.ReadCloser, error) {
|
||||
if strings.HasPrefix(url, "ipfs://") {
|
||||
hash := url[7:len(url)]
|
||||
url = fmt.Sprintf("https://ipfs.io/ipfs/%v", hash)
|
||||
url = fmt.Sprintf("https://ipfs.io/%v", url[7:len(url)])
|
||||
}
|
||||
|
||||
if url == "-" {
|
||||
|
||||
Reference in New Issue
Block a user